Any idea what could be causing this: ```apig-test ...
# guide
t
Any idea what could be causing this:
Copy code
apig-test --username='*****' --password='*****' --user-pool-id='us-east-1_*****' --app-client-id='*****' --cognito-region='us-east-1' --identity-pool-id='us-east-1:*****' --invoke-url='<https://570f9qril4.execute-api.us-east-1.amazonaws.com>' --api-gateway-region='us-east-1' --path-template='/notes' --method='POST' --body='{"content":"hello world","attachment":"hello.jpg"}'

Results in:

Authenticating with User Pool Getting temporary credentials Making API request getaddrinfo ENOTFOUND 570f9qril4.execute-api.us-east-1.amazonaws.comc
Not sure if the logging statement is broken or what - see that funny .comc at the end - but that's not what I've put into the command
f
@Jay any idea on the extra char at the end of the url?
j
Hmm thatโ€™s weird. Iโ€™d need to double check but I think that error is coming from AWS CLI side?
I canโ€™t think of why it would do that. But it looks like the auth part worked though.
t
Is it possible it comes from something misconfigured previously? Its on my colleagues machine. I didnt see the full code ( will check it on Monday)
j
Yeah Iโ€™m not sure what it is. Let me know what you find.
t
Ok, one small update here (which might be critical) - this happens on WINDOWS only ๐Ÿ˜„ For sure when using Git Bash terminal. When I do it in proper bash terminal (WSL2->ubuntu) it works like a charm. So this looks like something os/terminal specific
@Jarek Pietraszek - FYI
if someone wants to look at it (with repro steps) - I can DM the exact call we're making
One more update - works through CMD ๐Ÿ˜„ (of course with properly escaped chars etc). Which means basically that this happens when it's being run on Windows from Git Bash ๐Ÿ˜„
j
Yeah we need to better document the Windows version of these steps. We can add it to this chapter: https://serverless-stack.com/chapters/test-the-apis.html
t
Well - the command there is correct - what's lethal here is following linux-version of the guide while using git bash on windows ๐Ÿ˜„ I guess it's some funny issue inside aws-api-gateway-cli-test itself ๐Ÿ˜„
equally -I'm not really expecting you to find it and fix it - for now probably a friendly warning in the guide to avoid using git bash with aws-api-gateway-cli-test will be enough ๐Ÿ˜„
I didn't really debug it, but I'm pretty confident that THIS is where some awkward shit happens ๐Ÿ˜„
or maybe to put it differently - here it starts - and then it's followed by a whole bunch of funny string manipulation ๐Ÿ˜„
j
Oh yeah that makes sense that it would cause it. Would appreciate a PR if possible!
t
I will try to debug this a bit more and tyr to raise one
j
Thank you!
b
I ran into similar. Tracked it down to the segment:
Copy code
--path-template='/notes'
Even though I'm using git-bash, windows attempts to resolve any string that starts with a single
/
into a path. so it's mangled before it even hits
aws-api-gateway-client
. Change that to
Copy code
--path-template='//notes'
And it will work.