Fails to spin up a Bolt app due to a proxy connection issue
See original GitHub issueWhile attempting to follow the instructions mentioned on getting started with bolt guide, I got /hello failed with the error “operation_timeout” error.
It is similar to issue #485, and the recommendation was to use only SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET tokens. However, if I don’t provide clientId and clientSecret additionally, the SlackAppServer won’t start ([main] INFO com.slack.api.bolt.jetty.SlackAppServer - ⚡️ Bolt app is running!
). But providing clientId/clientSecret in turn needs Oauth handling.
The behavior is same irrespective of using environment variables or AppConfig approach. Also if I run the app without any token configuration (either via AppConfig or environment variables), the server is starting okay but request url verification fails and slack command fails with the dispatch error (/hello failed with the error "dispatch_failed"
).
Reproducible in:
The Slack SDK version
com.slack.api:bolt-jetty:1.18.0
Java Runtime version
java version “1.8.0_171” Java™ SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot™ 64-Bit Server VM (build 25.171-b11, mixed mode)
OS info
Oracle Linux 7 (4.1.12-124.49.3.1.el7uek.x86_64)
Steps to reproduce:
(Share the commands to run, source code, and project settings (e.g., pom.xml/build.gradle))
1.Install the app with a /hello slash command handler 2. Serve MyApp with the code you proposed in your example (replacing your example slash command name with “/hello”) 3.Use ngrok to expose local environment to Slack app 4.Configure Slack app to use ngrok URL 5.Run app with env vars for the creds specified in the Slack app’s admin pages
Expected result:
SlackAppServer is running and can perform request-url verification and slack command operations.
Sample output when clientId, clientSecret, bot-token and signing keys are provided :
[main] INFO org.eclipse.jetty.util.log - Logging initialized @1666ms to org.eclipse.jetty.util.log.Slf4jLog
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.44.v20210927; built: 2021-09-27T23:02:44.612Z; git: 8da83308eeca865e495e53ef315a249d63ba9332; jvm 1.8.0_171-b11
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@29176cc1{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@6c3f5566{HTTP/1.1, (http/1.1)}{0.0.0.0:8000}
[main] INFO org.eclipse.jetty.server.Server - Started @1895ms
[main] INFO com.slack.api.bolt.jetty.SlackAppServer - ⚡️ Bolt app is running!
Sample output when no tokens are configured :
[main] INFO org.eclipse.jetty.util.log - Logging initialized @1211ms to org.eclipse.jetty.util.log.Slf4jLog
[main] WARN com.slack.api.bolt.App - Skipped adding any authorization middleware - you need to call `app.use(new YourOwnMultiTeamsAuthorization())`
[main] INFO org.eclipse.jetty.server.Server - jetty-9.4.44.v20210927; built: 2021-09-27T23:02:44.612Z; git: 8da83308eeca865e495e53ef315a249d63ba9332; jvm 1.8.0_171-b11
[main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@2928854b{/,null,AVAILABLE}
[main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@6c3f5566{HTTP/1.1, (http/1.1)}{0.0.0.0:8000}
[main] INFO org.eclipse.jetty.server.Server - Started @1440ms
[main] INFO com.slack.api.bolt.jetty.SlackAppServer - ⚡️ Bolt app is running!
Actual result:
Nothing gets logged after
[main] INFO org.eclipse.jetty.util.log - Logging initialized @1672ms to org.eclipse.jetty.util.log.Slf4jLog
Couldn’t perform request url verification or slash command handling.
Requirements
Please make sure if this topic is specific to this SDK. For general questions/issues about Slack API platform or its server-side, could you submit questions at https://my.slack.com/help/requests/new instead. 🙇
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to the those rules.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
@seratch I faced similar issue as this post, I already setup my proxy server, but it still failed with network unreachable issue.
[main] INFO org.eclipse.jetty.util.log - Logging initialized @537ms to org.eclipse.jetty.util.log.Slf4jLog [java.net.SocketException: Network is unreachable (connect failed), java.net.SocketException: Network is unreachable (connect failed)] [main] ERROR com.slack.api.methods.impl.TeamIdCache - Failed to call auth.test API (error: Network is unreachable (connect failed))
here is my snipped code of server start, may I know how can I setup in code to solve this issue?
I’m sure that we’ve provided an answer to your question here. Let us close this issue now but, if you have any follow ups, please feel free to write in!