← Back to issue list

Refreshing during injection

View original Github issue

Metadata

Project
craft-providers
Number
#174
Type
issue
State
closed
Author
Jupi007
Labels
—
Created
Updated
Closed

Current evaluation

Snap injection failed with 'auto-refresh change in progress'; fixed by merged PR canonical/craft-providers#182 (commit 562257a), which holds auto-refreshes and waits for pending refreshes before injecting snaps.

Resolution: closed resolved

Reason: Maintainer mr-cal noted the legacy snapcraft build provider disabled refreshes before injection and ported that to craft-providers in PR #182, merged as commit 562257a ('bases: disable automatic snap refreshes'), adding Base._disable_and_wait_for_snap_refresh() ('snap refresh --hold' + 'snap watch --last=auto-refresh?') called from setup/warmup.

Evaluated by: mr-cal-bot

No scores available.

Issue body

``` $ snapcraft --verbose Starting Snapcraft 7.2.1.post14+gitc7ce663f Logging execution to '/home/jupiter007/.cache/snapcraft/log/snapcraft-20221109-152303.181976.log' Running on amd64 for amd64 Launching instance... / (32.1s) Traceback (most recent call last): File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/actions/snap_installer.py", line 320, in inject_from_host executor.execute_run( File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/lxd/lxd_instance.py", line 289, in execute_run return self.lxc.exec( File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/lxd/lxc.py", line 329, in exec return runner(final_cmd, **kwargs) # pylint: disable=subprocess-run-check File "/snap/snapcraft/8506/usr/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['lxc', '--project', 'snapcraft', 'exec', 'local:snapcraft-flutter-app-on-amd64-for-amd64-28846576', '--', 'env', 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin', 'SNAPCRAFT_MANAGED_MODE=1', 'snap', 'install', '/tmp/snapcraft.snap', '--classic']' returned non-zero exit status 10. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/bases/buildd.py", line 480, in _install_snaps snap_installer.inject_from_host( File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/actions/snap_installer.py", line 328, in inject_from_host raise SnapInstallationError( craft_providers.actions.snap_installer.SnapInstallationError: failed to install snap 'snapcraft' * Command that failed: 'lxc --project snapcraft exec local:snapcraft-flutter-app-on-amd64-for-amd64-28846576 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin SNAPCRAFT_MANAGED_MODE=1 snap install /tmp/snapcraft.snap --classic' * Command exit code: 10 * Command standard error output: b'error: snap "snapcraft" has "auto-refresh" change in progress\n' Launching instance... - (32.2s) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/lxd/lxd_provider.py", line 126, in launched_environment instance = launch( File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/lxd/launcher.py", line 212, in launch base_configuration.setup(executor=instance) File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/bases/buildd.py", line 354, in setup self._install_snaps(executor=executor, deadline=deadline) File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/bases/buildd.py", line 486, in _install_snaps raise BaseConfigurationError( craft_providers.bases.errors.BaseConfigurationError: failed to inject host's snap 'snapcraft' into target environment. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/snap/snapcraft/8506/bin/snapcraft", line 8, in <module> sys.exit(run()) File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/cli.py", line 228, in run _run_dispatcher(dispatcher) File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/cli.py", line 204, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_cli/dispatcher.py", line 448, in run return self._loaded_command.run(self._parsed_command_args) File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 259, in run super().run(parsed_args) File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 132, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 208, in run _run_command( File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 249, in _run_command _run_in_provider(project, command_name, parsed_args) File "/snap/snapcraft/8506/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 531, in _run_in_provider with provider.launched_environment( File "/snap/snapcraft/8506/usr/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/snap/snapcraft/8506/lib/python3.8/site-packages/craft_providers/lxd/lxd_provider.py", line 140, in launched_environment raise LXDError(str(error)) from error craft_providers.lxd.errors.LXDError: failed to inject host's snap 'snapcraft' into target environment. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Snap injection failed with 'auto-refresh change in progress'; fixed by merged PR canonical/craft-providers#182 (commit 562257a), which holds auto-refreshes and waits for pending refreshes before injecting snaps.
qwen/qwen3.6-35b-a3b — closed resolved Fixed in craft-providers#182 by disabling and waiting for snap refreshes before injection, resolving the auto-refresh change in progress error.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/craft-providers#182 (confidence 99%)

    Merged PR 'bases: disable automatic snap refreshes' (commit 562257a); its summary states it resolves #174.

  • Related To: snapcraft#010fd70 (confidence 70%)

    Legacy snapcraft build provider implementation (build_providers/_snap.py) that was ported to craft-providers per maintainer comment.

Related issues

No related issues found above the similarity threshold.