← Back to issue list

Crash when key in snap/keys is not ascii armored

View original Launchpad issue

Metadata

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

Current evaluation

A binary snap/keys asset triggers a UTF-8 decode error instead of a clear validation message; the report is open, unlabeled, and lacks maintainer triage or a confirmed resolution.

Suggested action: needs triage

Reason: The report provides an exact package-repositories configuration, binary key file, and UnicodeDecodeError; its sole comment only adds Snapcraft 4.5.4, with no labels or maintainer assessment. Current code generically wraps exceptions from repo.install(), but that does not establish a specific validation message or a tested resolution.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 16 Complexity: 32 Confidence: 84 Actionability: 78

Issue body

If I put a key in snap/keys/ that is not ascii armored (ie. it's a binary file), snapcraft crashes with: Sorry, an error occurred in Snapcraft: 'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte This is with --enable-experimental-package-repositories and: package-repositories: - type: apt url: file:///home/ubuntu/repo path: . key-id: EE2C5601BCD68938A8A04B9FE257B677BFDF724C and a file called snap/keys/EE2C5601.asc. Expected: a suitable error message. Actual: a crash. Solution: gpg -a --export BFDF724C > snap/keys/EE2C5601.asc In other words, ensure that the file is actually ASCII. The workaround is easy, but there's an opportunity for better handling of this; hence this report.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 30
Quick Win: 16
Complexity: 32
Confidence: 84
Actionability: 78
needs triage A binary snap/keys asset triggers a UTF-8 decode error instead of a clear validation message; the report is open, unlabeled, and lacks maintainer triage or a confirmed resolution.
stealth/space-bunny-alpha
Impact: 32
Quick Win: 20
Complexity: 28
Confidence: 94
Actionability: 87
needs triage Binary snap/keys assets still trigger an unhandled UTF-8 decode error; the precise report remains open, unlabeled, and untriaged.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 19
Complexity: 20
Confidence: 75
Actionability: 80
needs triage Snapcraft crashes with UTF-8 decode error when snap/keys/ contains a binary (non-ASCII armored) GPG key instead of a text file. Valid bug report awaiting triage.
qwen/qwen3.8-27b
Impact: 25
Quick Win: 19
Staleness: 92
Complexity: 25
Confidence: 62
Support Request: 30
needs triage Snapcraft crashes with a raw 'utf-8' decode error instead of a friendly message when a key file in snap/keys/ is binary (not ASCII-armored) for a package-repositories key-id. Untriaged, no labels or comments, ~5.5 years old.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 90
Support Request: 15
close stale Snapcraft crashes with a UTF-8 decoding error when a key file in snap/keys/ is binary instead of ASCII armored. The issue has been inactive for over 5 years with no maintainer response or labels.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 85
Support Request: 5
close stale Snapcraft crashes with a UTF-8 decoding error when a non-ASCII-armored GPG key is placed in snap/keys/. Reported over five years ago with no maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 75
Support Request: 5
needs triage Snapcraft crashes with a UTF-8 decode error when a GPG key in snap/keys/ is binary instead of ASCII armored. The issue is unlabelled, has no maintainer comments, and has been inactive for over five years.

Update history

Date Change
created

Related issues

No related issues found above the similarity threshold.