Comments for Test the APIs

The complete error message is
Authenticating with User Pool
Getting temporary credentials
Token is not from a supported provider of this identity pool.

Are you sure regarding the region ?

Yes I am using us-east-1 region

I have the same problem as @mikhaelbendavid.

Terminal:

Authenticating with User Pool
Getting temporary credentials
Inaccessible host: cognito-identity.xn--us-east-2-499dua.amazonaws.com'. This service may not be available in theā€˜us-east-2ā€™ā€™ region.

Test user is created exactly like in the tutorial. But in my Users and groups, under username, it shows the UserSub. (thatā€™s the only difference)
What could be the problem?

[ Iā€™m in China tried with VPN on and off, neither worked ]

Many thanks!

I figured out the user pool id was not configured properly

@KatieChen1001Can you post the command you are running? I think it might have something to do with your regions.

Hi @jayair! Thanks for responding! Below is the command I ran:

npx aws-api-gateway-cli-test --username='admin@example.com' --password='Passw0rd!' --user-pool-id='us-east-1_ECL8IZghT' --app-client-id='3qt33ps0jjcbaktnhamned7grf' --cognito-region=ā€˜us-east-1ā€™ --identity-pool-id='us-east-1:d16ca28e-dde0-4d7d-9700-f6e1d0bf069a' --invoke-url='https://dvscriv6oj.execute-api.us-east-1.amazonaws.com/prod' --api-gateway-region=ā€˜us-east-1ā€™ --path-template=ā€˜/supplierInfoā€™ --method='POST' --body='{"content":"hello world","attachment":"hello.jpg"}'

I just tried it on my end. I think your command has some weird single quote characters. For example, it should be this:

--cognito-region='us-east-1'

instead of this:

--cognito-region=ā€˜us-east-1ā€™
1 Like

Resolved! Many thanks! Canā€™t believe it was because of thatā€¦

1 Like

Yeah itā€™s unclear to me why the error message looked like that.

Hi @jayair

I am facing the same error 500 as you mentioned in the screenshot where should i need to check to resolve this ? And how can i able to see the logs that you attached here?

Thanks

Iā€™m getting two confusing things on windows

  1. The issue with the Path
  2. The POST getting stuck in the URLā€¦
npx: installed 1 in 2.013s
Path must be a string. Received undefined
npx: installed 103 in 8.634s
C:\Users\MGeiser\AppData\Roaming\npm-cache\_npx\15740\node_modules\aws-api-gateway-cli-test\index.js
Authenticating with User Pool
Getting temporary credentials
Making API request
{ status: 403,
  statusText: 'Forbidden',
  data:
   { Message: 'User: arn:aws:sts::358227436652:assumed-role/Cognito_NotesIdentityPoolAuth_Role/CognitoIdentityCredentials is not authorized to perform: execute-api:Invoke on resource: arn:aws:execute-api:us-east-1:********6652:k4k529wmxi/prod/POST/notes' } }

@Seeker You can read more about the logs here - https://serverless-stack.com/chapters/debugging-serverless-api-issues.html. But can you post the command and the full output with the error message?

@mgeiser Can I see your full command?

What I run (with the user, pswd and URL slighlty altered) - alsoā€¦Windows 10.

npx aws-api-gateway-cli-test --username xxx@xxx.com --password SomethingElse --user-pool-id us-east-1_IE9roIYdQ --app-client-id g1d7bmlgssg8umnep4gb1md70 --cognito-region us-east-1 --identity-pool-id us-east-1:05fb168b-d7ae-4643-b912-6495a6e2563a --invoke-url https://k4k5wwwwwi.execute-api.us-east-1.amazonaws.com/prod --api-gateway-region us-east-1 --path-template /notes --method POST --body "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}"

Iā€™m not sure about Windows but I think the error is complaining about the path parameter not being set? Maybe it needs quotes around it?

By the ā€œpathā€ do you mean the ā€œinvoke-urlā€ or the ā€œpath-templateā€? I tried both and the various permutations before posting.

What would be helpful is if someone that actually was successful running it on windows could respondā€¦

I also tried changing the / from the path-template to the invoke-urlā€¦no dice there either

updateā€¦it looks like the ā€œpathā€ issue is a red herringā€¦when I ran npx in the next section to create the node project I got the same line but it completed

I recreated the identity pool but still getting the 403. Any help on how to debug?

I deleted the identity pool and recreated again and now it worksā€¦son of a bā€¦

1 Like

Hmm glad it worked out. A lot of times it is related to the way the Identity Pool was configured.

This fixed my problem! can I ask, how did you end up finding this problem existed? Sorry I am new, and I just want to learn the techniques and methods involved in troubleshooting issues. Thanks