{"record":{"id":"6d105d0b14ac68dc","repo":"windmill-labs/windmill","slug":"workspace-folder-not-found-are-you-in-the-right-d","errorCode":null,"errorMessage":"Workspace folder not found, are you in the right directory?","messagePattern":"Workspace folder not found, are you in the right directory\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/instance/instance.ts","lineNumber":522,"sourceCode":"    const previousActiveWorkspace = await getActiveWorkspace(undefined);\n\n    const localWorkspaces = await getLocalWorkspaces(\n      rootDir,\n      localPrefix,\n      opts.folderPerInstance,\n    );\n\n    log.info(\n      `\\nPushing all workspaces: ${\n        localWorkspaces.map((x) => x.id).join(\", \")\n      }`,\n    );\n    for (const localWorkspace of localWorkspaces) {\n      log.info(\"\\nPushing workspace \" + localWorkspace.id);\n      try {\n        process.chdir(path.join(rootDir, localWorkspace.dir));\n      } catch (_) {\n        throw new Error(\n          \"Workspace folder not found, are you in the right directory?\",\n        );\n      }\n\n      try {\n        const workspaceSettings = (await yamlParseFile(\n          path.join(process.cwd(), \"settings.yaml\"),\n        )) as SimplifiedSettings;\n        await workspaceSetup(\n          {\n            token: instance.token,\n            workspace: undefined,\n            baseUrl: undefined,\n            configDir: undefined,\n            create: true,\n            createWorkspaceName: workspaceSettings.name,\n            createUsername: undefined,\n          },","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/instance/instance.ts#L504-L540","documentation":"During 'wmill instance push', the CLI changes directory into each local workspace folder relative to the repo root before reading its settings. If the chdir fails — the folder recorded in wmill.yaml doesn't exist on disk — it throws this error asking whether you're in the right directory.","triggerScenarios":"Running 'wmill instance push' from a directory other than the repo root when wmill.yaml lists workspace dirs, or after workspace folders were renamed/deleted/moved locally while wmill.yaml still references the old paths.","commonSituations":"Running the push from a subdirectory or a CI checkout that excludes some folders; branch where a workspace folder was removed but wmill.yaml wasn't updated; case-sensitivity mismatch on filesystems.","solutions":["Run the command from the repository root (where wmill.yaml lives)","Compare wmill.yaml workspace entries against actual folders on disk; fix or remove stale entries","Restore or re-clone missing workspace folders","Use targeted push (single workspace) to skip the broken folder, then repair wmill.yaml"],"exampleFix":"// before (from wrong dir)\ncd myrepo/frontend && wmill instance push\n// after\ncd myrepo && wmill instance push  # root containing wmill.yaml and workspace folders","handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\nimport YAML from \"yaml\";\nconst cfg = YAML.parse(await Deno.readTextFile(\"wmill.yaml\"));\nfor (const ws of cfg.workspaces ?? []) {\n  if (!existsSync(ws.folder_path)) {\n    throw new Error(`wmill.yaml references missing folder: ${ws.folder_path}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await wmillInstancePush();\n} catch (e) {\n  if (String(e).includes(\"Workspace folder not found\")) {\n    console.error(\"Run from the repo root containing wmill.yaml and all workspace folders\");\n  }\n}","preventionTips":["Always run 'wmill instance push' from the directory containing wmill.yaml","Keep wmill.yaml workspace entries in sync with actual folders (update on rename/delete)","Don't shallow-clone or filter out workspace folders in CI","Check with a quick ls of each workspace dir before pushing"],"tags":["cli","filesystem","sync"],"backgroundTag":"working-directory-mismatch","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"}