#✅ - Failed to load default AWS credentials - following quickstart tutorial

11 messages · Page 1 of 1 (latest)

fiery goblet
#

hi,

any help would be appreciated since im blocked by the error in the title.

I followed the tutorial https://docs.amplify.aws/react/start/account-setup/ till the point 4 successully.
So i have a user amplify-admin associated to my AWS account and i have created (by the script executed in aws console CLI) amplify-policy.

Running aws configure sso i don't have error and im successfully redirected to a success page, even if i try aws sso login command.

If i run $ npx ampx sandbox --profile default
or $ npx ampx sandbox im always getting this error
InvalidCredentialError: Failed to load AWS credentials for profile 'default'
Resolution: To configure a new Amplify profile, use npx ampx configure profile.
Cause: Could not load credentials from any providers

Any suggestion to check / fix this issue?

this is my packages / conf :

thanks a lot

#

$ npx ampx info
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1195G7 @ 2.90GHz
Memory: 3.92 GB / 15.65 GB
Binaries:
Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: undefined - undefined
npm: 9.8.0 - C:\Program Files\nodejs\npm.CMD
pnpm: undefined - undefined
NPM Packages:
@aws-amplify/auth-construct: 1.1.6
@aws-amplify/backend: 1.0.4
@aws-amplify/backend-auth: 1.1.0
@aws-amplify/backend-cli: 1.2.3
@aws-amplify/backend-data: 1.1.0
@aws-amplify/backend-deployer: 1.0.4
@aws-amplify/backend-function: 1.2.0
@aws-amplify/backend-output-schemas: 1.1.0
@aws-amplify/backend-output-storage: 1.0.2
@aws-amplify/backend-secret: 1.0.1
@aws-amplify/backend-storage: 1.0.4
@aws-amplify/cli-core: 1.1.2
@aws-amplify/client-config: 1.1.3
@aws-amplify/deployed-backend-client: 1.3.0
@aws-amplify/form-generator: 1.0.1
@aws-amplify/model-generator: 1.0.4
@aws-amplify/platform-core: 1.0.5
@aws-amplify/plugin-types: 1.1.1
@aws-amplify/sandbox: 1.1.2
@aws-amplify/schema-generator: 1.2.1
aws-amplify: 6.5.1
aws-cdk: 2.149.0
aws-cdk-lib: 2.149.0
typescript: 5.5.3
AWS environment variables:
AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
AWS_STS_REGIONAL_ENDPOINTS = regional
No CDK environment variables

lone badger
fiery goblet
#

this is the config file generated after the command aws configure sso
[default]
region = eu-central-1
sso_session = default
sso_account_id = 7172xxxx001
sso_role_name = amplify-policy
[sso-session default]
sso_start_url = https://d-99676155xxx.awsapps.com/start
sso_region = eu-central-1
sso_registration_scopes = sso:account:access

i runned also npx ampx configure profile (even if is not mentioned in docs but was suggested by the error output) and it generated a credentials file in .aws folder
[default]
aws_access_key_id = ASIA2OxxxV32ZRAUD
aws_secret_access_key = xxxxxx

lone badger
#

thanks for the confirmation.
if you run aws sts get-caller-identity --profile default does this show a similar error?

additionally, for a quick test if you remove the existing creds and config file then run aws configure sso-session with a different profile and run the sandbox command with the new profile name does this work as expected?

fiery goblet
#

with the command $ aws sts get-caller-identity --profile amplify-policy-717279690001
{
"UserId": "AROA2OAJTPUITRNY5WPSQ:amplify-admin",
"Account": "717279690001",
"Arn": "arnawssts::717279690001:assumed-role/AWSReservedSSO_amplify-policy
_1d68f33aae3213b5/amplify-admin"
}

i have a response containing userId, Account, ARN

removing the file and running aws configure-sso i only had recreated the config file (credentials is missing) and i still have the error on sanbox launch.

Here the config file created with the sso-session command:
[sso-session default-amplif]
sso_start_url = https://d-99vccccc5ab.awsapps.com/start
sso_region = eu-central-1
sso_registration_scopes = sso:account:access

lone badger
#

hey are you seeing an error message as follows? or is it different?

InvalidCredentialError: Failed to load AWS credentials for profile 'amplify-sso-admin'
Resolution: To configure a new Amplify profile, use npx ampx configure profile.
Cause: Token is expired. To refresh this SSO session run 'aws sso login' with the corresponding profile.
fiery goblet
#

something similar, but i probably found the cause being associated to CygWin on windows. the aws cli and npx ampx use different root folder for .aws folder. Never happened with other command from other frameworks or tools. Anyway at the moment worked for me aligning (copying) manually the config and credentials file in the correct root directory for ampliofy

lone badger
#

interesting, glad to hear you were able to get it working. But curious on the path this initially resolved to. For user that may be using a similar toolset

fiery goblet
#

thanks

winged glenBOT
#

✅ - Failed to load default AWS credentials - following quickstart tutorial