Crash when key in snap/keys is not ascii armored

Bug #1918998 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Medium
Chris Patterson

Bug Description

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.

Revision history for this message
Robie Basak (racb) wrote :

installed: 4.5.4 (6120) 72MB classic

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Chris Patterson (cjp256)
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.