{"record":{"id":"824667933633f28c","repo":"windmill-labs/windmill","slug":"no-local-instance-profile-named-instancename","errorCode":null,"errorMessage":"No local instance profile named ${instanceName}","messagePattern":"No local instance profile named (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/instance/slack.ts","lineNumber":13,"sourceCode":"import { colors } from \"@cliffy/ansi/colors\";\nimport * as log from \"../../core/log.ts\";\nimport { setClient } from \"../../core/client.ts\";\nimport * as wmill from \"../../../gen/services.gen.ts\";\nimport { getActiveInstance, allInstances, Instance } from \"./instance.ts\";\n\nasync 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;","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/instance/slack.ts#L1-L31","documentation":"resolveInstance in the Slack command looks up a local instance profile by the --instance name the user passed and throws this if no saved profile with that exact name exists. It only checks locally stored instances, not the remote server.","triggerScenarios":"Running 'wmill instance slack ... --instance <name>' where <name> doesn't match any profile added via 'wmill instance add' (typo, removed profile, or config on another machine/HOME).","commonSituations":"Typo in the instance name; instance was deleted with 'wmill instance delete'; running in CI where the profile was never added; different HOME directory hides the config.","solutions":["Run 'wmill instance list' (or 'wmill instance') to see saved profile names and fix the typo","Add the missing profile with 'wmill instance add'","Ensure you run as the same user/HOME where the profile exists, or re-add it in CI","Omit --instance so the active instance is used instead"],"exampleFix":"// before\nwmill instance slack sync --instance prood\n// after (fix name or add it)\nwmill instance add https://app.windmill.dev <token> --name prod\nwmill instance slack sync --instance prod","handlingStrategy":"validation","validationCode":"const profiles = await allInstances(); // or read local CLI config\nif (!profiles.some(i => i.name === instanceName)) {\n  console.warn(`Profile '${instanceName}' not added yet; run 'wmill instance add'`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await wmillInstanceSlack({ instance: name });\n} catch (e) {\n  if (String(e).startsWith(\"No local instance profile named\")) {\n    console.error(`Unknown profile '${name}'. Run: wmill instance list`);\n  }\n}","preventionTips":["List profiles with 'wmill instance list' and copy names exactly","Use consistent instance names across machines and CI scripts","Re-add profiles after deleting or when switching HOME/user","Prefer the default active instance over explicit names when scripting"],"tags":["cli","configuration","slack"],"backgroundTag":"missing-config-profile","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"}