{"record":{"id":"f081d6a6d5947b94","repo":"mastra-ai/mastra","slug":"channel-platform-is-not-registered-available","errorCode":null,"errorMessage":"Channel \"${platform}\" is not registered. Available: ${available || 'none'}","messagePattern":"Channel \"(.+?)\" is not registered\\. Available: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"packages/server/src/server/handlers/channels.ts","lineNumber":37,"sourceCode":"import { assertWriteAccess, getCallerAuthorId, hasAdminBypass, hasScopedPermission } from './authorship';\nimport { handleError } from './error';\n\n// ============================================================================\n// Feature gate + helpers\n// ============================================================================\n\nfunction assertChannelsAvailable(): void {\n  if (!coreFeatures.has('channels')) {\n    throw new HTTPException(501, { message: 'Channels require a newer version of @mastra/core' });\n  }\n}\n\nfunction getChannelOrThrow(mastra: Mastra, platform: string): ChannelProvider {\n  const channels = Object.values(mastra.channels ?? {});\n  const channel = channels.find(c => c.id === platform);\n  if (!channel) {\n    const available = channels.map(c => c.id).join(', ');\n    throw new HTTPException(404, {\n      message: `Channel \"${platform}\" is not registered. Available: ${available || 'none'}`,\n    });\n  }\n  return channel;\n}\n\n/**\n * Unified connect/disconnect authorization.\n *\n * - Stored agent exists → same write access as editing the agent record.\n * - Code-defined agent (no stored record) → route's `requiresAuth` is the gate.\n * - Agent doesn't exist anywhere:\n *   - connect → 404 (can't connect a channel to a non-existent agent)\n *   - disconnect → orphan cleanup, gated on `channels:write`\n */\nasync function assertChannelAgentWriteAccess(\n  mastra: Mastra,\n  requestContext: RequestContext,","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/channels.ts#L19-L55","documentation":"getChannelOrThrow looks up a ChannelProvider by ID in mastra.channels and throws a 404 HTTPException when no registered channel matches the requested platform. The message lists all registered channel IDs (or 'none') so callers can see what is available. The instance itself supports channels (the feature gate passed) but this particular platform is not registered.","triggerScenarios":"Calling channel routes (e.g. connect/disconnect, platform-scoped listings) with a platform path parameter that is not an ID in mastra.channels on the current instance.","commonSituations":"Typo in the platform slug (e.g. 'slack' vs 'Slack' vs 'whatsapp'); channel plugin not added to the Mastra constructor; channel registered on a different environment/instance than the one being queried; channel registration failed silently at startup.","solutions":["Use one of the IDs listed in the error's 'Available:' list instead of the requested platform.","Register the channel provider on the Mastra instance (add it to the channels config in new Mastra({...})).","Check exact ID casing — the lookup is a strict equality match on channel.id.","Confirm you are querying the same deployment where the channel is registered."],"exampleFix":"// before\nnew Mastra({ agents, /* channels missing */ });\n\n// after\nimport { SlackChannel } from './channels/slack';\nnew Mastra({ agents, channels: { slack: new SlackChannel({ token: process.env.SLACK_TOKEN }) } });","handlingStrategy":"validation","validationCode":"const platforms = await listChannelPlatforms();\nif (!platforms.includes(platform)) {\n  throw new Error(`Channel \"${platform}\" not registered. Available: ${platforms.join(', ')}`);\n}","typeGuard":"function isRegisteredChannel(channels: { id: string }[], platform: string): boolean {\n  return channels.some(c => c.id === platform);\n}","tryCatchPattern":"try {\n  await connectChannel(platform, agentId);\n} catch (e) {\n  if (e.status === 404 && e.message.includes('is not registered')) {\n    // parse 'Available:' from message or re-list platforms and prompt user\n  } else throw e;\n}","preventionTips":["Populate channel pickers from the platforms list endpoint, not free text.","Register every channel provider you reference in the Mastra constructor.","Match channel IDs exactly (case-sensitive).","Verify channel registration with a startup log/health check per environment."],"tags":["http-404","channels","configuration"],"backgroundTag":"resource-not-found-404","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}