<#23398 generate-lockfiles --sync fails with PEX b...
# github-notifications
q
#23398 generate-lockfiles --sync fails with PEX backend when lockfile already exists Issue created by jennevv Describe the bug Updating existing lockfiles with
pants generate-lockfiles --sync
fails. This is caused by the metadata comments not getting stripped from the digest contents in
generate_pex_lockfiles
before being passed to PEX. The bug can be avoided by adding the
separate_lockfile_metadata_file = true
option to the
pants.toml
file, as mentioned in this blog post. Steps to reproduce: 1. Generate a lockfile $ pants generate-lockfiles --resolve=python-default 115606.77 [INFO] Completed: Generate pex lockfile for python-default 115606.80 [INFO] Wrote lockfile for the resolve
python-default
to 3rdparty/python/default_lock.txt 1. Update the lockfile with the sync option $ pants generate-lockfiles --resolve=python-default --sync 115407.43 [INFO] Canceled: Generate pex lockfile for python-default 115409.22 [INFO] Completed: Generate pex lockfile for python-default 115409.24 [ERROR] 1 Exception encountered: Engine traceback: in root .. in pants.core.goals.generate_lockfiles.generate_lockfiles_goal
generate-lockfiles
goal Traceback (most recent call last): File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/core/goals/generate_lockfiles.py", line 593, in generate_lockfiles_goal results = await concurrently( ^^^^^^^^^^^^^^^^^^^ ...<9 lines>... ) ^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/internals/selectors.py", line 238, in Concurrently return await _Concurrently(tuple(__arg0)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/internals/selectors.py", line 49, in await result = yield self.calls ^^^^^^^^^^^^^^^^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/rules.py", line 66, in wrapper return await call ^^^^^^^^^^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/internals/selectors.py", line 37, in await result = yield self ^^^^^^^^^^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/backend/python/goals/lockfile.py", line 196, in generate_pex_lockfile result = await execute_process_or_raise( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<56 lines>... ) ^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/rules.py", line 66, in wrapper return await call ^^^^^^^^^^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/internals/selectors.py", line 37, in await result = yield self ^^^^^^^^^^ File "/nasfs/users/u0167447/.cache/nce/4f07959fafe3296d25d3e3d2c92165cc6933455f0caa80a335a8aaa14c295fb3/bindings/venvs/2.32.0/lib/python3.14/site-packages/pants/engine/process.py", line 390, in fallible_to_exec_result_or_raise raise ProcessExecutionFailure( ...<5 lines>... ) pants.engine.process.ProcessExecutionFailure: Process 'Generate pex lockfile for python-default' failed with exit code 1. stdout: stderr: The lock file at 3rdparty/python/default_lock.txt does not contain valid JSON: Expecting value: line 1 column 1 (char 0) Use
--keep-sandboxes=on_failure
to preserve the process chroot for inspection. Pants version 2.32.0 OS Linux Kernel 6.12.0-124.55.3.el10_1.x86_64 pantsbuild/pants