Comments for Test the APIs


#101

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


#102

Are you sure regarding the region ?


#103

Yes I am using us-east-1 region


#104

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!


#105

I figured out the user pool id was not configured properly


#106

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


#107

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"}'

#108

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’

#110

Resolved! Many thanks! Can’t believe it was because of that…


#111

Yeah it’s unclear to me why the error message looked like that.


#112

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


#113

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' } }

#114

@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?


#115

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\"}"

#116

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?


#117

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


#118

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?


#119

I deleted the identity pool and recreated again and now it works…son of a b…


#120

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


#121

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