← Back to issue list

Unable to build charm due to "no such file or directory"

View original Github issue

Metadata

Project
charmcraft
Number
#640
Type
issue
State
closed
Author
knkski
Labels
Created
Updated
Closed

Current evaluation

Closed as not reproducible. Maintainers could not replicate the charmcraft packaging failure involving a missing .tox log file. The reporter resolved it locally by adding the directory to .jujuignore, but no root cause was identified or patched.

Suggested action:

No scores available.

Issue body

``` 2022-01-27 13:41:38.291 Packing the charm 2022-01-27 13:41:38.292 Running ['charmcraft', 'pack', '--bases-index', '0'] 2022-01-27 13:41:38.293 Executing in container: lxc --project charmcraft exec local:charmcraft-knative-activator-23421672-0-0-amd64 --cwd /root -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 charmcraft pack --bases-index 0 2022-01-27 13:41:45.720 :: Packing the charm. Building charm in '/root' Building charm in '/root' - (2.0s) Building charm in '/root' \ (2.1s) Building charm in '/root' | (2.2s) Building charm in '/root' / (2.3s) Building charm in '/root' - (2.4s) Building charm in '/root' \ (2.5s) Building charm in '/root' | (2.6s) Building charm in '/root' / (2.7s) Building charm in '/root' - (2.8s) Building charm in '/root' \ (2.9s) Building charm in '/root' | (3.0s) Building charm in '/root' / (3.1s) Building charm in '/root' - (3.2s) Building charm in '/root' \ (3.3s) Building charm in '/root' Parts processing error: Failed to copy '/root/parts/charm/src/.tox/unit/log/unit-0.log': no such file or directory. 2022-01-27 13:41:45.720 :: Full execution log: '/root/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220127-194142.372953.log' 2022-01-27 13:41:46.021 Executing in container: lxc --project charmcraft exec local:charmcraft-knative-activator-23421672-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 test -f /tmp/charmcraft.log 2022-01-27 13:41:46.245 No logs found in instance. 2022-01-27 13:41:46.245 Executing on host: lxc --project charmcraft config device show local:charmcraft-knative-activator-23421672-0-0-amd64 2022-01-27 13:41:46.401 Executing on host: lxc --project charmcraft config device remove local:charmcraft-knative-activator-23421672-0-0-amd64 disk-/root/project 2022-01-27 13:41:46.632 Executing on host: lxc --project charmcraft stop local:charmcraft-knative-activator-23421672-0-0-amd64 2022-01-27 13:41:48.866 Failed to build charm for bases index '0'. 2022-01-27 13:41:48.868 Traceback (most recent call last): 2022-01-27 13:41:48.869 File "/snap/charmcraft/761/lib/charmcraft/commands/build.py", line 467, in pack_charm_in_instance 2022-01-27 13:41:48.869 instance.execute_run( 2022-01-27 13:41:48.869 File "/snap/charmcraft/761/lib/craft_providers/lxd/lxd_instance.py", line 221, in execute_run 2022-01-27 13:41:48.869 return self.lxc.exec( 2022-01-27 13:41:48.869 File "/snap/charmcraft/761/lib/craft_providers/lxd/lxc.py", line 307, in exec 2022-01-27 13:41:48.869 return runner(final_cmd, **kwargs) # pylint: disable=subprocess-run-check 2022-01-27 13:41:48.869 File "/snap/charmcraft/761/usr/lib/python3.8/subprocess.py", line 516, in run 2022-01-27 13:41:48.869 raise CalledProcessError(retcode, process.args, 2022-01-27 13:41:48.869 subprocess.CalledProcessError: Command '['lxc', '--project', 'charmcraft', 'exec', 'local:charmcraft-knative-activator-23421672-0-0-amd64', '--cwd', '/root', '--', 'env', 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'CHARMCRAFT_MANAGED_MODE=1', 'charmcraft', 'pack', '--bases-index', '0']' returned non-zero exit status 1. 2022-01-27 13:41:48.869 Full execution log: '/home/knkski/snap/charmcraft/common/cache/charmcraft/log/charmcraft-20220127-134105.753748.log' ``` This looks like the relevant line: Parts processing error: Failed to copy '/root/parts/charm/src/.tox/unit/log/unit-0.log': no such file or directory. I was able to remove that temp dir from the charm source directory, and delete the lxd container to get the charm building again, and I'll prevent it from happening again with `.jujuignore`. However, I'm unsure why this was breaking things in the first place, as other charms in the bundle were building fine with a `.tox` directory in them.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6 Closed as not reproducible. Maintainers could not replicate the charmcraft packaging failure involving a missing .tox log file. The reporter resolved it locally by adding the directory to .jujuignore, but no root cause was identified or patched.
qwen/qwen3.6-35b-a3b Reported a charm build failure caused by a missing temporary log file. The author provided a workaround, but maintainers could not reproduce the error. The ticket was closed as not reproducible without a code fix.
qwen3.6-35b-a3b-mtp-q6 Charmcraft pack failed attempting to copy a missing .tox log file. The author resolved it by excluding the directory via .jujuignore. The report was closed as not reproducible after no further reproduction steps were provided.
qwen3.6-35b-a3b-mtp-q6 Closed as not reproducible. The charm build failure caused by a missing tox log file could not be consistently reproduced. The reporter worked around it using .jujuignore, but the issue was abandoned due to lack of reproduction steps.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#501 charmcraft pack fails trying to include a non-existing charm/src/.tox/ charmcraft closed charmcraft pack failed when copying non-existent build directories or files. Users worked around it with charmcraft clean. The issue was closed as fixed upstream in the underlying parts lifecycle code.
77%
#904 Can't build/pack a charm with Focal charmcraft closed Closed as a duplicate. The missing MarkupSafe dependency error was identified as an upstream charm-tools issue tracked in juju/charm-tools#646. Resolution is deferred to that upstream tracker.
70%