← Back to issue list

Python stack trace running snapcraft if lxd is not installed

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1995877
Type
issue
State
closed
Author
~bceverly
Labels
craft-1466
Created
Updated
Closed

Current evaluation

Fixed by snapcore/snapcraft#3982 (commit 002fa389b), which removed a double emit.pause() call and prevented missing-LDX handling from raising a RuntimeError.

Resolution: closed resolved

Reason: The maintainer identified PR #3982 as the resolution; its merged commit fixes the double emit.pause() call that caused the stack trace when LXD was not installed.

Evaluated by: mr-cal-bot

No scores available.

Issue body

I'm at the Ubuntu Summit in the "how to build a snap" session and I'm running 22.10. I didn't have lxd installed on my machine and when i tried to run snapcraft on a pretty simple snapcraft.yaml file, I got a python stack trace: ceverly@T14:~/dev/snap-examples/hello-world-gtk$ snapcraft -v --debug Starting Snapcraft 7.2.5 Logging execution to '/home/bceverly/.cache/snapcraft/log/snapcraft-20221107-162720.454413.log' Running on amd64 for amd64 Traceback (most recent call last): File "/snap/snapcraft/8496/bin/snapcraft", line 8, in <module> sys.exit(run()) File "/snap/snapcraft/8496/lib/python3.8/site-packages/snapcraft/cli.py", line 228, in run _run_dispatcher(dispatcher) File "/snap/snapcraft/8496/lib/python3.8/site-packages/snapcraft/cli.py", line 204, in _run_dispatcher dispatcher.run() File "/snap/snapcraft/8496/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/8496/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 259, in run super().run(parsed_args) File "/snap/snapcraft/8496/lib/python3.8/site-packages/snapcraft/commands/lifecycle.py", line 132, in run parts_lifecycle.run(self.name, parsed_args) File "/snap/snapcraft/8496/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 208, in run _run_command( File "/snap/snapcraft/8496/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/8496/lib/python3.8/site-packages/snapcraft/parts/lifecycle.py", line 475, in _run_in_provider providers.ensure_provider_is_available(provider) File "/snap/snapcraft/8496/lib/python3.8/site-packages/snapcraft/providers.py", line 74, in ensure_provider_is_available if not LXDProvider.is_provider_installed() and not confirm_with_user( File "/snap/snapcraft/8496/lib/python3.8/site-packages/snapcraft/utils.py", line 259, in confirm_with_user with emit.pause(): File "/snap/snapcraft/8496/lib/python3.8/site-packages/craft_cli/messages.py", line 694, in func raise RuntimeError("Emitter is stopped already") RuntimeError: Emitter is stopped already Installing lxd ($ sudo apt install lxd) and then running ($lxd init) and taking the defaults solved the problem.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by snapcore/snapcraft#3982 (commit 002fa389b), which removed a double emit.pause() call and prevented missing-LDX handling from raising a RuntimeError.
stealth/space-bunny-alpha — closed resolved Snapcraft crashed with 'RuntimeError: Emitter is stopped already' when prompting to install the missing LXD provider. Fixed by merged PR #3982 (commit 002fa389b), which removed a duplicate emit.pause() call.
stealth/space-bunny-alpha — closed resolved Missing LXD triggered a stopped-emitter RuntimeError. Fixed in snapcraft#3938 (commit 792d45f2f) by moving the provider-install confirmation into providers.py.
qwen/qwen3.6-35b-a3b — — Closed without comments. Resolved by updating craft-cli to properly manage emitter state during provider checks, preventing unhandled RuntimeErrors when LXD is missing.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The unhandled RuntimeError triggered by missing LXD was reported but left unaddressed in the thread.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The unhandled RuntimeError when LXD is missing was not addressed.
qwen3.6-35b-a3b-mtp-q6 — — Closed without comments or resolution details. The unhandled RuntimeError when LXD is missing was not addressed, indicating the issue was abandoned or resolved in a subsequent release.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#3982 (confidence 99%)

    Commit 002fa389b fixes the lifecycle double emit.pause() call associated with this failure.

Related issues

Issue Project State Summary Similarity
#1703344 snapcraft cleanbuild exits with a traceback when lxd is not installed snapcraft (launchpad) closed Fixed cleanbuild’s traceback when LXD is absent by handling the missing lxc executable and reporting a clear error. Merged in snapcraft#1400.
74%