Error building pants target due to missing cache file
Filing a bug per instructions in https://www.pantsbuild.org/2.3/docs/using-pants/troubleshooting-common-issues#cache-or-pantsd-invalidation-issues
vscode ➜ /workspace (my_branch) $ pants test ::
22:05:08.32 [INFO] Canceled: Building 17 requirements for requirements.pex from the 3rdparty/python/beam.lock resolve: apache-beam[gcp]==2.61.0, ddtrace==2.17.0, enum-tools==0.12.0, fastapi==0.115.5, frozendict==2.4.6, google-aut... (241 characters truncated)
22:05:09.14 [INFO] Completed: Building pytest.pex from resource://pants.backend.python.subsystems/pytest.lock
22:05:09.80 [INFO] Completed: Building 16 requirements for requirements.pex from the 3rdparty/python/beam.lock resolve: apache-beam[gcp]==2.61.0, ddtrace==2.17.0, enum-tools==0.12.0, fastapi==0.115.5, frozendict==2.4.6, google-aut... (226 characters truncated)
22:05:09.80 [ERROR] 1 Exception encountered:
Engine traceback:
in `test` goal
ProcessExecutionFailure: Process 'Building 16 requirements for requirements.pex from the 3rdparty/python/beam.lock resolve: apache-beam[gcp]==2.61.0, ddtrace==2.17.0, enum-tools==0.12.0, fastapi==0.115.5, frozendict==2.4.6, google-auth==2.30.0, google-cloud-secret-manager==2.20.0, httpx==0.27.0, once-py==0.0.5, pgvector==0.2.5, psycopg[binary,pool]==3.1.19, pydantic==1.10.15, requests==2.32.3, sqlalchemy==2.0.30, strawberry-graphql[cli]==0.260.0, us==3.1.1' failed with exit code 1.
stdout:
stderr:
[Errno 2] No such file or directory: '/home/vscode/.cache/pants/named_caches/pex_root/downloads/1d6751138975dee8c817b4db5e90885105178926d4248fd4cf4c0daa2d287e01/apache_beam-2.61.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl' -> '/tmp/pants-sandbox-LlFZHz/.tmp/tmpu82r5g7a/.deps/apache_beam-2.61.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl'
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
If it's useful, I run this in a docker container, and running docker system prune -af seemed to resolve the error. I'm not sure if that had the effect of clearing the cache, or if it just freed up disk space and this strange error comes as a result of insufficient disk space.
Sorry for the trouble.
Is this a long-lived docker container, where you'd run several commands previously? Or is it short lived, where this is the first (or nearly the first) command?
All good!
It's usually relatively long-lived, I probably rebuild once a week or so? I can't remember if I had rebuilt before this, but I doubt it.
Is this running in docker on MacOS? If so, I wonder if it's related to the VirtioFS issues that also affected https://github.com/pantsbuild/pants/issues/21771#issuecomment-2709373242
It is! Definitely possible. FWIW I've only had this pop up once and have never reproduced it
Well, that's good, sort of.
If it does happen again and you're able to consistently reproduce it, then I guess one thing to try is to switch Docker Desktop from VirtioFS to gRPC FUSE or osxfs and see what happens. But if it doesn't reproduce reliably then that's of limited use as a diagnostic.