← Back to issue list

`charmcraft` lxc container starts failing with `FileNotFoundError` during iterative design

View original Github issue

Metadata

Project
charmcraft
Number
#736
Type
issue
State
closed
Author
ca-scribner
Labels
—
Created
Updated
Closed

Current evaluation

Closed as unreproducible on Charmcraft 2.7/3; the maintainer requested a current reproducer. No fix PR or commit was linked.

Resolution: closed stale

Reason: The final maintainer comment on 2024-09-20 said the failure could not be reproduced on newer Charmcraft versions and asked the reporter to reopen with a Charmcraft 2.7 or 3 reproducer. No resolving change was identified.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Intermittently, we've found that our lxc containers used by `charmcraft pack` will get corrupted in some way, resulting in being unable to `charmcraft pack` the charm until we do a `charmcraft clean`. I don't know if it is always the same error, but one case of this is documented below. This most recently happened when iterating on [this PR](https://github.com/canonical/minio-operator/pull/50). In the few days between initially pushing the PR (when local CI passed) and coming back to make edits from the reviews, the `charmcraft pack` process stopped working. The failure stated: ``` 2022-03-31 10:06:37.119 :: 2022-03-31 14:06:27.987 updated files: {'.git/FETCH_HEAD', '.git/HEAD', '.git/config', '.git/index', 'tox.ini', 'test-requirements.txt', '.git/logs/HEAD', 'tests/unit/test_charm.py', '.git/COMMIT_EDITMSG', 'tests/unit/__pycache__/test_charm.cpython-39-pytest-7.1.1.pyc'} 2022-03-31 10:06:37.119 :: 2022-03-31 14:06:27.987 updated directories: {'.git/refs/heads', '.kube/cache/discovery/127.0.0.1_16443', '.git/objects', 'venv', 'src', '.kube/cache/http', '.pytest_cache/v/cache', 'tests/unit/.pytest_cache', '.tox', '.git/info', '.idea', '.git/refs/remotes/origin', 'tests/integration', "'./.tox", '.git/logs/refs', '.git/hooks'} 2022-03-31 10:06:37.119 :: 2022-03-31 14:06:36.614 Parts processing error: Failed to copy '/root/parts/charm/src/tests/unit/__pycache__/test_charm.cpython-39-pytest-7.1.1.pyc': no such file or directory. 2022-03-31 10:06:37.119 :: 2022-03-31 14:06:36.619 Traceback (most recent call last): 2022-03-31 10:06:37.119 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/utils/file_utils.py", line 146, in copy 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 shutil.copy2(source, destination, follow_symlinks=follow_symlinks) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/usr/lib/python3.8/shutil.py", line 435, in copy2 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 copyfile(src, dst, follow_symlinks=follow_symlinks) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/usr/lib/python3.8/shutil.py", line 264, in copyfile 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 FileNotFoundError: [Errno 2] No such file or directory: '/root/parts/charm/build/tests/unit/__pycache__/test_charm.cpython-39-pytest-7.1.1.pyc' 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 The above exception was the direct cause of the following exception: 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 Traceback (most recent call last): 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/charmcraft/parts.py", line 320, in run 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 aex.execute(actions) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/executor/executor.py", line 269, in execute 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 self._executor.execute(actions) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/executor/executor.py", line 118, in execute 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 self._run_action(act) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/executor/executor.py", line 168, in _run_action 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 handler.run_action(action) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/executor/part_handler.py", line 95, in run_action 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 self._update_action(action, step_info=step_info) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/executor/part_handler.py", line 418, in _update_action 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 handler(step_info) 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/executor/part_handler.py", line 491, in _update_build 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 source.update() 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/sources/local_source.py", line 147, in update 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 self.copy_function( 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 File "/snap/charmcraft/x9/lib/craft_parts/utils/file_utils.py", line 148, in copy 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 raise errors.CopyFileNotFound(source) from err 2022-03-31 10:06:37.120 :: 2022-03-31 14:06:36.619 craft_parts.errors.CopyFileNotFound: Failed to copy '/root/parts/charm/src/tests/unit/__pycache__/test_charm.cpython-39-pytest-7.1.1.pyc': no such file or directory. ``` I looked in the container and noted that `/root/parts/charm/src/tests/unit/__pycache__/` **did not** exist, so likely the error is because it couldn't copy the `.pyc` file because the full path wasn't valid.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed stale Closed as unreproducible on Charmcraft 2.7/3; the maintainer requested a current reproducer. No fix PR or commit was linked.
stealth/space-bunny-alpha — closed stale Closed unresolved on 2024-09-20 by maintainer lengau, who could not reproduce the LXC container corruption on newer Charmcrafts and asked the reporter to reopen with a Charmcraft 2.7/3 reproducer. No code fix.
stealth/space-bunny-alpha — closed stale Closed without a fix after the LXC corruption could not be reproduced on newer Charmcrafts; the reporter was asked to reopen with a 2.7 or 3 reproducer.
stealth/space-bunny-alpha — closed stale Closed after Charmcraft 2.7/3 no longer reproduced the intermittent LXC corruption; reporter was asked to reopen with a current reproducer.
qwen3.6-35b-a3b-mtp-q6 — — Closed without a fix. Maintainer could not reproduce the LXC container corruption causing FileNotFoundError during charmcraft pack on newer versions. Reopen if reproducible on Charmcraft 2.7 or 3.
qwen/qwen3.6-35b-a3b — — Closed as unreproducible. The maintainer could not replicate the LXC container corruption causing FileNotFoundError on newer charmcraft versions. Users should reopen if the issue persists on v2.7 or v3.
qwen3.6-35b-a3b-mtp-q6 — — Closed as unreproducible. Intermittent FileNotFoundError during charmcraft pack LXC container builds could not be replicated on newer Charmcraft versions 2.7 and 3. Maintainers advised reopening if a valid reproducer is available.

Update history

No update history recorded yet.

Related work

  • Related To: minio-operator#50 (confidence 95%)

    The originating iterative-design PR where the failure was observed; it was context, not the resolution.

Related issues

Issue Project State Summary Similarity
#647 `charmcraft build` sometimes fails on `apt install` inside the lxd container charmcraft closed Closed as a duplicate of #567; its dpkg-lock fix merged via PR #745 (commit b1adccd5), adding provider warmup to avoid competing APT updates.
71%
#1338 `charmcraft clean` doesn't clean charmcraft closed Closed unresolved: LXD cleanup remained broken in Charmcraft 3, with the changed behavior attributed to craft-application#425, which also closed without a linked fix.
70%