← Back to issue list

Print the error when shelling into the build instance with `--debug`

View original Github issue

Metadata

Project
craft-application
Number
#866
Type
issue
State
closed
Author
tigarmo
Labels
Status: Triaged
Created
Updated
Closed

Current evaluation

Fixed by merged PR canonical/craft-application#897 (commit cb109d2c): with --debug, the build/lifecycle error is now printed before the debug shell opens and again after exit, enabled by canonical/craft-cli#381. Tracked internally as CRAFT-4703.

Resolution: closed resolved

Reason: PR #897 ("feat: print error first with --debug") was merged as commit cb109d2c and the maintainer closed the issue citing that PR. The change makes --debug print the part/scriptlet failure before shelling into the build instance and repeat it after the shell exits.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done The `--debug` flag shells into the build instance in case of an error during the lifecycle, but doesn't show the actual error: ``` ❯ snapcraft pack --debug 'override-build' in part 'xkcd' failed with code 1. Launching shell on build environment... snapcraft-purugupta99-xkcd-scraper-amd64-33817771 ../project# exit 'override-build' in part 'xkcd' failed with code 1. Detailed information: :: + craftctl default :: + install -Dm755 src/scrape.py /root/parts/xkcd/install/bin/xkcd_scraper :: install: cannot stat 'src/scrape.py': No such file or directory Recommended resolution: Review the scriptlet and make sure it's correct. For more information, check out: https://documentation.ubuntu.com/snapcraft/8.11.1/reference/plugins/ Failed to run snapcraft in instance Full execution log: '/home/sergio.schvezov@canonical.com/.local/state/snapcraft/log/snapcraft-20250819-092945.344462.log' ``` ### Why it needs to get done Users will have a better chance of fixing issues if they know what the issue is, presumably.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/craft-application#897 (commit cb109d2c): with --debug, the build/lifecycle error is now printed before the debug shell opens and again after exit, enabled by canonical/craft-cli#381. Tracked internally as CRAFT-4703.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #897 (commit cb109d2c) in craft-application: --debug now prints the build error before opening the shell and repeats it after exit, enabled by craft-cli#381 making report_error public.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/craft-application#897, commit cb109d2c: --debug now prints the build error before and after the shell.
qwen3.6-35b-a3b-mtp-q6 — — Resolved via pull request #897 in canonical/craft-application. The --debug flag now displays the actual build error before shelling into the instance, enabling faster troubleshooting.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 32
Staleness: 55
Complexity: 20
Confidence: 80
Support Request: 0
close stale Request to print the actual build error before/when `--debug` shells into the build instance. Triaged by maintainer; the fix landed in craft-application 5.10.0 (2025-09-10) via PR #897, which now displays the offending error before and after the debug shell.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 20
Confidence: 85
Support Request: 0
keep open Feature request to display the actual error message when using the --debug flag during build failures. Issue is triaged but has been inactive for 11 months.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 15
Confidence: 80
Support Request: 5
keep open Enhancement request to display the actual build error message when shelling into the build instance via the --debug flag. Currently triaged but inactive for over a year.

Update history

Date Change
closed

Related work

  • Likely Fixed By: canonical/craft-application#897 (confidence 99%)

    Merged PR implementing the fix, commit cb109d2c; cited in the closing comment.

  • Blocked By: canonical/craft-cli#381 (confidence 70%)

    Upstream craft-cli change that gates/enables the new debug error output behaviour.

Related issues

Issue Project State Summary Similarity
#897 feat: print error first with `--debug` craft-application merged Merged #897 in cb109d2c: --debug now prints build errors before opening the shell and repeats them after exit, enabled by canonical/craft-cli#381.
82%