snapcraft cleanbuild exits with a traceback when lxd is not installed
Metadata
Current evaluation
Closed without resolution. Missing LXD caused a FileNotFoundError during snapcraft cleanbuild. No comments, fixes, or status updates were provided.
Suggested action: —
No scores available.
Issue body
I am using a snapcraft 2.31 on a fresh xenial installation. Here is the traceback:
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 32, in <module>
obj=dict(project=snapcraft.ProjectOptions()))
File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 206, in cleanbuild
lifecycle.cleanbuild(project_options, remote)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle.py", line 353, in cleanbuild
metadata=config.get_metadata(), remote=remote).execute()
File "/usr/lib/python3/dist-packages/snapcraft/internal/lxd.py", line 170, in __init__
container_name=container_name, remote=remote)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lxd.py", line 54, in __init__
remote = _get_default_remote()
File "/usr/lib/python3/dist-packages/snapcraft/internal/lxd.py", line 239, in _get_default_remote
default_remote = check_output(['lxc', 'remote', 'get-default'])
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'lxc'
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Missing LXD caused a FileNotFoundError during snapcraft cleanbuild. No comments, fixes, or status updates were provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed. Added dependency validation for the lxc command to prevent the unhandled FileNotFoundError, replacing the traceback with a clear error message when LXD is missing. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned without resolution. The report details a FileNotFoundError crash when running snapcraft cleanbuild without LXD, pointing to missing dependency validation. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without comments or resolution. The report was abandoned due to inactivity, though later snapcraft versions added proper LXD dependency checks to prevent this crash. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1666735 snapcraft cleanbuild does not work with lxd installed via snap | snapcraft (launchpad) | closed | Closed without resolution or merge. The report notes snapcraft cleanbuild fails to detect LXD installed via snap, suggesting checks via snap list or lxc list instead of apt cache. No fix was implemented or documented. | |
| #1697979 snapcraft fails on initial cleanbuild probe | snapcraft (launchpad) | closed | Closed without resolution. Snapcraft cleanbuild failed due to LXD connection errors when LXD was provided via a third-party snap alias. The report received no comments or fixes and was abandoned. | |
| #1746612 Snapcraft cleanbuild doesn't work if you're not using the LXD snap | snapcraft (launchpad) | closed | Closed without resolution. Snapcraft hardcodes the LXD snap path during cleanbuild, causing failures with deb-installed LXD. The report appears abandoned or superseded by updated Snapcraft versions that dynamically detect LXD installations. | |
| #1995877 Python stack trace running snapcraft if lxd is not installed | snapcraft (launchpad) | closed | Closed without resolution. The unhandled RuntimeError triggered by missing LXD was reported but left unaddressed in the thread. | |
| #1890965 snapcraft --use-lxd is broken | snapcraft (launchpad) | closed | Closed without a documented fix. The hardcoded LXD image URL returning 404 broke CI. Likely abandoned or resolved upstream. | |
| #1675516 can't cleanbuild snapcraft itself | snapcraft (launchpad) | closed | Closed without resolution or comments, the report of a failed snapcraft cleanbuild due to missing build-packages was abandoned. | |
| #1570706 Snapcraft cleanbuild command doesn't work | snapcraft (launchpad) | closed | Closed without resolution, likely abandoned or superseded. The cleanbuild command failed due to LXC hash format incompatibility and container stop errors. | |
| #1839014 snapcraft clean with additional arguments doesn't clean anything | snapcraft (launchpad) | closed | Closed without resolution or comments. The bug caused snapcraft clean with arguments to crash with a FileNotFoundError when launching a VM. Likely abandoned due to inactivity. | |
| #1746009 clean is checking lxd remote | snapcraft (launchpad) | closed | Unnecessary LXD remote checks during snapcraft clean were reported but the issue was closed without resolution or fix. No comments or pull requests were created. | |
| #1822372 Snapcraft cleanbuild on Arch Linux with LXD - AppArmor permission error | snapcraft (launchpad) | closed | Closed without resolution due to prolonged inactivity. The report detailed an AppArmor permission error during snapcraft cleanbuild on Arch Linux with LXD. No comments or fixes were provided, indicating the issue was abandoned or marked as invalid. |