← Back to issue list

LXD device gets corrupted when ssh connection is closed

View original Github issue

Metadata

Project
snapcraft
Number
#5942
Type
issue
State
open
Author
soumyaDghosh
Labels
—
Created
Updated
Closed
—

Current evaluation

Untriaged LXD resume failure after SSH disconnect or VM restart: the existing disk device points to a vanished /run/user path. No maintainer response or resolution is recorded.

Suggested action: needs triage

Reason: The report provides reproducible steps, versions, and an exact LXD error showing a missing PID-scoped /run/user source. Craft Application currently selects that ephemeral path for state while the existing-instance launcher starts LXD without repairing the stale mount, but the issue has no labels, assignee, or maintainer assessment.

Evaluated by: mr-cal-bot

Impact: 52 Quick Win: 16 Complexity: 60 Confidence: 89 Actionability: 76

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description I'm using a gcloud compute vm to build snaps. Whenever I am closing the ssh connection, or if the gcloud instance shuts down, and I restart it and continue the snapcraft build, LXD fails to find the old device. ### Steps to reproduce 1. Connect to a gcloud compute instance 2. Start Building the snap 3. Stop the build 4. Close the ssh connection and reconnect 5. See this error ### Environment GCloud Compute instance Snapcraft: version 8.13.2 revision 16570 LXD: version 5.21.4-9eb1368 revision 36971 ### snapcraft.yaml ```yaml ``` ### Log output ```shell Starting instance 2025-12-29 06:54:28.292 Executing on host: lxc --project snapcraft info local:snapcraft-qt-full-amd64-524348 2025-12-29 06:54:28.408 Executing on host: lxc --project snapcraft start local:snapcraft-qt-full-amd64-524348 2025-12-29 06:54:28.540 Failed to start 'snapcraft-qt-full-amd64-524348'. 2025-12-29 06:54:28.540 Detailed information: * Command that failed: 'lxc --project snapcraft start local:snapcraft-qt-full-amd64-524348' * Command exit code: 1 * Command standard error output: b'Error: Failed start validation for device "disk-/tmp/craft-state": Missing source path "/run/user/400433789/356321" for disk "disk-/tmp/craft-state"\nTry `lxc info --show-log local:snapcraft-qt-full-amd64-524348` for more info\n' 2025-12-29 06:54:28.555 Traceback (most recent call last): 2025-12-29 06:54:28.555 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/lxc.py", line 1187, in start 2025-12-29 06:54:28.556 self._run_lxc(command, capture_output=True, project=project) 2025-12-29 06:54:28.556 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/lxc.py", line 206, in _run_lxc 2025-12-29 06:54:28.556 return subprocess.run( 2025-12-29 06:54:28.556 ^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.556 File "/snap/snapcraft/current/usr/lib/python3.12/subprocess.py", line 571, in run 2025-12-29 06:54:28.556 raise CalledProcessError(retcode, process.args, 2025-12-29 06:54:28.556 subprocess.CalledProcessError: Command '['lxc', '--project', 'snapcraft', 'start', 'local:snapcraft-qt-full-amd64-524348']' returned non-zero exit status 1. 2025-12-29 06:54:28.556 2025-12-29 06:54:28.556 The above exception was the direct cause of the following exception: 2025-12-29 06:54:28.557 Traceback (most recent call last): 2025-12-29 06:54:28.557 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/application.py", line 663, in run 2025-12-29 06:54:28.557 return_code = self._run_inner() 2025-12-29 06:54:28.557 ^^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.557 File "/snap/snapcraft/16570/lib/python3.12/site-packages/snapcraft/application.py", line 183, in _run_inner 2025-12-29 06:54:28.557 return_code = super()._run_inner() 2025-12-29 06:54:28.557 ^^^^^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.557 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/application.py", line 640, in _run_inner 2025-12-29 06:54:28.557 return_code = dispatcher.run() or os.EX_OK 2025-12-29 06:54:28.557 ^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.557 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_cli/dispatcher.py", line 564, in run 2025-12-29 06:54:28.558 return self._loaded_command.run(self._parsed_command_args) 2025-12-29 06:54:28.558 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.558 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/base.py", line 222, in run 2025-12-29 06:54:28.558 result = self._run(parsed_args, **kwargs) or result 2025-12-29 06:54:28.558 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.558 File "/snap/snapcraft/16570/lib/python3.12/site-packages/snapcraft/commands/lifecycle.py", line 74, in _run 2025-12-29 06:54:28.558 super()._run(parsed_args) 2025-12-29 06:54:28.558 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 619, in _run 2025-12-29 06:54:28.558 return super()._run(parsed_args=parsed_args, step_name=step_name) 2025-12-29 06:54:28.558 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.559 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 232, in _run 2025-12-29 06:54:28.559 self._run_manager_for_build_plan(fetch_service_policy) 2025-12-29 06:54:28.559 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/commands/lifecycle.py", line 97, in _run_manager_for_build_plan 2025-12-29 06:54:28.559 provider.run_managed(build, bool(fetch_service_policy)) 2025-12-29 06:54:28.559 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/services/provider.py", line 457, in run_managed 2025-12-29 06:54:28.559 with self.instance( 2025-12-29 06:54:28.559 File "/snap/snapcraft/current/usr/lib/python3.12/contextlib.py", line 137, in __enter__ 2025-12-29 06:54:28.559 return next(self.gen) 2025-12-29 06:54:28.559 ^^^^^^^^^^^^^^ 2025-12-29 06:54:28.559 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_application/services/provider.py", line 185, in instance 2025-12-29 06:54:28.559 with provider.launched_environment( 2025-12-29 06:54:28.559 File "/snap/snapcraft/current/usr/lib/python3.12/contextlib.py", line 137, in __enter__ 2025-12-29 06:54:28.560 return next(self.gen) 2025-12-29 06:54:28.560 ^^^^^^^^^^^^^^ 2025-12-29 06:54:28.560 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/lxd_provider.py", line 168, in launched_environment 2025-12-29 06:54:28.560 instance = launch( 2025-12-29 06:54:28.560 ^^^^^^^ 2025-12-29 06:54:28.560 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/launcher.py", line 780, in launch 2025-12-29 06:54:28.560 if instance.exists() and _launch_existing_instance( 2025-12-29 06:54:28.560 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-12-29 06:54:28.560 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/launcher.py", line 429, in _launch_existing_instance 2025-12-29 06:54:28.560 instance.start() 2025-12-29 06:54:28.560 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/lxd_instance.py", line 568, in start 2025-12-29 06:54:28.560 self.lxc.start( 2025-12-29 06:54:28.561 File "/snap/snapcraft/16570/lib/python3.12/site-packages/craft_providers/lxd/lxc.py", line 1189, in start 2025-12-29 06:54:28.561 raise LXDError( 2025-12-29 06:54:28.561 craft_providers.lxd.errors.LXDError: Failed to start 'snapcraft-qt-full-amd64-524348'. 2025-12-29 06:54:28.561 * Command that failed: 'lxc --project snapcraft start local:snapcraft-qt-full-amd64-524348' 2025-12-29 06:54:28.561 * Command exit code: 1 2025-12-29 06:54:28.561 * Command standard error output: b'Error: Failed start validation for device "disk-/tmp/craft-state": Missing source path "/run/user/400433789/356321" for disk "disk-/tmp/craft-state"\nTry `lxc info --show-log local:snapcraft-qt-full-amd64-524348` for more info\n' ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 52
Quick Win: 16
Complexity: 60
Confidence: 89
Actionability: 76
needs triage Untriaged LXD resume failure after SSH disconnect or VM restart: the existing disk device points to a vanished /run/user path. No maintainer response or resolution is recorded.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 29
Complexity: 40
Confidence: 70
Actionability: 70
keep open LXD disk device fails to start after SSH disconnect due to ephemeral /run/user path being cleaned up. Error: Missing source path for disk device.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 22
Staleness: 75
Complexity: 55
Confidence: 65
Support Request: 10
needs triage Snapcraft LXD build instance fails to restart after SSH disconnect/VM reboot because the craft-state disk device points at a transient /run/user/<uid>/<pid> path that no longer exists. Unlabelled, zero comments, 245 days old.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 60
Confidence: 85
Support Request: 10
close stale LXD instance fails to start after SSH disconnect due to missing transient user runtime path. No maintainer activity or comments for 205 days.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 40
Confidence: 85
Support Request: 10
needs triage LXD device fails to start after SSH disconnect due to missing ephemeral source path. Untriaged, 191 days old, no maintainer response.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.