{"record":{"id":"0980770769c36761","repo":"jackwener/OpenCLI","slug":"e-message-archived-channels-are-excluded-from","errorCode":null,"errorMessage":"${e.message}. Archived channels are excluded from the name lookup; pass the channelId UUID instead (find it in the archived channel's URL in the Slock app).","messagePattern":"(.+?)\\. Archived channels are excluded from the name lookup; pass the channelId UUID instead \\(find it in the archived channel's URL in the Slock app\\)\\.","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"warning","filePath":"clis/slock/channel-action.js","lineNumber":48,"sourceCode":"      if (!channel) throw new ArgumentError('channel required');\n      await page.goto(SLOCK_HOME_URL);\n      const snippet = buildChannelScopedSnippet({\n        channelInput: channel,\n        method: 'POST',\n        pathSuffix: `/${verb}`,\n        serverIdOverride: kwargs.server,\n      });\n      const result = await page.evaluate(`(async () => { ${snippet} })()`);\n      let data;\n      try {\n        data = dispatchEvaluateResult(result);\n      } catch (e) {\n        // F7 — channelResolveFragment lists active channels only; archived\n        // channels are absent from the lookup, so `#name` resolve fails for\n        // a channel you're trying to unarchive. UUID still works. Rewrite\n        // the bare \"no channel matches\" message into something actionable.\n        if (archivedHint && e instanceof ArgumentError && /no channel matches/.test(e.message)) {\n          throw new ArgumentError(\n            `${e.message}. Archived channels are excluded from the name lookup; ` +\n            `pass the channelId UUID instead (find it in the archived channel's URL in the Slock app).`\n          );\n        }\n        throw e;\n      }\n      return [{\n        channel,\n        id: data?.id ?? '',\n        archivedAt: data?.archivedAt ?? null,\n        result: resultLabel,\n      }];\n    },\n  });\n}\n","sourceCodeStart":30,"sourceCodeEnd":64,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/slock/channel-action.js#L30-L64","documentation":"This ArgumentError is thrown by `makeChannelActionCommand` in clis/slock/channel-action.js when a channel action (e.g. unarchive) fails channel resolution because the underlying GraphQL lookup (`channelResolveFragment`) only lists ACTIVE channels. The CLI catches the generic 'no channel matches' failure and rewrites it with an actionable hint: archived channels cannot be found by `#name`, only by their channelId UUID.","triggerScenarios":"Running a channel action command with `archivedHint` enabled (e.g. `slock channel unarchive --channel '#my-channel'`) where the target channel is archived. The name-based lookup excludes archived channels, so resolve fails with 'no channel matches' and is rewritten to this message.","commonSituations":"A developer archived a channel in the Slock app and later wants to restore it via the CLI. They naturally reference it by `#name`, forgetting the lookup only covers active channels. Also occurs after automation scripts stored channel names rather than UUIDs.","solutions":["Get the channelId UUID from the archived channel's URL in the Slock app (the value in the path after /channel/) and pass that instead of `#name`","Run a channel action with the UUID: `slock channel unarchive --channel <uuid>`","After unarchiving succeeds, the channel becomes active again and `#name` lookup will work for future commands"],"exampleFix":"// before\n$ slock channel unarchive --channel '#ops-alerts'\nError: no channel matches ... Archived channels are excluded from the name lookup; pass the channelId UUID instead...\n// after\n$ slock channel unarchive --channel '3f9a2b1c-8d4e-4f7a-9b2c-1e5d6a7b8c9d'","handlingStrategy":"try-catch","validationCode":"const uuidRe = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nif (channel.startsWith('#')) {\n  console.warn('#name lookup only works for active channels; for archived channels pass the channelId UUID from the Slock app URL');\n} else if (!uuidRe.test(channel)) {\n  console.warn('channel does not look like a UUID; extract it from the channel URL in the Slock app');\n}","typeGuard":"const isUuid = (v) => typeof v === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(v.trim());","tryCatchPattern":"try {\n  await slock.channelAction({ channel: '#ops', action: 'unarchive' });\n} catch (e) {\n  if (e instanceof ArgumentError && /Archived channels are excluded/.test(e.message)) {\n    // fall back to the UUID stored in your channel registry / channel URL\n    await slock.channelAction({ channel: ARCHIVED_CHANNEL_UUID, action: 'unarchive' });\n  } else throw e;\n}","preventionTips":["Store channelId UUIDs (not #names) in scripts/config for channels that may be archived","Extract the UUID from the channel's URL in the Slock app before acting on archived channels","Treat #name resolution as best-effort for active channels only"],"tags":["argument-error","cli","channel-resolution","archived-channel"],"backgroundTag":"named-resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}