amplify-cli: upgrade to 10.8.1 returning failed to get profile credentials
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
19.6.0
Amplify CLI Version
10.8.2
What operating system are you using?
mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
no
Describe the bug
upgrade to 10.8.2 fails to get profile credentials when performing amplify task. Sends Authorization request multiple times despite currently being logged in before failing with error:
“Failed to get profile credentials. Unexpected token A in JSON at position 0”
Expected behavior
should allow amplify commands the same as v10.8.0
Reproduction steps
- aws-vault exec <account name>
- authenticate
- update schema
- amplify push -y
Project Identifier
9004eca0-6404-4a91-9fae-e5a8474cb213
Log output
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- I have removed any sensitive information from my code snippets and submission.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 36 (14 by maintainers)
Here’s a full output on a freshly installed amplify package, new project.
There is nothing special about profile, standard SSO
and its logged in and working properly, I’ve tried some simple operations like aws s3 ls
I’ve tried to use amplify first time and immediately ended up on this issue. Dear maintainers, this is the first thing customer sees when interacting with the library. I’m sorry to say this, but it’s pretty terrible experience.
Every other web library I’ve used had flawless initial auth flow (usually oauth2 with GitHub).
Hey @adcanis thanks for checking, and apologies for the experience. I was able to reproduce this by using the following steps:
AdministratorAccesshttps://xxxxxx.awsapps.com/start)profileandsso-sessionin~/.aws/config(you can also create this withaws configure ssocredential_processto the created profileamplify/.config/local-aws-info.jsonto use the new SSO profileamplify statusMarking as a bug 🙂
Same issue as @OperationalFallacy. SSO profile is working for the SDK and CDK.
Just a follow up. The issue seems to be with aws sso. When
aws sso login --profile <>is ran to login, it does not update the/.aws/credentialswith the new AWS Access Key ID, AWS Secret Access Key, AWS Session Token. This throws the error experienced above.What i’ve been doing now is logging in, then pasting the new credentials found in
Command line or programmatic accessand performing the amplify commands after.@josefaidt if it helps. The issue seems to be related to my API. I’ve re-pulled the backend, making a small change to my Lambda and
amplify pushwas successful. The API fails with error