← Back to issue list

ugly error when failed to sign because of wrong password

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1631407
Type
issue
State
open
Author
~elopio
Labels
store
Created
Updated
Closed
—

Current evaluation

Maintainer-requested UX fix: snapcraft sign-build shows raw gpg stderr and a doubly-wrapped 'cannot sign assertion' message on a bad passphrase instead of a readable cause. Still unfixed in snapcraft/commands/keys.py.

Suggested action: keep open

Reason: The reported behavior is still present in the current code: `_generate_snap_build()` in snapcraft/commands/keys.py catches `subprocess.CalledProcessError` and discards its output, raising the generic `SignBuildAssertionError` whose message (store/errors.py:218) carries no cause. Searches for 'cannot sign using GPG' and 'passphrase' in commit history returned no fixing commit, and the only keys.py commits are recent refactors such as 2904d0be2 ('refactor: migrate sign-build command'). Impact is capped at ~27 because signing still fails correctly and this is a maintainer-filed cosmetic/diagnostics request rather than a functional break; actionability is high given the two-step reproducer (`snapcraft sign-build test.snap` plus three wrong passwords) and pinpointed target. Confidence is held below 90 because the issue carries only the `store` label, has zero comments and no assignee, so no maintainer has confirmed this is still a priority or agreed on the preferred message wording.

Evaluated by: mr-cal-bot

Impact: 27 Quick Win: 18 Complexity: 22 Confidence: 84 Actionability: 84

Issue body

If I try to sign a snap, but fail the password three times, I get back this error: error: cannot sign assertion: cannot sign assertion: cannot sign using GPG: /usr/bin/gpg --personal-digest-preferences SHA512 --default-key 0x993DD0E6F134F4FC5EC9498E212D9EBF5179F05F --detach-sign failed: exit status 2 ("gpg: Invalid passphrase; please try again ...\ngpg: Invalid passphrase; please try again ...\ngpg: no default secret key: bad passphrase\ngpg: signing failed: bad passphrase\n") Failed to sign build assertion for u1test20161006_0.1_all.snap. To reproduce: snapcraft sign-build test.snap, and enter the wrong password three times.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 27
Quick Win: 18
Complexity: 22
Confidence: 84
Actionability: 84
keep open Maintainer-requested UX fix: snapcraft sign-build shows raw gpg stderr and a doubly-wrapped 'cannot sign assertion' message on a bad passphrase instead of a readable cause. Still unfixed in snapcraft/commands/keys.py.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 22
Complexity: 10
Confidence: 85
Actionability: 80
keep open sign-build command swallows GPG passphrase error details, showing only a generic failure message instead of the underlying GPG error.
qwen/qwen3.8-27b
Impact: 20
Quick Win: 16
Staleness: 80
Complexity: 20
Confidence: 55
Support Request: 10
needs triage Verbose GPG error shown when snapcraft sign-build fails after 3 wrong passphrases. The command was migrated in #6228 and now raises a cleaner SignBuildAssertionError, but the issue remains open with no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 20
Confidence: 85
Support Request: 10
needs triage Reports a verbose GPG error when entering a wrong password three times during snap signing. The issue is nearly 10 years old with no maintainer response or comments.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 85
Support Request: 10
close stale Request for cleaner GPG error messages when snap signing fails due to an incorrect password. The issue is nearly 10 years old with zero maintainer engagement or comments.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 25
Confidence: 75
Support Request: 15
needs triage Snapcraft sign-build displays verbose GPG error messages when a wrong passphrase is entered multiple times. The issue is unlabelled, has no maintainer comments, and has been inactive for nearly three years.

Update history

Date Change
created

Related issues

Issue Project State Summary Similarity
#1629966 The error when trying to sign without a gpg key is not good snapcraft (launchpad) closed Missing-GPG-key handling for sign-build was improved by merged snapcraft#848, which prompts users to select a key instead of showing an unhelpful error.
74%