← Back to issue list

snapcraft register-key fails

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1816524
Type
issue
State
open
Author
~muthiahn
Labels
—
Created
Updated
Closed
—

Current evaluation

register-key fails on 2.43.1: `snap export-key` dies with GPG 'Operation cancelled' plus a raw CalledProcessError traceback. Peers traced it to ~/.gnupg and pinentry issues; untriaged, no fix.

Suggested action: needs triage

Reason: No labels, assignee, or maintainer response — the only comments are from ~paulcsf, another reporter, who noted identical output and traced it to gnupg ownership/pinentry ('Without sudo, it fails with gpg: signing failed: Operation cancelled'), i.e. a partly environmental root cause. The code path is still unhandled today: snapcraft/commands/keys.py `_export_key` still calls `subprocess.check_output(["snap", "export-key", ...])` and lets `subprocess.CalledProcessError` escape as a traceback, unlike sign-build which raises SignBuildAssertionError and pack which uses SnapPackError with snapd stderr. That is a real, narrow improvement, but confidence is limited by the mixed signal between an environmental gpg/pinentry failure and a snapcraft error-reporting gap.

Evaluated by: mr-cal-bot

Impact: 28 Quick Win: 8 Complexity: 32 Confidence: 58 Actionability: 42

Issue body

Snapcraft register-key We strongly recommend enabling multi-factor authentication: https://help.ubuntu.com/community/SSO/FAQs/2FA Registering key ... error: cannot sign assertion: cannot sign using GPG: /usr/bin/gpg --personal-digest-preferences SHA512 --default-key 0x377B1F6C67A0CDF54EF646F384E85D1824ACA077 --detach-sign failed: exit status 2 ("gpg: signing failed: Operation cancelled\ngpg: signing failed: Operation cancelled\n") Sorry, an error occurred in Snapcraft: Traceback (most recent call last): File "/usr/bin/snapcraft", line 11, in <module> load_entry_point('snapcraft==2.43.1+18.4', 'console_scripts', 'snapcraft')() File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/assertions.py", line 75, in register_key snapcraft.register_key(key_name) File "/usr/lib/python3/dist-packages/snapcraft/_store.py", line 409, in register_key account_key_request = _export_key(key["name"], account_info["account_id"]) File "/usr/lib/python3/dist-packages/snapcraft/_store.py", line 323, in _export_key universal_newlines=True, File "/usr/lib/python3.6/subprocess.py", line 336, in check_output **kwargs).stdout File "/usr/lib/python3.6/subprocess.py", line 418, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['snap', 'export-key', '--account=Q37o0tqlu1Y68t0ydy9rPwo81hLaXBgV', 'muthiah']' returned non-zero exit status 1. We would appreciate it if you created a bug report at https://launchpad.net/snapcraft/+filebug with the above text included.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 28
Quick Win: 8
Complexity: 32
Confidence: 58
Actionability: 42
needs triage register-key fails on 2.43.1: `snap export-key` dies with GPG 'Operation cancelled' plus a raw CalledProcessError traceback. Peers traced it to ~/.gnupg and pinentry issues; untriaged, no fix.
stealth/space-bunny-alpha
Impact: 48
Quick Win: 9
Complexity: 70
Confidence: 88
Actionability: 62
needs triage Snapcraft 2.43.1 register-key fails in snap export-key with GPG "Operation cancelled"; a sudo-only workaround exists, but no maintainer triage or confirmed fix is recorded.
stealth/space-bunny-alpha
Impact: 38
Quick Win: 7
Complexity: 55
Confidence: 87
Actionability: 43
needs triage Snapcraft 2.43.1 register-key fails while snap export-key signs an assertion, with GPG reporting Operation cancelled. No maintainer triage or resolution is recorded.
qwen/qwen3.8-27b
Impact: 20
Quick Win: 12
Staleness: 95
Complexity: 40
Confidence: 70
Support Request: 45
close stale snapcraft 2.43.1 register-key fails with GPG 'Operation cancelled' during snap export-key; 7.5 years old, no labels, zero comments, no maintainer activity; affected 2.x version is long deprecated.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 20
Confidence: 90
Support Request: 75
close stale User reports snapcraft register-key failing with a GPG signing error on version 2.43.1. No maintainer response, inactive for over 7 years.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 85
close stale snapcraft register-key fails with GPG signing cancellation on version 2.43.1. Unanswered for over seven years with no maintainer engagement.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 35
Confidence: 88
Support Request: 92
close stale Report of snapcraft register-key failing due to GPG signing cancellation. Over 7 years old with no maintainer response or reproduction steps, likely stemming from local environment configuration rather than a platform bug.

Update history

Date Change
created

Related work

  • Related To: snapcraft (launchpad)#2065075 (confidence 72%)

    Same register-key command failing on GPG interaction (hang/timeout waiting for GPG input), still open and tracked as CRAFT-2880.

  • Related To: snapcraft (launchpad)#1979907 (confidence 60%)

    Shows the accepted fix pattern for key-command errors: replacing a raw/confusing error with a clear message (shipped in 7.1.1).

Related issues

Issue Project State Summary Similarity
#2065075 snapcraft register-key timeout snapcraft (launchpad) open register-key times out in SSH sessions when GPG cannot present a pinentry prompt; reproduced on Mint/Cinnamon, tracked as CRAFT-2880, with no fix evident in current code
75%