gryf/slack-backup

Missing Scope error

Closed this issue · 10 comments

I get this error after running the script with the required options

2018-09-16 11:14:12,780 ERROR: missing_scope
2018-09-16 11:14:13,119 ERROR: missing_scope

Upon inspecting the sqlite db, it was found to be empty.

gryf commented

I don't know, I didn't had such issue. Can you reproduce it?

yes. It's reproducible.

gryf commented

Could you please, provide a log with debug? Passing -vv option to the command should do the trick.

Sure. Edited out url and used "teamname" instead.

2018-09-21 16:24:12,611 INFO: No configuration file found
2018-09-21 16:24:12,641 DEBUG: Starting new HTTPS connection (1): <teamname>.slack.com:443
2018-09-21 16:24:13,175 DEBUG: https://<teamname>.slack.com:443 "GET / HTTP/1.1" 200 19372
2018-09-21 16:24:13,891 DEBUG: https://<teamname>.slack.com:443 "POST / HTTP/1.1" 302 0
2018-09-21 16:24:13,896 DEBUG: Starting new HTTPS connection (1): slack.com:443
2018-09-21 16:24:14,008 DEBUG: https://slack.com:443 "GET /checkcookie?redir=https%3A%2F%2F<teamname>.slack.com%2F HTTP/1.1" 302 0
2018-09-21 16:24:14,072 DEBUG: https://<teamname>.slack.com:443 "GET / HTTP/1.1" 302 0
2018-09-21 16:24:14,246 DEBUG: https://<teamname>.slack.com:443 "GET /messages HTTP/1.1" 200 19300
2018-09-21 16:24:14,256 INFO: Fetching and updating user information in DB
2018-09-21 16:24:14,258 DEBUG: Starting new HTTPS connection (1): slack.com:443
2018-09-21 16:24:14,389 DEBUG: https://slack.com:443 "POST /api/users.list HTTP/1.1" 200 96
2018-09-21 16:24:14,392 ERROR: missing_scope
2018-09-21 16:24:14,392 INFO: Fetching and update channels information in DB
2018-09-21 16:24:14,394 DEBUG: Starting new HTTPS connection (1): slack.com:443
2018-09-21 16:24:14,496 DEBUG: https://slack.com:443 "POST /api/channels.list HTTP/1.1" 200 99
2018-09-21 16:24:14,499 ERROR: missing_scope
2018-09-21 16:24:14,499 INFO: Fetching and storing messages in DB
gryf commented

I can't reproduce it :(

Here i my session:

$ slack-backup.sh fetch -vv | tee foo.txt
2018-09-22 20:10:07,104 INFO: Found configuration file: ./slack-backup.ini
2018-09-22 20:10:07,126 DEBUG: Starting new HTTPS connection (1): <team>.slack.com
2018-09-22 20:10:07,757 DEBUG: https://<team>.slack.com:443 "GET / HTTP/1.1" 200 19526
2018-09-22 20:10:08,849 DEBUG: https://<team>.slack.com:443 "POST / HTTP/1.1" 302 0
2018-09-22 20:10:08,858 DEBUG: Starting new HTTPS connection (1): slack.com
2018-09-22 20:10:09,136 DEBUG: https://slack.com:443 "GET /checkcookie?redir=https%3A%2F%2F<team>.slack.com%2F HTTP/1.1" 302 0
2018-09-22 20:10:09,553 DEBUG: https://<team>.slack.com:443 "GET / HTTP/1.1" 302 0
2018-09-22 20:10:09,821 DEBUG: https://<team>.slack.com:443 "GET /messages HTTP/1.1" 200 19308
2018-09-22 20:10:09,829 INFO: Fetching and updating user information in DB
2018-09-22 20:10:09,832 DEBUG: Starting new HTTPS connection (1): slack.com
2018-09-22 20:10:10,110 DEBUG: https://slack.com:443 "POST /api/users.list HTTP/1.1" 200 4122
2018-09-22 20:10:10,161 INFO: URL doesn't seem to be slack internal: https://avatars.slack-edge.com/2017-11-07/268082710097_278f0bebca45143c3cd1_original.png
2018-09-22 20:10:10,165 DEBUG: Starting new HTTPS connection (1): avatars.slack-edge.com
...

After that it fetch all of the channels messages.

gryf commented

I even wiped out the db, and started from scratch, to have huge number of records fetched from slack api, but no luck with reproducing your issue.

BTW, which version of slack-backup do you use?

ver 0.7.

It must have to do with step 3 in
https://api.slack.com/docs/oauth#flow

could it be that my token is causing problems?
what type of token do you have that it's not giving you problems?

OK. Everything worked now.

The problem was that when one creates a token, it must have the appropriate workspace access levels, otherwise you get the "missing_scope" error.

Thank you @gryf

gryf commented

You're welcome :)