setup-python: Post setup Python step fails (pipenv cache)

Description: A clear and concise description of what the bug is.

Hey! So this used to work just a few days ago. We’ve been having some issues with cache in the last few days (see here for details), this is a brand new issue which I think might or might not be related to the previous problem. Simply put, the action fails in the post step with the following message.

Post job cleanup.
[2](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:20:2)
Error: Cache folder path is retrieved for pipenv but doesn't exist on disk: /home/runner/.local/share/virtualenvs

Here’s the actual step:

Run actions/setup-python@v3.1.2
[2](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:5:2)
  with:
[3](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:5:3)
    cache: pipenv
[4](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:5:4)
    python-version: 3.9.13
[5](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:5:5)
    token: ***
[6](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:5:7)
Successfully setup CPython (3.9.13)
[7](https://github.com/<org>/<repo>/runs/6889538635?check_suite_focus=true#step:5:8)
pipenv cache is not found

Action version: Specify the action version

3.1.2

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

3.9.13

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

Expected behavior: A description of what you expected to happen.

No issue occurs, the same way it used to work a week ago.

Actual behavior: A description of what is actually happening.

This error message appears on every run.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 11
  • Comments: 23 (3 by maintainers)

Commits related to this issue

Most upvoted comments

      - uses: actions/setup-python@v4
        with:
          python-version: "3.8"
          cache: pip

The error occurs when the job specifies the use of cache but in fact is not using it. Should this affect the entire job? Can the error be converted to a warning so a job is not considered failed?

Same for me.

      - uses: actions/setup-python@v4
        with:
          python-version: 3.11
          cache: 'pipenv'
Error: Cache folder path is retrieved for pipenv but doesn't exist on disk: /home/runner/.local/share/virtualenvs

I’m seeing this error too.

At the risk of sounding very obvious, but maybe this’ll help someone in any case:

We ran into this issue recently. (For example; see here.)

What ‘fixed’ it for us was the realization that whenever this issue occurred, the workflow as a whole needed to skip all the steps that actually required python and/or pip – and then to disable the setup-python step as well whenever that was the case.

(That might also be going on with the reproduction of others’ but in a more subtle way: All of the actions taken that I can see here are for packages that are likely to be included and at latest version anyway, so the cache might never get written to. Again, sorry if that was already obvious.)

In any case, however inelegant it may be, setting up something, not using it, and then cleaning it up again should probably (also) not result in an error. (Just putting that out there, since that is a slightly different case than what OP is talking about, which may or may not require a different approach to solve.)

Hi @dmitry-shibanov no updates beyond that this is still an issue. I tried removing the cache key which obviously removes the error but after adding it back, the error came back too. So I am stuck it seems between not having caching or receiving this error. I don’t have this confirmed yet, but I suspect this error happens only on the master branch and not in other branches. Also this is interesting to me, after I added back the cache key, the next run produced this:

Run actions/setup-python@v3.1.2
  with:
    cache: pipenv
    python-version: 3.9.13
    token: ***
Successfully setup CPython (3.9.13)
pipenv cache is not found

And then in post step

Post job cleanup.
Error: Cache folder path is retrieved for pipenv but doesn't exist on disk: /home/runner/.local/share/virtualenvs