Adding credential with a space in the access-key causes confusing error while bootstrapping

Bug #1946526 reported by Jeff Pihach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

I recently tried to add a credential for aws using:

`juju add-credential aws`

when it asked for the access key I typed out the key, then secret key then went to bootstrap and got the following error:

```
$ juju bootstrap aws --credential dev

ERROR
The provided credentials could not be validated and
may not be authorized to carry out the request.
Ensure that your account is authorized to use the Amazon EC2 service and
that you are using the correct access keys.
These keys are obtained via the "Security Credentials"
page in the AWS console.
: operation error EC2: DescribeAccountAttributes, https response error StatusCode: 401, RequestID: <redacted>, api error AuthFailure: Credential must have exactly 5 slash-delimited elements, e.g. keyid/date/region/service/term, got 'AKIAQIVPA6MYBOIWCE5B'
```

After inspecting the `credentials.yaml` file I noticed that the value for the access key:

`access-key: 'AKIAQIVPA6MYBOIWCE5B '`

So I must have inadvertently added a trailing space while submitting the key.
Maybe this value should be left and right trimmed on saving.

This was using the Juju 3.0 beta snap from todays date.

Jeff Pihach (hatch)
description: updated
Ian Booth (wallyworld)
tags: added: bitesize
Changed in juju:
milestone: none → 2.9.17
status: New → Triaged
importance: Undecided → Medium
Changed in juju:
milestone: 2.9.17 → 2.9.18
Changed in juju:
milestone: 2.9.18 → 2.9.19
Changed in juju:
milestone: 2.9.19 → 2.9.20
Changed in juju:
milestone: 2.9.20 → 2.9.21
Changed in juju:
milestone: 2.9.21 → 2.9.22
Changed in juju:
milestone: 2.9.22 → 2.9.23
Changed in juju:
milestone: 2.9.23 → 2.9.24
Changed in juju:
milestone: 2.9.24 → 2.9.25
Changed in juju:
milestone: 2.9.25 → 2.9.26
Changed in juju:
milestone: 2.9.26 → 2.9.27
Changed in juju:
milestone: 2.9.27 → 2.9.28
Changed in juju:
milestone: 2.9.28 → 2.9.29
Changed in juju:
milestone: 2.9.29 → 2.9.30
Ian Booth (wallyworld)
Changed in juju:
milestone: 2.9.30 → 2.9-next
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This Medium-priority bug has not been updated in 60 days, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Medium → Low
tags: added: expirebugs-bot
Harry Pidcock (hpidcock)
Changed in juju:
milestone: 2.9-next → 3.2-beta1
Changed in juju:
milestone: 3.2-beta1 → 3.2-rc1
Changed in juju:
milestone: 3.2-rc1 → 3.2.0
Changed in juju:
milestone: 3.2.0 → 3.2.1
Changed in juju:
milestone: 3.2.1 → 3.2.2
Changed in juju:
milestone: 3.2.2 → 3.2.3
Changed in juju:
milestone: 3.2.3 → 3.2.4
Changed in juju:
milestone: 3.2.4 → 3.2.5
Ian Booth (wallyworld)
Changed in juju:
milestone: 3.2.5 → none
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.