← Back to issue list

Bad error report when the lxd instance is already running

View original Github issue

Metadata

Project
craft-application
Number
#370
Type
issue
State
open
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

craftapp pack fails with a confusing 'Failed to start' LXDError when a prior crashed pack left the LXD instance running; the underlying lxc error 'The instance is already running' is not surfaced. Untriaged, no maintainer response, last activity 465 days ago.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and only an auto-generated Jira-sync bot comment (CRAFT-3093) — no maintainer has acknowledged, categorised, or responded to it, so it needs triage. It is a genuine bug report with a clear reproduction (run craftapp pack twice concurrently) and a concrete log showing lxc stderr 'The instance is already running' being swallowed into a generic 'Failed to start' error. It is not stale-dead: the underlying code path (craft-providers lxc.start raising LXDError 'Failed to start') still exists, and related work in craft-providers (e.g. d5c194b 'store and check PID when launching instances', and the 'already running but not available' handling in lxd_instance.py) shows this area is actively maintained, so closing as stale would be premature.

Impact: 40 Quick Win: 24.0 Staleness: 75 Complexity: 40 Confidence: 60 Support Request: 10

Issue body

### Bug Description I had a `pack` command crash for unrelated reasons, which left the lxd instance running. When running `craftapp pack` again I got the following error: ``` Launching managed ubuntu 22.04 instance... Starting instance Failed to start 'craftapp-hello-on-amd64-for-amd64-1'. Full execution log: '/home/ubuntu/.local/state/craftapp/log/craftapp-20240703-093523.724743.log' ``` ### To Reproduce Run `craftapp pack`, and in another terminal run `craftapp pack` in the same directory again ### part yaml ```shell n/a ``` ### Relevant log output ```shell 2024-07-03 09:35:29.737 craft_providers.lxd.errors.LXDError: Failed to start 'craftapp-hello-on-amd64-for-amd64-1'. 2024-07-03 09:35:29.737 * Command that failed: 'lxc --project craftapp start local:craftapp-hello-on-amd64-for-amd64-1' 2024-07-03 09:35:29.737 * Command exit code: 1 2024-07-03 09:35:29.737 * Command standard error output: b'Error: The instance is already running\n' ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 24.0
Staleness: 75
Complexity: 40
Confidence: 60
Support Request: 10
needs triage craftapp pack fails with a confusing 'Failed to start' LXDError when a prior crashed pack left the LXD instance running; the underlying lxc error 'The instance is already running' is not surfaced. Untriaged, no maintainer response, last activity 465 days ago.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 30
Confidence: 75
Support Request: 10
close stale Bug report about a misleading error message when running 'craftapp pack' on an already running LXD instance. Issue is 748 days old with no maintainer resolution or further discussion since initial bot acknowledgment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 80
Support Request: 10
needs triage Unhandled LXD error when instance is already running produces a confusing "Failed to start" message. Untriaged, unlabelled, and inactive for over two years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 75
Support Request: 0
close stale craftapp pack shows a generic failure message when an LXD instance is already running instead of clearly indicating the conflict. Open with an internal Jira ticket, awaiting triage and fix.

Update history

No update history recorded yet.

Related work

  • Related To: craft-providers#464 (confidence 55%)

    craft-providers commit d5c194b 'feat(lxd): store and check PID when launching instances' addresses detecting/avoiding conflicts when an instance is already in use, directly related to this 'already running' error-reporting problem.

Related issues

No related issues found above the similarity threshold.