Core22 Snap builds don't output error logs

Bug #1981072 reported by Farshid Tavakolizadeh
This bug affects 5 people
Affects Status Importance Assigned to Milestone

Bug Description

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

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/", line 196, in run
  File "/usr/lib/python3/dist-packages/lpbuildd/target/", line 182, in build
  File "/usr/lib/python3/dist-packages/lpbuildd/target/", line 46, in run_build_command
    return, cwd=cwd, env=full_env, **kwargs)
  File "/usr/lib/python3/dist-packages/lpbuildd/target/", line 533, in run
    subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python3.8/", line 364, in check_call
    raise CalledProcessError(retcode, cmd)

Full build log:

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 (
- 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.

Revision history for this message
Farshid Tavakolizadeh (farshidtz) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

My understanding is that this is being worked on by Snapcraft developers, so reassigning it over there since it's not something we can sensibly do anything about.

affects: launchpad → snapcraft
tags: added: craft-1231
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.