← Back to issue list

Core22 Snap builds don't output error logs

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1981072
Type
issue
State
closed
Author
~farshidtz
Labels
core22 craft-1231 lp-snappy snapcraft
Created
Updated
Closed

Current evaluation

Launchpad core22 snap builds showed no error output. Closed as fixed after snapcraft PR canonical/snapcraft#3889 (commit 72ad273f2) plus craft-parts logging fixes; maintainer confirmed Snapcraft 8 reports stdout/stderr for core22 builds.

Resolution: closed resolved

Reason: The bug was reassigned to Snapcraft upstream and later closed by ~mr-cal, who confirmed the fix: canonical/snapcraft#3889 (merged into hotfix/7.1.3 as 72ad273f2) enables developer debug logging for core22 under CRAFT-1231 and handles closed stdin, together with craft-parts improvements for logging build failures, making stdout/stderr appear in Launchpad build logs with Snapcraft 8.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Launchpad build logs don't include error logs for a snap that has core22 base. I understand that this is more of a Snapcraft issue, but I am reporting it here because it directly affects the usability of Launchpad. This happens because Snapcraft 7 behaves differently depending on the snap base. When core22 is used, the error logs are written to a file. However, when building a core18/core20 snap, the errors are printed to the standard output/error as expected. Snapcraft 7 introduces a flag that can be used to increase verbosity and get build logs on the standard output/error, but that flag is backward-incompatible with respect to the snap base. See https://bugs.launchpad.net/snapcraft/+bug/1980515 This limitation makes it very hard to debug and fix build errors as there is no access to local filesystem on an ephemeral CI instance. Here is an example output, which includes very little helpful information on the error: Executing parts lifecycle: build device-usb-camera 'override-build' in part 'device-usb-camera' failed with code 2. Review the scriptlet and make sure it's correct. Full execution log: '/root/.cache/snapcraft/log/snapcraft-20220708-060352.465359.log' Build failed Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/lpbuildd/target/build_snap.py", line 196, in run     self.build()   File "/usr/lib/python3/dist-packages/lpbuildd/target/build_snap.py", line 182, in build     self.run_build_command(   File "/usr/lib/python3/dist-packages/lpbuildd/target/operation.py", line 46, in run_build_command     return self.backend.run(args, cwd=cwd, env=full_env, **kwargs)   File "/usr/lib/python3/dist-packages/lpbuildd/target/lxd.py", line 533, in run     subprocess.check_call(cmd, **kwargs)   File "/usr/lib/python3.8/subprocess.py", line 364, in check_call     raise CalledProcessError(retcode, cmd) Full build log: https://launchpadlibrarian.net/611876831/buildlog_snap_ubuntu_focal_amd64_edgex-device-usb-camera_BUILDING.txt.gz As discussed internally, Snapcraft 7 may change to: - print build error by default (like the versions before it) - accept the -v/--verbose flag regardless of the core version (https://bugs.launchpad.net/snapcraft/+bug/1980515) - detect when there is no TTY terminal and print logs - add support for an environment variable to enable verbose mode, so that it can be set for Snapcraft 7/core22 and lower alike. One workaround is to check the base value in snapcraft.yaml and snapcraft versions and pass the -v/--verbose flag selectively! But Launchpad doesn't seem to have an interface to pass flags to snapcraft, when using the UI or Python launchpadlib.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Launchpad core22 snap builds showed no error output. Closed as fixed after snapcraft PR canonical/snapcraft#3889 (commit 72ad273f2) plus craft-parts logging fixes; maintainer confirmed Snapcraft 8 reports stdout/stderr for core22 builds.
stealth/space-bunny-alpha
Impact: 48
Quick Win: 24
Complexity: 42
Confidence: 96
Actionability: 88
close resolved Resolved upstream: Snapcraft 7 omitted core22 build details from Launchpad logs; later releases fixed verbosity handling and enabled verbose output for non-TTY builds.
stealth/space-bunny-alpha
Impact: 55
Quick Win: 37
Complexity: 30
Confidence: 98
Actionability: 95
close resolved Core22 Launchpad builds hid Snapcraft error details in ephemeral storage; Snapcraft later added non-TTY verbose logging and environment-controlled verbosity.
stealth/space-bunny-alpha
Impact: 58
Quick Win: 40
Complexity: 28
Confidence: 97
Actionability: 95
close resolved Core22 Launchpad builds omitted full Snapcraft errors from stdout. Snapcraft PRs #3889 and #3958 now default non-TTY builds to verbose output and support SNAPCRAFT_VERBOSITY_LEVEL.
qwen3.6-35b-a3b-mtp-q6
Impact: 50
Quick Win: 30
Staleness: 95
Complexity: 40
Confidence: 70
Support Request: 20
close stale Core22 snap builds don't output error logs to stdout/stderr on Launchpad, making debugging difficult. Issue is 4 years old with zero maintainer engagement.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 65
Confidence: 80
Support Request: 10
close stale Core22 Snap builds fail to output error logs to stdout/stderr, hindering CI debugging. The issue has been completely inactive for over four years with no maintainer response or assignee.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 60
Confidence: 85
Support Request: 10
needs triage Reports missing error logs in Launchpad builds for core22 snaps due to Snapcraft 7 behavior changes. Unaddressed for over 4 years with no maintainer comments.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 65
Confidence: 80
Support Request: 10
needs triage Core22 snap builds on Launchpad fail to output error logs due to Snapcraft 7 behavior changes. The issue remains untriaged with zero maintainer comments and has been inactive for nearly four years.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#3889 (confidence 90%)

    Merged PR cited by the closing maintainer as a key part of the fix; adds developer-debug envvar for core22 (CRAFT-1231) and handles the Launchpad non-logging/closed-stdin case.

  • Related To: snapcraft (launchpad)#1980515 (confidence 75%)

    Upstream snapcraft bug on -v/--verbose being backward-incompatible with core22, referenced in the report as the root of the missing logs.

  • Related To: snapcraft (launchpad)#1590807 (confidence 45%)

    Earlier related bug about Snapcraft not storing/retrieving build logs for core22 builds.

Related issues

Issue Project State Summary Similarity
#1976221 Missing linker base while building with core22 base snapcraft (launchpad) closed Resolved by upgrading from legacy Snapcraft to Snapcraft 7.x, which correctly builds core22 snaps; no code fix or linked PR was recorded.
72%
#6450 fix(test): error for core22 snaps snapcraft closed PR #6450 proposed an early core22 error for snapcraft test, but was closed unmerged with review pending; #5479 remains open.
72%
#5291 USB and Core22 and Snap snapcraft closed Closed as Invalid by maintainer mr-cal: USB device visibility on Core22 is a snapd runtime/interface problem, not a Snapcraft build bug; reporter directed to the Snapcraft forum and asked for Snapcraft error logs.
72%
#4186 snap: migrate to core22 snapcraft merged PR #4186 merged, moving the Snapcraft snap's own build environment to base core22 (8 files, +71/-70), landing as commit 60033305b and closing the core22 migration issue #4166.
71%
#1590807 Snapcraft doesn't store build logs snapcraft (launchpad) closed Build logs were addressed for core22 with Snapcraft 7: canonical/snapcraft#2574 (c6b1d9ee6) retrieves Launchpad remote-build logs.
70%