cannot assemble assertion account-key-request: "name" header contains invalid characters

Bug #1622047 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Wishlist
Samuele Pedroni

Bug Description

I'm trying to register my key using snapcraft register-key, but it fails with the following message:

error: cannot assemble assertion account-key-request: "name" header contains invalid characters: "Leonardo Arias Fonseca (¡paz y baile!) <email address hidden>"
Command '['snap', 'export-key', '--account=2ddTRA7lnNtC2twvY9a4Uz9rdzmygXct', 'Leonardo Arias Fonseca (¡paz y baile!) <email address hidden>']' returned non-zero exit status 1

Revision history for this message
Loïc Minier (lool) wrote :

Moving this to snapd as I think it's where this would have to be changed; the issue can be reproduced by running the quoted command; in my case:
snap export-key --account=xxxxxxxxxxx 'Loïc Minier <email address hidden>'
error: cannot assemble assertion account-key-request: "name" header contains invalid characters: "Loïc Minier <email address hidden>"

This is matched against a regexp in snapd/asserts/account_key.go:
var validAccountKeyName = regexp.MustCompile(`^(?:[a-z0-9]+-?)*[a-z](?:-?[a-z0-9])*$`)

affects: snapcraft → snapd
Revision history for this message
Loïc Minier (lool) wrote :

I tried adding an UID with just ascii chars, no parenthesis either, but that didn't help as spaces aren't allowed.

What worked was adding an UID like "loicminier" (loic-minier would work too I guess)

Zygmunt Krynicki (zyga)
Changed in snapd:
assignee: nobody → Samuele Pedroni (pedronis)
status: New → Triaged
Revision history for this message
Samuele Pedroni (pedronis) wrote :

we dont' support exporting keys that were not created through snap create-key

Changed in snapd:
importance: Undecided → Wishlist
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.