{"record":{"id":"d287e32ccf31bfa0","repo":"windmill-labs/windmill","slug":"active-instance-activename-not-found-in-config","errorCode":null,"errorMessage":"Active instance ${activeName} not found in config","messagePattern":"Active instance (.+?) not found in config","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/instance/slack.ts","lineNumber":25,"sourceCode":"async function resolveInstance(\n  instanceName: string | undefined\n): Promise<Instance> {\n  if (instanceName) {\n    const match = (await allInstances()).find((i) => i.name === instanceName);\n    if (!match) {\n      throw new Error(`No local instance profile named ${instanceName}`);\n    }\n    return match;\n  }\n  const activeName = await getActiveInstance({});\n  if (!activeName) {\n    throw new Error(\n      \"No active instance. Run 'wmill instance add' or pass --instance.\"\n    );\n  }\n  const match = (await allInstances()).find((i) => i.name === activeName);\n  if (!match) {\n    throw new Error(`Active instance ${activeName} not found in config`);\n  }\n  return match;\n}\n\nexport async function connectSlackInstance(opts: {\n  instance?: string;\n  botToken: string;\n  teamId: string;\n  teamName: string;\n}) {\n  const instance = await resolveInstance(opts.instance);\n  setClient(\n    instance.token,\n    instance.remote.substring(0, instance.remote.length - 1)\n  );\n\n  await wmill.connectSlackInstance({\n    requestBody: {","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/instance/slack.ts#L7-L43","documentation":"resolveInstance read an active instance name from local settings but could not find a matching profile among saved instances — the active pointer is stale/dangling. It throws this naming the missing profile.","triggerScenarios":"The settings file still records active instance <name>, but 'wmill instance delete <name>' (or manual config editing) removed that profile while leaving it active.","commonSituations":"Deleting the active instance profile; syncing or partially overwriting the wmill settings file between machines; hand-editing the config and breaking the active-name/profile consistency.","solutions":["Run 'wmill instance add' (or select another instance) to reset the active pointer to an existing profile","Or pass --instance <existing-name> explicitly for this command","Inspect the wmill settings/config file and remove the stale active entry","Avoid deleting the currently active instance without re-selecting one"],"exampleFix":"// before: active points to deleted profile 'old'\nwmill instance delete old\nwmill instance slack sync  # throws\n// after\nwmill instance add https://app.windmill.dev <token> --name prod  # becomes active\nwmill instance slack sync","handlingStrategy":"validation","validationCode":"const active = await getActiveInstance({});\nconst profiles = await allInstances();\nif (active && !profiles.some(i => i.name === active)) {\n  console.warn(`Active instance '${active}' is stale; re-run 'wmill instance add'`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await wmillInstanceSlack({});\n} catch (e) {\n  if (String(e).includes(\"not found in config\")) {\n    console.error(\"Active instance was deleted; select a profile: wmill instance add\");\n  }\n}","preventionTips":["After 'wmill instance delete', immediately add/select a new active instance","Don't hand-edit the wmill settings file; use CLI commands to keep state consistent","Periodically verify active instance with 'wmill whoami'","Pass --instance explicitly to bypass the active pointer"],"tags":["cli","configuration","state"],"backgroundTag":"stale-config-reference","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}