{"record":{"id":"0ceec63e0fb36084","repo":"Tencent/WeKnora","slug":"channel-is-disabled","errorCode":null,"errorMessage":"channel is disabled","messagePattern":"channel is disabled","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/im/service.go","lineNumber":258,"sourceCode":"const (\n\tRedisKeyLeader     = \"im:ws:leader:\"    // + channelID — WebSocket leader election\n\tRedisKeyDedup      = \"im:dedup:\"        // + messageID — message deduplication\n\tRedisKeyStop       = \"im:stop:\"         // + userKey   — cross-instance /stop marker (pre-execution)\n\tRedisKeyInflight   = \"im:inflight:\"     // + userKey   — maps userKey → sessionID:messageID for cross-instance /stop\n\tRedisKeyQueueUser  = \"im:queue:user:\"   // + userKey   — global per-user queue counter\n\tRedisKeyRateLimit  = \"im:ratelimit:\"    // + key       — sliding-window rate limiting\n\tRedisKeyGlobalGate = \"im:global:active\" // global concurrent worker counter\n\t// RedisChannelConfig broadcasts durable im_channels mutations so every\n\t// application replica invalidates its local adapter/config snapshot.\n\tRedisChannelConfig = \"im:channel:config\"\n\n\tdefaultRateLimitWindow      = 60 * time.Second\n\tdefaultRateLimitMaxRequests = 10\n)\n\n// ErrChannelDisabled reports that a channel row exists but is disabled, so\n// callers can tell it apart from a missing channel or a transient failure.\nvar ErrChannelDisabled = errors.New(\"channel is disabled\")\n\n// channelState holds runtime state for a running IM channel.\ntype channelState struct {\n\tChannel      *IMChannel\n\tAdapter      Adapter\n\tCancel       context.CancelFunc // for stopping websocket goroutines\n\tleaderCancel context.CancelFunc // stops the leader renewal goroutine (nil if not leader)\n}\n\ntype leaderRetryState struct {\n\tcancel context.CancelFunc\n}\n\ntype channelConfigEvent struct {\n\tChannelID      string `json:\"channel_id\"`\n\tSourceInstance string `json:\"source_instance\"`\n}\n","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/im/service.go#L240-L276","documentation":"Sentinel ErrChannelDisabled returned by the IM service when a message/callback arrives for a channel whose fresh DB record has Enabled=false — the service stops the channel and refuses further processing. Feature-state guard; the handler responds 503 to the callback.","triggerScenarios":"Thrown at internal/im/service.go:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-enable the IM channel in its configuration before sending messages","Verify the channel ID — it may have been disabled administratively; no retry will succeed until re-enabled"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}