Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refreshing during injection #174

Closed
Jupi007 opened this issue Nov 9, 2022 · 2 comments
Closed

Refreshing during injection #174

Jupi007 opened this issue Nov 9, 2022 · 2 comments
Assignees
Labels
Bug Something isn't working triaged We will be doing this

Comments

@Jupi007
Copy link

Jupi007 commented Nov 9, 2022

$ 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.
@mr-cal
Copy link
Collaborator

mr-cal commented Nov 15, 2022

The build provider code in snapcraft core18|20 disables and waits for refreshes to complete.

This needs to be ported to craft-providers.

(CRAFT-1472)

@mr-cal mr-cal added Bug Something isn't working triaged We will be doing this labels Nov 15, 2022
@mr-cal mr-cal self-assigned this Dec 7, 2022
@mr-cal
Copy link
Collaborator

mr-cal commented Dec 8, 2022

Resolved with #182

@mr-cal mr-cal closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working triaged We will be doing this
Projects
None yet
Development

No branches or pull requests

2 participants