Slack API · error code

Slack error duplicate_channel_not_found: client_msg_id points at an invalid channel

Permanent - do not retryHTTP 200Message content & Block Kit

Last verified against Slack API reference - chat.postMessage errors

What Slack returns
Channel associated with client_msg_id was invalid.

What error duplicate_channel_not_found means

This error belongs to Slack's idempotent-send machinery. chat.postMessage accepts a client_msg_id — a unique ID you attach so a retried request can be recognized as the same logical message instead of posting twice. duplicate_channel_not_found is documented as "Channel associated with client_msg_id was invalid": Slack matched your client_msg_id to a previous send attempt, but the channel recorded for that attempt does not line up with a resolvable channel for this one.

In practice it means your retry is inconsistent with the original: the same client_msg_id was reused with a different or now-invalid channel. That happens when IDs are generated from insufficiently unique inputs (a hash of the text, a non-unique job ID) so two genuinely different messages collide, or when a retry pipeline rewrites the destination between attempts while carrying the old ID forward.

Treat the client_msg_id as bound to one (channel, message) pair forever. If the destination legitimately changed, mint a new ID; if the collision was accidental, fix the generator to produce true uniqueness (UUIDs) per logical message.

What it looks like

{"ok": false, "error": "duplicate_channel_not_found"}

Why it happens

  • A client_msg_id was reused across different messages or destinations (weak ID generation).
  • A retry changed the channel while keeping the original client_msg_id.
  • The channel from the original attempt is no longer resolvable for this token.

How to fix Slack error duplicate_channel_not_found

  1. 1Generate client_msg_id as a UUID per logical message, stored with its destination channel.
  2. 2On retries, resend the identical (channel, client_msg_id, payload) triple; never mutate the destination mid-retry.
  3. 3If the destination must change, create a new client_msg_id for the new send.
  4. 4Verify the channel itself still resolves (conversations.info) — see channel_not_found for that branch.

How to stop it recurring

Make idempotency keys immutable properties of the message record, created once when the message is enqueued and never derived from mutable fields — hashing the text or reusing a job ID across destinations is how collisions are born. Log the client_msg_id with every send alongside the destination channel so collisions and mismatches are visible in one grep, and cover the retry path with a test that replays the same logical message twice.

Official reference: Slack API reference - chat.postMessage errors. See all Slack error codes or the Slack limits and quotas.

Related codes

Error duplicate_channel_not_found - quick answers

What does Slack error duplicate_channel_not_found mean?

This error belongs to Slack's idempotent-send machinery. chat.postMessage accepts a client_msg_id — a unique ID you attach so a retried request can be recognized as the same logical message instead of posting twice.

How do I fix Slack error duplicate_channel_not_found?

1. Generate client_msg_id as a UUID per logical message, stored with its destination channel. 2. On retries, resend the identical (channel, client_msg_id, payload) triple; never mutate the destination mid-retry. 3. If the destination must change, create a new client_msg_id for the new send. 4. Verify the channel itself still resolves (conversations.info) — see channel_not_found for that branch.

Should I retry after error duplicate_channel_not_found?

No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.

Stop debugging Slack by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.