Serverless-chatbot woes (slack api error)

Hey guys,

I’m taking an course on the serverless framework. I left a message on the portion I’m having trouble with, but thought i’d stop being so shy and ask for help in other places! Let me know if this wasn’t appropriate.

For those who might be familiar with the course - :// - The part i’m getting stuck on is the first installation function, which generates a generic slack API error (please let me know if the information provided is sensitive, I don’t believe it is)…

I go to create a slack button > add the slack button > selecting forex > checkmarking bot and unchecking everthing else > clicking add to slack my error.html page appears…

checking the error logs, I see the following…

START RequestId: 1742f3fb-980d-11e7-88e2-55c87ca16c93 Version: $LATEST

2017-09-12 15:52:45.388 (-07:00) 1742f3fb-980d-11e7-88e2-55c87ca16c93 Requesting token with 239594296340.239650116689.8104c5b5d591bbb8bfd30b909526fa7a67435188a817fd629a1332b3d7294d5d

2017-09-12 15:52:45.389 (-07:00) 1742f3fb-980d-11e7-88e2-55c87ca16c93 Fetching ://

2017-09-12 15:52:45.566 (-07:00) 1742f3fb-980d-11e7-88e2-55c87ca16c93 [Error: SlackAPIError]

END RequestId: 1742f3fb-980d-11e7-88e2-55c87ca16c93

REPORT RequestId: 1742f3fb-980d-11e7-88e2-55c87ca16c93 Duration: 182.48 ms Billed Duration: 200 ms Memory Size: 1024 MBMax Memory Used: 22 MB

The client ID is correct, I have no idea what’s going on with the secret code, but it contains part of the client ID…

I found a way to get a tad more by taking the http url and entering into my browser.

The original error shared in my post was generating the following json…

[{"ok":false,"error":"invalid_client_id"}]( ) 

I’ve seem to made it past that, and now the error generates the following json error…


I tried regenerating anew secret key, updating server.yml, and redeploying, but to no avail. Still get the same non descriptive API error.

I realize this is probably more of a slack issue, but since the topic of these forums regard serverless apps I wanted to know if anyone has any insight on how I could troubleshoot this further? If more details are needed, I can provide those as well!


I’m quite stumped here, any ideas?

1 Like

note - I removed the (https) from two of the urls since new posers aren’t allowed to share more than tow links.

little more information…

When I try the install feature using the “slack button” at, I get the following error (made the error a little more descriptive so I know where it comes from). Note - it properly redirects me to the error.html…

2017-09-13 08:04:21.329 (-07:00) d2669844-9894-11e7-a275-41b194c286cd [Error: SlackAPIError generated by your requestToken function]
END RequestId: d2669844-9894-11e7-a275-41b194c286cd
REPORT RequestId: d2669844-9894-11e7-a275-41b194c286cd Duration: 258.70 ms Billed Duration: 300 ms Memory Size: 1024 MBMax Memory Used: 23 MB

However, when I run it directly from the command line…

MacBook-Pro:serverless-chatbot hckia$ sls invoke -f install
“statusCode”: 302,
“headers”: {
“Location”: “

Everything works out fine.

START RequestId: effcb7a5-98a2-11e7-8fbf-a1614258a0d9 Version: $LATEST
2017-09-13 09:45:23.966 (-07:00) effcb7a5-98a2-11e7-8fbf-a1614258a0d9 Requesting token with null
END RequestId: effcb7a5-98a2-11e7-8fbf-a1614258a0d9
REPORT RequestId: effcb7a5-98a2-11e7-8fbf-a1614258a0d9 Duration: 4.13 ms Billed Duration: 100 ms Memory Size: 1024 MBMax Memory Used: 22 MB

Hey Cyrus, sorry to hear you’re having problems with the code. Thanks for buying the course!

I’ve posted a request for clarification over on your original A Cloud Guru post, but it looks like an issue with your CLIENT_SECRET environment variable from what I can see so far.

Hey thanks for getting back to me man - I’ll follow up there and if we get stumped come back here to see if anyone has any information.

Found the problem when looking at the code on my github repo.


Null is a normal response from the command line, as it generates no token (I believe), but once I fixed that typo all was well…

START RequestId: 9c22ba3f-98df-11e7-ba0e-29a2ee4a0d83 Version: $LATEST
2017-09-13 16:59:42.576 (-07:00)	9c22ba3f-98df-11e7-ba0e-29a2ee4a0d83	Requesting token with 239594296340.240982104245.aa5b029618242ff653dfcbafd4a468420bc833bdd945f1f5424eb978639308a3
2017-09-13 16:59:42.577 (-07:00)	9c22ba3f-98df-11e7-ba0e-29a2ee4a0d83	Fetching
END RequestId: 9c22ba3f-98df-11e7-ba0e-29a2ee4a0d83
REPORT RequestId: 9c22ba3f-98df-11e7-ba0e-29a2ee4a0d83	Duration: 877.51 ms	Billed Duration: 900 ms 	Memory Size: 1024 MBMax Memory Used: 23 MB

Thanks again!

1 Like