Adding an SSH key fails due to a UnicodeDecodeError
Bug #1270052 reported by
Graham Binns
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Critical
|
Raphaël Badin |
Bug Description
(Observed on Trusty; not verified on other releases yet).
Occasionally, adding an SSH key to a user profile will fail due to a UnicodeDecode error, which prevents the key from being added at all. The error appears to come from conch.
The fact that the key had a character that couldn't be decoded is weird in itself and quite likely due to PEBKAC, but the naked Django error is an unpleasant failure state.
Related branches
lp:~rvb/maas/bug-1270052
- Graham Binns (community): Approve
-
Diff: 45 lines (+11/-3)3 files modifiedsrc/maasserver/models/sshkey.py (+1/-1)
src/maasserver/models/tests/test_sshkey.py (+8/-0)
src/provisioningserver/pxe/config.py (+2/-2)
Changed in maas: | |
assignee: | nobody → Raphaël Badin (rvb) |
status: | Triaged → In Progress |
milestone: | none → 14.04 |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
An ssh key is of the form: <ssh-rsa> <base64-encoded string> <login@laptop>. In your stacktrace, the failure is due to the base64-encoded string not being ASCII (and thus not being a base64-encoded string).
I'm marking this critical since anything that causes Django to crash should be treated critical but the fix is pretty simple: we should add another validator to src/maasserver/ models/ sshkey. py:SSHKey. key to validate that the key is an ascii string.