apache/seatunnel · error · SlackConnectorException

FIND_SLACK_CONVERSATION_FAILED

FIND_SLACK_CONVERSATION_FAILED

Error message

Find Slack Conversion Fail.

What it means

SlackClient.findConversation resolves a channel name to a conversation ID via Slack's conversations.list API. If listing channels throws IOException or SlackApiException, the client logs a warning and throws SlackConnectorException with code FIND_SLACK_CONVERSATION_FAILED. This means the channel could not be resolved — not necessarily that it doesn't exist.

Solutions

  1. Verify the Slack token is valid and has the required scopes (channels:read, groups:read for private channels).
  2. Check the logged warning for the SlackApiException error code to see the exact API error (e.g. invalid_auth, ratelimited).
  3. Use the channel ID directly instead of a channel name to skip lookup entirely.
  4. Invite the bot to the target channel (/invite @bot) if it is private, so it appears in listings.
  5. If rate-limited, add retry/backoff or reduce lookup frequency.

Example fix

// before: lookup by name can fail
conversationId = slackClient.findConversation("#my-channel");
// after: use the stable channel ID
conversationId = "C0123456789"; // from Slack channel details
Defensive patterns

Strategy: try-catch

Validate before calling

// before lookup: check token/scopes via auth.test
callSlackApi("auth.test", Map.of()); // fails fast on invalid token

Try / catch

try {
    String id = slackClient.findConversation(name);
} catch (SlackConnectorException e) {
    if (e.getCause() instanceof SlackApiException sae && "ratelimited".equals(sae.getError())) {
        // back off and retry
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: findConversation(channelName) is called and the Slack Web API call fails: network error (IOException) or Slack API error response (SlackApiException) such as invalid auth token, missing scope (channels:read), or rate limiting while paging through conversations.

Common situations: Invalid or expired Slack bot token; bot not invited to a private channel so the channel never appears in listings; missing OAuth scopes; Slack rate limits (429) during repeated lookups; network/firewall blocking api.slack.com.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/83854014819f4433. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-slack/src/main/java/org/apache/seatunnel/connectors/seatunnel/slack/client/SlackClient.java:72

        try {
            // Get Conversion List
            ConversationsListResponse conversationsListResponse =
                    methodsClient.conversationsList(
                            r ->
                                    r
                                            // The Token used to initialize app
                                            .token(pluginConfig.get(OAUTH_TOKEN)));
            channels = conversationsListResponse.getChannels();
            for (Conversation channel : channels) {
                if (channel.getName().equals(pluginConfig.get(SLACK_CHANNEL))) {
                    conversionId = channel.getId();
                    // Break from for loop
                    break;
                }
            }
        } catch (IOException | SlackApiException e) {
            log.warn("Find Slack Conversion Fail.", e);
            throw new SlackConnectorException(
                    SlackConnectorErrorCode.FIND_SLACK_CONVERSATION_FAILED, e);
        }
        return conversionId;
    }

    /** Post a message to a channel using Channel ID and message text */
    public boolean publishMessage(String channelId, String text) {
        boolean publishMessageSuccess = false;
        try {
            ChatPostMessageResponse chatPostMessageResponse =
                    methodsClient.chatPostMessage(
                            createMessageRequest(pluginConfig.get(OAUTH_TOKEN), channelId, text));
            publishMessageSuccess = chatPostMessageResponse.isOk();
        } catch (IOException | SlackApiException e) {
            log.error("error: {}", ExceptionUtils.getMessage(e));
        }
        return publishMessageSuccess;
    }

View on GitHub (pinned to cf67b549a7)