windmill-labs/windmill · error · Error
Active instance ${activeName} not found in config
Error message
Active instance ${activeName} not found in config What it means
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.
Source
Thrown at cli/src/commands/instance/slack.ts:25
async function resolveInstance(
instanceName: string | undefined
): Promise<Instance> {
if (instanceName) {
const match = (await allInstances()).find((i) => i.name === instanceName);
if (!match) {
throw new Error(`No local instance profile named ${instanceName}`);
}
return match;
}
const activeName = await getActiveInstance({});
if (!activeName) {
throw new Error(
"No active instance. Run 'wmill instance add' or pass --instance."
);
}
const match = (await allInstances()).find((i) => i.name === activeName);
if (!match) {
throw new Error(`Active instance ${activeName} not found in config`);
}
return match;
}
export async function connectSlackInstance(opts: {
instance?: string;
botToken: string;
teamId: string;
teamName: string;
}) {
const instance = await resolveInstance(opts.instance);
setClient(
instance.token,
instance.remote.substring(0, instance.remote.length - 1)
);
await wmill.connectSlackInstance({
requestBody: {View on GitHub (pinned to e474e8803c)
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
Example fix
// before: active points to deleted profile 'old' wmill instance delete old wmill instance slack sync # throws // after wmill instance add https://app.windmill.dev <token> --name prod # becomes active wmill instance slack sync
Defensive patterns
Strategy: validation
Validate before calling
const active = await getActiveInstance({});
const profiles = await allInstances();
if (active && !profiles.some(i => i.name === active)) {
console.warn(`Active instance '${active}' is stale; re-run 'wmill instance add'`);
} Try / catch
try {
await wmillInstanceSlack({});
} catch (e) {
if (String(e).includes("not found in config")) {
console.error("Active instance was deleted; select a profile: wmill instance add");
}
} Prevention
- 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
When it happens
Trigger: The settings file still records active instance <name>, but 'wmill instance delete <name>' (or manual config editing) removed that profile while leaving it active.
Common situations: 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.
Related errors
- No instance found, please add one first
- No local instance profile named ${instanceName}
- No active instance. Run 'wmill instance add' or pass --insta
- No local file for ${scriptPath} to infer its S3Object parame
- No base branches are configured in wmill.yaml's workspaces s
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/d287e32ccf31bfa0.
Report an issue: GitHub.