Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent java.net.SocketTimeoutException: timeout on Slack API calls (e.g., conversations.info) #1438

Open
kranti-rh opened this issue Feb 17, 2025 · 1 comment
Labels
project:slack-api-client project:slack-api-client question M-T: User needs support to use the project

Comments

@kranti-rh
Copy link

I'm encountering intermittent failures when calling Slack API methods such as conversations.info, with the following exception:

java.net.SocketTimeoutException: timeout

I have a few questions regarding this issue:

  1. Has this issue been reported previously? If so, are there any known workarounds or fixes?
  2. Is this due to Slack API response times exceeding the configured timeout in the Slack Java SDK client?
  3. Can the HTTP timeout settings be adjusted for Slack API calls? If yes, what is the recommended way to configure or increase the timeout in the Slack Java SDK?

Would appreciate any insights or recommendations on handling this scenario.

Thanks!

Reproducible in:

[INFO] +- com.slack.api:bolt:jar:1.38.3:compile
[INFO] |  +- com.slack.api:slack-api-model:jar:1.38.3:compile
[INFO] |  +- com.slack.api:slack-app-backend:jar:1.38.3:compile
[INFO] +- com.slack.api:bolt-socket-mode:jar:1.38.3:compile
[INFO] +- com.slack.api:bolt-jakarta-servlet:jar:1.36.0:compile
[INFO] +- com.slack.api:slack-api-client:jar:1.36.0:compile
@zimeg zimeg added question M-T: User needs support to use the project project:slack-api-client project:slack-api-client and removed untriaged labels Feb 17, 2025
@zimeg
Copy link
Member

zimeg commented Feb 17, 2025

Hey @kranti-rh! 👋 Thanks for this question - it seems like network issues might be causing something strange to happen...

At the moment I'm not aware of similar reports being shared, so I'm wondering if you might be running this app behind a firewall or network proxy? This might be blocking the request to Slack API which causing the exceeded timeout you're finding 🤔

Before recommending increasing this timeout, I might suggest using the latest versions of bolt in case a recent change fixed a previous issue 🐛

Updating the timeout is still possible for these calls to the Slack API if that's not giving you luck:

SlackConfig config = new SlackConfig();
config.setHttpClientReadTimeoutMillis(1); // This should be increased!
Slack slack = Slack.getInstance(config);
ApiTestResponse response = slack.methods().apiTest(r -> r.foo("bar"));

I'm hoping this helps narrow down the cause of these failed requests, but please let me know if this continues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project:slack-api-client project:slack-api-client question M-T: User needs support to use the project
Projects
None yet
Development

No branches or pull requests

2 participants