dblock / slack-strava

(Re)Post Strava activities to Slack
https://slava.playplay.io
MIT License
37 stars 6 forks source link

Getting invalid_auth after removing Slava app from Slack and re-adding #67

Closed Adam-Stachelek-Cantina closed 5 years ago

Adam-Stachelek-Cantina commented 5 years ago

Hello,

I made the mistake of removing the Slava app from our Slack organization and when re-adding Slava to our org's apps, adding the App to a channel, and then trying /slava connect I am getting the message invalid_auth on the Slava authorization view.

In the web console I see this:

Failed to load resource. The service responded with 400 bad request for URL https://slava.playplay.io/api/users/5beaee55cfcbb400edb59d6f

Response: { "type": "other_error", "message": "invalid_auth", "backtrace": "/app/vendor/bundle/ruby/2.6.0/gems/slack-ruby-client-0.14.2/lib/slack/web/faraday/response/raise_error.rb:11:in on_complete'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/response.rb:9:inblock in call'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/response.rb:61:in on_complete'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/response.rb:8:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/response.rb:8:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/request/url_encoded.rb:15:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/request/multipart.rb:15:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/rack_builder.rb:143:inbuild_response'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/connection.rb:387:in run_request'\n /app/vendor/bundle/ruby/2.6.0/gems/faraday-0.15.4/lib/faraday/connection.rb:175:inpost'\n /app/vendor/bundle/ruby/2.6.0/gems/slack-ruby-client-0.14.2/lib/slack/web/faraday/request.rb:25:in request'\n /app/vendor/bundle/ruby/2.6.0/gems/slack-ruby-client-0.14.2/lib/slack/web/faraday/request.rb:10:inpost'\n /app/vendor/bundle/ruby/2.6.0/gems/slack-ruby-client-0.14.2/lib/slack/web/api/endpoints/im.rb:93:in im_open'\n /app/slack-strava/models/user.rb:148:indm!'\n /app/slack-strava/models/user.rb:111:in connect!'\n /app/slack-strava/api/endpoints/users_endpoint.rb:18:inblock (2 levels) in '\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:57:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:57:inblock (2 levels) in generate_api_method'\n /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:in instrument'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:56:inblock in generate_api_method'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:263:in block in run'\n /app/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.3/lib/active_support/notifications.rb:170:ininstrument'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:243:in run'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:314:inblock in build_stack'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/middleware/base.rb:31:incall!'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/middleware/base.rb:24:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/middleware/error.rb:38:in block in call!'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/middleware/error.rb:37:incatch'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/middleware/error.rb:37:in call!'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/middleware/base.rb:24:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/rack-2.0.7/lib/rack/head.rb:12:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:227:incall!'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/endpoint.rb:221:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router/route.rb:72:inexec'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:121:in process_route'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:74:inblock in identity'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:93:in transaction'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:72:inidentity'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:57:in block in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:137:inwith_optimization'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/router.rb:56:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/api/instance.rb:131:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/grape.rb:130:in call_with_new_relic'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/api/instance.rb:57:incall!'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/api/instance.rb:52:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/grape-1.2.3/lib/grape/api.rb:51:incall'\n /app/slack-strava/api/middleware.rb:33:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/rack-server-pages-0.1.0/lib/rack/server_pages.rb:46:in serving'\n /app/vendor/bundle/ruby/2.6.0/gems/rack-server-pages-0.1.0/lib/rack/server_pages.rb:36:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/rack-robotz-0.0.4/lib/rack/robotz/middleware.rb:20:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/rack-rewrite-1.5.1/lib/rack/rewrite.rb:24:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/rack-cors-1.0.3/lib/rack/cors.rb:95:incall'\n /app/vendor/bundle/ruby/2.6.0/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in call'\n /app/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:605:inprocess_client'\n /app/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:700:in worker_loop'\n /app/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:548:inspawn_missing_workers'\n /app/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.0/lib/unicorn/http_server.rb:144:in start'\n /app/vendor/bundle/ruby/2.6.0/gems/unicorn-5.5.0/bin/unicorn:128:in<top (required)>'\n /app/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in load'\n /app/vendor/bundle/ruby/2.6.0/bin/unicorn:23:in<top (required)>'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in load'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/cli/exec.rb:74:inkernel_load'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in run'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/cli.rb:463:inexec'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in run'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:ininvoke_command'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in dispatch'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/cli.rb:27:indispatch'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in start'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/cli.rb:18:instart'\n /app/vendor/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in block in <top (required)>'\n /app/vendor/ruby-2.6.2/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:inwith_friendly_errors'\n /app/vendor/ruby-2.6.2/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in <top (required)>'\n /app/vendor/bundle/bin/bundle:104:inload'\n /app/vendor/bundle/bin/bundle:104:in `

'" }

Is there a way to clear this condition? I've tried several times and tried deleting and re-adding Slava several times.

dblock commented 5 years ago

I will check this out, but try /slava disconnect first?

Adam-Stachelek-Cantina commented 5 years ago

Thanks for the response, I did try that with the same result.

dblock commented 5 years ago

Thanks for hanging on here with me. The team's bot token is definitely invalid, which means that the (re)installation of the bot didn't work as expected.

I cleared that installation and you should be able to go to slava.playplay.io, reinstall now and everything will work. If you see any errors during installation, stop and let me know.

Feel free to email dblock at dblock dot org with details or post here.

dblock commented 5 years ago

I also think I have fixed it in https://github.com/dblock/slack-strava/commit/934ce8eae2b84b22e20ff601fe2200dfd8b7731d, but I didn't deploy it yet. That path won't run since I de-activated your bot here anyway.

Adam-Stachelek-Cantina commented 5 years ago

Thanks so much for the help. I was able to remove Slava and re-add the app to our Slack org.