elegant-florist-94385
08/13/2025, 2:50 PMpants export
. My venv has already been generated, but I'm trying to upgrade an existing package. Generate lockfiles works fine, but I can't export the venv after. It gives me: PermissionError: [Errno 13] Permission denied: '/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/6f2a054e82a173d41ffc60f43ca40e828b28894f76639f69797ecfed44fcca9b/faststream-0.6.0rc0-py3-none-any.whl.lck.work/faststream/__about__.py'
Has anyone seen something like this before? (stacktrace in 🧵 )elegant-florist-94385
08/13/2025, 2:50 PM$ pants export --py-resolve-format=mutable_virtualenv --resolve=universal_resolve
08:47:27.61 [WARN] A plugin is calling `await Effect(InteractiveProcessResult, InteractiveProcess, process)` directly. This will cause restarting logic not to be applied. Use `await run_interactive_process(process)` or `await run_interactive_process_in_environment(process, environment_name)` instead. See <https://github.com/pantsbuild/pants/blob/release_2.26.0/src/python/pants/engine/intrinsics.py> for more details.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/__main__.py", line 236, in <module>
result, should_exit, is_globals = boot(
^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/__main__.py", line 228, in boot
result = bootstrap_pex(
^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex_bootstrapper.py", line 680, in bootstrap_pex
return pex.PEX(entry_point).execute()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex.py", line 579, in execute
result = self._wrap_coverage(self._wrap_profiling, self._execute)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex.py", line 486, in _wrap_coverage
return runner(*args)
^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex.py", line 517, in _wrap_profiling
return runner(*args)
^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex.py", line 618, in _execute
return self.execute_entry(parse_entry_point(self._pex_info_overrides.entry_point))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex.py", line 796, in execute_entry
return self.execute_module(entry_point.module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/unzipped_pexes/1/30c87eeb6cbfeeb90a389a9e2d70ad5089858d75/.bootstrap/pex/pex.py", line 804, in execute_module
return Globals(runpy.run_module(module_name, run_name="__main__", alter_sys=True))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/tools/__main__.py", line 10, in <module>
sys.exit(tools())
^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/tools/main.py", line 72, in main
interpreter = pex_bootstrapper.find_compatible_interpreter(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 321, in find_compatible_interpreter
target = _select_path_interpreter(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 233, in _select_path_interpreter
for interpreter in candidate_interpreters_iter:
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 189, in iter_compatible_interpreters
valid_or_error = _valid_interpreter(interpreter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 167, in _valid_interpreter
return interpreter_test.test_resolve(interp) if interpreter_test else True
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pex_bootstrapper.py", line 82, in test_resolve
pex_environment = PEXEnvironment.mount(
^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/environment.py", line 250, in mount
installed_pex = ensure_installed(pex=pex, pex_root=pex_root, pex_hash=pex_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/layout.py", line 704, in ensure_installed
return _ensure_installed(layout, pex_root, pex_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/layout.py", line 362, in _ensure_installed
_ensure_distributions_installed(
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/layout.py", line 294, in _ensure_distributions_installed
_ensure_distributions_installed_serial(
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/layout.py", line 211, in _ensure_distributions_installed_serial
_install_distribution(item, layout, pex_info, work_dir, install_to)
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/layout.py", line 190, in _install_distribution
layout.extract_dist(
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/layout.py", line 551, in extract_dist
install_wheel_chroot(dist_path, dest_dir)
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pep_427.py", line 128, in install_wheel_chroot
wheel = install_wheel(
^^^^^^^^^^^^^^
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pep_427.py", line 213, in install_wheel
record_files(
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pep_427.py", line 204, in record_files
InstalledWheel.create_installed_file(path=file_abspath, dest_dir=dest)
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/pep_376.py", line 267, in create_installed_file
hashing.file_hash(path, digest=hasher)
File "/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/0f328a89a0aec3dfc0112a39103fc5f45253c30f959c5db4da5260e607dd4a80/pex-2.33.4-py2.py3-none-any.whl/pex/hashing.py", line 185, in file_hash
with open(path, "rb") as fp:
^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/home/luke/.cache/pants/named_caches/pex_root/installed_wheels/0/6f2a054e82a173d41ffc60f43ca40e828b28894f76639f69797ecfed44fcca9b/faststream-0.6.0rc0-py3-none-any.whl.lck.work/faststream/__about__.py'
08:47:29.02 [ERROR] 1 Exception encountered:
Engine traceback:
in root
..
in pants.core.goals.export.export
`export` goal
Traceback (most recent call last):
File "/home/luke/.cache/nce/830340ce637c599fc91aa9134dedaf6fcc4aa28cff14aaee2d17a9fb389f3788/bindings/venvs/2.26.0/lib/python3.11/site-packages/pants/core/goals/export.py", line 223, in export
raise ExportError(f"Failed to write {result.description} to {result_dir}")
pants.core.goals.export.ExportError: Failed to write mutable virtualenv for universal_resolve (using Python 3.12.3) to dist/export/python/virtualenvs/universal_resolve/3.12.3
elegant-florist-94385
08/13/2025, 3:06 PM./dist/export/python/virtualenvs/universal_resolve/3.12.3/bin/pip3 install faststream==0.6.0rc0
works finefast-nail-55400
08/13/2025, 3:08 PMfast-nail-55400
08/13/2025, 3:10 PM[pex-cli]
version = "v2.50.2"
known_versions = [
"v2.50.2|macos_arm64|b787124d85ad26be62e64e0d2a4f6e5ecedb9b6c83e64dbcce835ccc63a1d392|4772270", "v2.50.2|macos_x86_64|b787124d85ad26be62e64e0d2a4f6e5ecedb9b6c83e64dbcce835ccc63a1d392|4772270", "v2.50.2|linux_x86_64|b787124d85ad26be62e64e0d2a4f6e5ecedb9b6c83e64dbcce835ccc63a1d392|4772270", "v2.50.2|linux_arm64|b787124d85ad26be62e64e0d2a4f6e5ecedb9b6c83e64dbcce835ccc63a1d392|4772270",
]
fast-nail-55400
08/13/2025, 3:11 PMelegant-florist-94385
08/13/2025, 3:11 PMelegant-florist-94385
08/13/2025, 3:13 PMfast-nail-55400
08/13/2025, 3:13 PMfast-nail-55400
08/13/2025, 3:14 PM--keep-sandboxes
to get the failing execution sandbox and the pex invocation will be in the __run.sh
script)fast-nail-55400
08/13/2025, 3:14 PMelegant-florist-94385
08/13/2025, 4:34 PM__run.sh
directly, it seems to work.
luke@luke-dev:/tmp/pants-sandbox-gGFS6E$ cat __run.sh
#!/usr/bin/env bash
# This command line should execute the same process as pants did internally.
cd /tmp/pants-sandbox-gGFS6E
env -i CPPFLAGS='' HTTPS_PROXY=$'<http://PITC-Zscaler-Americas-Cincinnati3PR.proxy.corporate.ge.com:80>' HTTP_PROXY=$'<http://PITC-Zscaler-Americas-Cincinnati3PR.proxy.corporate.ge.com:80>' LANG=en_US.UTF-8 LDFLAGS='' NO_PROXY=localhost,127.0.0.1,ge.com,av.ge.com,build.ge.com,gecdn.com PATH=$'/home/luke/.local/bin:/home/luke/.nvm/versions/node/v20.12.2/bin:/home/luke/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin' PEX_IGNORE_RCFILES=true PEX_PYTHON=/home/luke/.cache/nce/830340ce637c599fc91aa9134dedaf6fcc4aa28cff14aaee2d17a9fb389f3788/bindings/venvs/2.26.0/bin/python3.11 PEX_ROOT=.cache/pex_root http_proxy=$'<http://PITC-Zscaler-Americas-Cincinnati3PR.proxy.corporate.ge.com:80>' https_proxy=$'<http://PITC-Zscaler-Americas-Cincinnati3PR.proxy.corporate.ge.com:80>' no_proxy=localhost,127.0.0.1,ge.com,av.ge.com,build.ge.com,gecdn.com /home/luke/.cache/nce/830340ce637c599fc91aa9134dedaf6fcc4aa28cff14aaee2d17a9fb389f3788/bindings/venvs/2.26.0/bin/python3.11 ./pex --tmpdir .tmp --no-emit-warnings --pip-version 24.2 --cert ca-certificates.crt --python-path /usr/bin --interpreter-constraint $'CPython==3.12.*' -- -c $'import hashlib, os, sys\n\npython = os.path.realpath(sys.executable)\nprint(python)\n\nhasher = hashlib.sha256()\nwith open(python, "rb") as fp:\n for chunk in iter(lambda: fp.read(8192), b""):\n hasher.update(chunk)\nprint(hasher.hexdigest())\n'
luke@luke-dev:/tmp/pants-sandbox-gGFS6E$ ./__run.sh
/usr/bin/python3.12
2845674b3fae665f5f6c3f01674fefa4e495f15f5d755ee8f7f1a40575abdc8a
luke@luke-dev:/tmp/pants-sandbox-gGFS6E$
fast-nail-55400
08/13/2025, 5:08 PMfast-nail-55400
08/13/2025, 5:08 PMfast-nail-55400
08/13/2025, 5:09 PMelegant-florist-94385
08/13/2025, 5:10 PMluke@luke-dev:~/.cache/pants/named_caches/pex_root/installed_wheels/0/6f2a054e82a173d41ffc60f43ca40e828b28894f76639f69797ecfed44fcca9b$ ls -al
total 48
drwxrwxr-x 2 luke luke 4096 Aug 13 11:02 .
drwxrwxr-x 265 luke luke 40960 Aug 13 09:11 ..
-rwxrwxr-x 1 luke luke 0 Aug 13 11:02 .faststream-0.6.0rc0-py3-none-any.whl.atomic_directory.lck
That path apparently does not exist. Only an atomic_directory lock. (I'm assuming some kind of tarball gets unpacked there but is then cleaned up on exiting)elegant-florist-94385
08/13/2025, 5:11 PMrm -rf ~/.cache/pants/named_caches
?elegant-florist-94385
08/13/2025, 5:24 PMelegant-florist-94385
08/13/2025, 5:35 PMnamed_caches/downloads
directory.
I unzipped it and apparently all the files inside are only writable?:
luke@luke-dev:~/temp/faststream$ ls -al
total 108
drwxr-xr-x 16 luke luke 4096 Jan 1 1980 .
drwxrwxr-x 4 luke luke 4096 Aug 13 11:32 ..
--w--wx--- 1 luke luke 200 Jan 1 1980 __about__.py
--w--wx--- 1 luke luke 332 Jan 1 1980 annotations.py
--w--wx--- 1 luke luke 3812 Jan 1 1980 app.py
drwxr-xr-x 2 luke luke 4096 Jan 1 1980 asgi
--w--wx--- 1 luke luke 66 Jan 1 1980 cli.py
drwxr-xr-x 11 luke luke 4096 Jan 1 1980 confluent
--w--wx--- 1 luke luke 5714 Jan 1 1980 exceptions.py
--w--wx--- 1 luke luke 974 Jan 1 1980 __init__.py
drwxr-xr-x 12 luke luke 4096 Jan 1 1980 _internal
drwxr-xr-x 11 luke luke 4096 Jan 1 1980 kafka
--w--wx--- 1 luke luke 607 Jan 1 1980 __main__.py
drwxr-xr-x 2 luke luke 4096 Jan 1 1980 message
drwxr-xr-x 3 luke luke 4096 Jan 1 1980 middlewares
drwxr-xr-x 11 luke luke 4096 Jan 1 1980 nats
drwxr-xr-x 2 luke luke 4096 Jan 1 1980 opentelemetry
drwxr-xr-x 2 luke luke 4096 Jan 1 1980 params
drwxr-xr-x 2 luke luke 4096 Jan 1 1980 prometheus
--w--wx--- 1 luke luke 0 Jan 1 1980 py.typed
drwxr-xr-x 11 luke luke 4096 Jan 1 1980 rabbit
drwxr-xr-x 11 luke luke 4096 Jan 1 1980 redis
drwxr-xr-x 2 luke luke 4096 Jan 1 1980 response
--w--wx--- 1 luke luke 5452 Jan 1 1980 security.py
drwxr-xr-x 5 luke luke 4096 Jan 1 1980 specification
--w--wx--- 1 luke luke 627 Jan 1 1980 types.py
fast-nail-55400
08/13/2025, 6:24 PMfast-nail-55400
08/13/2025, 6:25 PMfast-nail-55400
08/13/2025, 6:25 PMfast-nail-55400
08/13/2025, 6:26 PMInteractiveProcess
would be helpfulfast-nail-55400
08/13/2025, 6:26 PMfast-nail-55400
08/13/2025, 6:26 PMInteractiveProcess
is being used by rule codefast-nail-55400
08/13/2025, 6:27 PMfast-nail-55400
08/13/2025, 6:27 PMelegant-florist-94385
08/13/2025, 6:44 PMbrief-scientist-13682
08/13/2025, 6:59 PMelegant-florist-94385
08/13/2025, 7:00 PMbrief-scientist-13682
08/13/2025, 7:00 PMbrief-scientist-13682
08/13/2025, 7:00 PM