← Back to issue list

rockcraft 1.12.0 fails but 1.11.0 works with django-framework extension

View original Github issue

Metadata

Project
rockcraft
Number
#905
Type
issue
State
open
Author
toabctl
Labels
Created
2025-06-24 06:52:45+00:00
Updated
2025-06-24 06:52:45+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description With rockcraft 1.12.0, a github action fails with: ``` 2025-06-24 05:20:59.261 Priming django-framework/install-app 2025-06-24 05:20:59.262 execute action django-framework/install-app:Action(part_name='django-framework/install-app', step=Step.PRIME, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None)) 2025-06-24 05:20:59.299 /root/prime/django/app/climdb/management/commands/aws-import.py: No such file or directory 2025-06-24 05:20:59.299 Detailed information: FileNotFoundError: filename: '/root/prime/django/app/climdb/management/commands/aws-import.py' 2025-06-24 05:20:59.304 Traceback (most recent call last): 2025-06-24 05:20:59.304 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/services/lifecycle.py", line 310, in run 2025-06-24 05:20:59.304 aex.execute(action, stdout=stream, stderr=stream) 2025-06-24 05:20:59.305 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 326, in execute 2025-06-24 05:20:59.305 self._executor.execute(actions, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.305 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 136, in execute 2025-06-24 05:20:59.305 self._run_action(act, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.306 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 213, in _run_action 2025-06-24 05:20:59.306 handler.run_action(action, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.306 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 203, in run_action 2025-06-24 05:20:59.306 state = handler(step_info, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.307 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:20:59.307 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 450, in _run_prime 2025-06-24 05:20:59.307 contents = self._run_step( 2025-06-24 05:20:59.308 ^^^^^^^^^^^^^^^ 2025-06-24 05:20:59.308 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 537, in _run_step 2025-06-24 05:20:59.308 return step_handler.run_builtin() 2025-06-24 05:20:59.309 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:20:59.309 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/step_handler.py", line 115, in run_builtin 2025-06-24 05:20:59.309 return handler() 2025-06-24 05:20:59.309 ^^^^^^^^^ 2025-06-24 05:20:59.309 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/step_handler.py", line 272, in _builtin_prime 2025-06-24 05:20:59.310 files, dirs = migrate_files( 2025-06-24 05:20:59.310 ^^^^^^^^^^^^^^ 2025-06-24 05:20:59.310 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/migration.py", line 124, in migrate_files 2025-06-24 05:20:59.310 file_utils.link_or_copy( 2025-06-24 05:20:59.311 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/utils/file_utils.py", line 114, in link_or_copy 2025-06-24 05:20:59.311 apply_permissions(destination, permissions) 2025-06-24 05:20:59.311 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/permissions.py", line 104, in apply_permissions 2025-06-24 05:20:59.311 permission.apply_permissions(target) 2025-06-24 05:20:59.312 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/permissions.py", line 91, in apply_permissions 2025-06-24 05:20:59.312 os.chown(target, self.owner, self.group) 2025-06-24 05:20:59.312 FileNotFoundError: [Errno 2] No such file or directory: '/root/prime/django/app/climdb/management/commands/aws-import.py' 2025-06-24 05:20:59.400 Emitter: Resuming control of the terminal 2025-06-24 05:20:59.401 Executing in container: lxc --project rockcraft exec local:rockcraft-cloud-image-database-amd64-290326 -- env CRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical test -f /tmp/rockcraft.log 2025-06-24 05:20:59.566 Executing on host: lxc --project rockcraft file pull local:rockcraft-cloud-image-database-amd64-290326/tmp/rockcraft.log /home/runner/tmpwoxaf7tz.tmp-craft/tmpgyhgh_je 2025-06-24 05:20:59.640 Logs retrieved from managed instance: 2025-06-24 05:20:59.647 Executing in container: lxc --project rockcraft exec local:rockcraft-cloud-image-database-amd64-290326 -- env CRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical test -f /tmp/rockcraft-pack.yaml 2025-06-24 05:20:59.815 Could not find state file /tmp/rockcraft-pack.yaml in instance. 2025-06-24 05:20:59.816 Executing on host: lxc --project rockcraft config device show local:rockcraft-cloud-image-database-amd64-290326 2025-06-24 05:20:59.874 Executing on host: lxc --project rockcraft config device remove local:rockcraft-cloud-image-database-amd64-290326 disk-/root/project 2025-06-24 05:20:59.957 Executing on host: lxc --project rockcraft stop local:rockcraft-cloud-image-database-amd64-290326 2025-06-24 05:21:03.869 Executing on host: lxc --project rockcraft list local: --format=yaml 2025-06-24 05:21:03.942 Executing on host: lxc --project rockcraft list local: --format=yaml 2025-06-24 05:21:04.015 Failed to run rockcraft in instance 2025-06-24 05:21:04.021 Traceback (most recent call last): 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/services/provider.py", line 448, in run_managed 2025-06-24 05:21:04.022 instance.execute_run( # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType] 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_providers/lxd/lxd_instance.py", line 254, in execute_run 2025-06-24 05:21:04.022 return self.lxc.exec( 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_providers/lxd/lxc.py", line 390, in exec 2025-06-24 05:21:04.022 return runner(final_cmd, timeout=timeout, check=check, **kwargs) 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/current/usr/lib/python3.12/subprocess.py", line 571, in run 2025-06-24 05:21:04.022 raise CalledProcessError(retcode, process.args, 2025-06-24 05:21:04.022 subprocess.CalledProcessError: Command '['lxc', '--project', 'rockcraft', 'exec', 'local:rockcraft-cloud-image-database-amd64-290326', '--cwd', '/root/project', '--', 'env', 'CRAFT_MANAGED_MODE=1', 'DEBIAN_FRONTEND=noninteractive', 'DEBCONF_NONINTERACTIVE_SEEN=true', 'DEBIAN_PRIORITY=critical', 'CRAFT_PLATFORM=amd64', 'CRAFT_VERBOSITY_LEVEL=TRACE', 'rockcraft', 'pack', '--verbosity', 'trace']' returned non-zero exit status 1. 2025-06-24 05:21:04.022 2025-06-24 05:21:04.022 The above exception was the direct cause of the following exception: 2025-06-24 05:21:04.022 Traceback (most recent call last): 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/application.py", line 615, in run 2025-06-24 05:21:04.022 return_code = self._run_inner() 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/application.py", line 594, in _run_inner 2025-06-24 05:21:04.022 return_code = dispatcher.run() or os.EX_OK 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 528, in run 2025-06-24 05:21:04.022 return self._loaded_command.run(self._parsed_command_args) 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/base.py", line 199, in run 2025-06-24 05:21:04.022 result = self._run(parsed_args, **kwargs) or result 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 475, in _run 2025-06-24 05:21:04.022 return super()._run(parsed_args=parsed_args, step_name=step_name) 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.023 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 181, in _run 2025-06-24 05:21:04.023 self._run_manager_for_build_plan(fetch_service_policy) 2025-06-24 05:21:04.023 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 90, in _run_manager_for_build_plan 2025-06-24 05:21:04.023 provider.run_managed(build, bool(fetch_service_policy)) 2025-06-24 05:21:04.023 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/services/provider.py", line 455, in run_managed 2025-06-24 05:21:04.023 raise craft_providers.ProviderError( 2025-06-24 05:21:04.023 craft_providers.errors.ProviderError: Failed to run rockcraft in instance 2025-06-24 05:21:04.023 Full execution log: '/home/runner/.local/state/rockcraft/log/rockcraft-20250624-051345.022087.log' Error: The process '/usr/bin/sudo' failed with exit code 1 ``` See https://github.com/canonical/cloud-image-database/actions/runs/15830084495/job/44655903679?pr=262 for the failed action The same rockcraft.yaml file passes with 1.11.0 . See https://github.com/canonical/cloud-image-database/actions/runs/15498621317/job/43641196108 ### To Reproduce Build the rock with rockcraft 1.12.0 ### Environment Github action runner. ### rockcraft.yaml ```yaml See https://github.com/canonical/cloud-image-database/blob/main/rockcraft.yaml ``` ### Relevant log output ```shell 2025-06-24 05:20:59.261 Priming django-framework/install-app 2025-06-24 05:20:59.262 execute action django-framework/install-app:Action(part_name='django-framework/install-app', step=Step.PRIME, action_type=ActionType.RUN, reason=None, project_vars=None, properties=ActionProperties(changed_files=None, changed_dirs=None)) 2025-06-24 05:20:59.299 /root/prime/django/app/climdb/management/commands/aws-import.py: No such file or directory 2025-06-24 05:20:59.299 Detailed information: FileNotFoundError: filename: '/root/prime/django/app/climdb/management/commands/aws-import.py' 2025-06-24 05:20:59.304 Traceback (most recent call last): 2025-06-24 05:20:59.304 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/services/lifecycle.py", line 310, in run 2025-06-24 05:20:59.304 aex.execute(action, stdout=stream, stderr=stream) 2025-06-24 05:20:59.305 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 326, in execute 2025-06-24 05:20:59.305 self._executor.execute(actions, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.305 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 136, in execute 2025-06-24 05:20:59.305 self._run_action(act, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.306 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/executor.py", line 213, in _run_action 2025-06-24 05:20:59.306 handler.run_action(action, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.306 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 203, in run_action 2025-06-24 05:20:59.306 state = handler(step_info, stdout=stdout, stderr=stderr) 2025-06-24 05:20:59.307 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:20:59.307 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 450, in _run_prime 2025-06-24 05:20:59.307 contents = self._run_step( 2025-06-24 05:20:59.308 ^^^^^^^^^^^^^^^ 2025-06-24 05:20:59.308 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/part_handler.py", line 537, in _run_step 2025-06-24 05:20:59.308 return step_handler.run_builtin() 2025-06-24 05:20:59.309 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:20:59.309 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/step_handler.py", line 115, in run_builtin 2025-06-24 05:20:59.309 return handler() 2025-06-24 05:20:59.309 ^^^^^^^^^ 2025-06-24 05:20:59.309 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/step_handler.py", line 272, in _builtin_prime 2025-06-24 05:20:59.310 files, dirs = migrate_files( 2025-06-24 05:20:59.310 ^^^^^^^^^^^^^^ 2025-06-24 05:20:59.310 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/executor/migration.py", line 124, in migrate_files 2025-06-24 05:20:59.310 file_utils.link_or_copy( 2025-06-24 05:20:59.311 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/utils/file_utils.py", line 114, in link_or_copy 2025-06-24 05:20:59.311 apply_permissions(destination, permissions) 2025-06-24 05:20:59.311 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/permissions.py", line 104, in apply_permissions 2025-06-24 05:20:59.311 permission.apply_permissions(target) 2025-06-24 05:20:59.312 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_parts/permissions.py", line 91, in apply_permissions 2025-06-24 05:20:59.312 os.chown(target, self.owner, self.group) 2025-06-24 05:20:59.312 FileNotFoundError: [Errno 2] No such file or directory: '/root/prime/django/app/climdb/management/commands/aws-import.py' 2025-06-24 05:20:59.400 Emitter: Resuming control of the terminal 2025-06-24 05:20:59.401 Executing in container: lxc --project rockcraft exec local:rockcraft-cloud-image-database-amd64-290326 -- env CRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical test -f /tmp/rockcraft.log 2025-06-24 05:20:59.566 Executing on host: lxc --project rockcraft file pull local:rockcraft-cloud-image-database-amd64-290326/tmp/rockcraft.log /home/runner/tmpwoxaf7tz.tmp-craft/tmpgyhgh_je 2025-06-24 05:20:59.640 Logs retrieved from managed instance: 2025-06-24 05:20:59.647 Executing in container: lxc --project rockcraft exec local:rockcraft-cloud-image-database-amd64-290326 -- env CRAFT_MANAGED_MODE=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical test -f /tmp/rockcraft-pack.yaml 2025-06-24 05:20:59.815 Could not find state file /tmp/rockcraft-pack.yaml in instance. 2025-06-24 05:20:59.816 Executing on host: lxc --project rockcraft config device show local:rockcraft-cloud-image-database-amd64-290326 2025-06-24 05:20:59.874 Executing on host: lxc --project rockcraft config device remove local:rockcraft-cloud-image-database-amd64-290326 disk-/root/project 2025-06-24 05:20:59.957 Executing on host: lxc --project rockcraft stop local:rockcraft-cloud-image-database-amd64-290326 2025-06-24 05:21:03.869 Executing on host: lxc --project rockcraft list local: --format=yaml 2025-06-24 05:21:03.942 Executing on host: lxc --project rockcraft list local: --format=yaml 2025-06-24 05:21:04.015 Failed to run rockcraft in instance 2025-06-24 05:21:04.021 Traceback (most recent call last): 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/services/provider.py", line 448, in run_managed 2025-06-24 05:21:04.022 instance.execute_run( # pyright: ignore[reportUnknownMemberType,reportUnknownVariableType] 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_providers/lxd/lxd_instance.py", line 254, in execute_run 2025-06-24 05:21:04.022 return self.lxc.exec( 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_providers/lxd/lxc.py", line 390, in exec 2025-06-24 05:21:04.022 return runner(final_cmd, timeout=timeout, check=check, **kwargs) 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/current/usr/lib/python3.12/subprocess.py", line 571, in run 2025-06-24 05:21:04.022 raise CalledProcessError(retcode, process.args, 2025-06-24 05:21:04.022 subprocess.CalledProcessError: Command '['lxc', '--project', 'rockcraft', 'exec', 'local:rockcraft-cloud-image-database-amd64-290326', '--cwd', '/root/project', '--', 'env', 'CRAFT_MANAGED_MODE=1', 'DEBIAN_FRONTEND=noninteractive', 'DEBCONF_NONINTERACTIVE_SEEN=true', 'DEBIAN_PRIORITY=critical', 'CRAFT_PLATFORM=amd64', 'CRAFT_VERBOSITY_LEVEL=TRACE', 'rockcraft', 'pack', '--verbosity', 'trace']' returned non-zero exit status 1. 2025-06-24 05:21:04.022 2025-06-24 05:21:04.022 The above exception was the direct cause of the following exception: 2025-06-24 05:21:04.022 Traceback (most recent call last): 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/application.py", line 615, in run 2025-06-24 05:21:04.022 return_code = self._run_inner() 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/application.py", line 594, in _run_inner 2025-06-24 05:21:04.022 return_code = dispatcher.run() or os.EX_OK 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 528, in run 2025-06-24 05:21:04.022 return self._loaded_command.run(self._parsed_command_args) 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/base.py", line 199, in run 2025-06-24 05:21:04.022 result = self._run(parsed_args, **kwargs) or result 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.022 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 475, in _run 2025-06-24 05:21:04.022 return super()._run(parsed_args=parsed_args, step_name=step_name) 2025-06-24 05:21:04.022 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-06-24 05:21:04.023 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 181, in _run 2025-06-24 05:21:04.023 self._run_manager_for_build_plan(fetch_service_policy) 2025-06-24 05:21:04.023 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 90, in _run_manager_for_build_plan 2025-06-24 05:21:04.023 provider.run_managed(build, bool(fetch_service_policy)) 2025-06-24 05:21:04.023 File "/snap/rockcraft/3367/lib/python3.12/site-packages/craft_application/services/provider.py", line 455, in run_managed 2025-06-24 05:21:04.023 raise craft_providers.ProviderError( 2025-06-24 05:21:04.023 craft_providers.errors.ProviderError: Failed to run rockcraft in instance 2025-06-24 05:21:04.023 Full execution log: '/home/runner/.local/state/rockcraft/log/rockcraft-20250624-051345.022087.log' Error: The process '/usr/bin/sudo' failed with exit code 1 ```

Evaluation history

No evaluation history available.