{"record":{"id":"02c21137ec4ed3c7","repo":"windmill-labs/windmill","slug":"warning-workspace-creation-cancelled-you-can","errorCode":null,"errorMessage":"⚠️  WARNING: Workspace creation cancelled. You can manually add a workspace to the 'workspaces' section in wmill.yaml or use 'wmill gitsync-settings pull' to pull configuration from an existing workspace.","messagePattern":"⚠️  WARNING: Workspace creation cancelled\\. You can manually add a workspace to the 'workspaces' section in wmill\\.yaml or use 'wmill gitsync-settings pull' to pull configuration from an existing workspace\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/core/conf.ts","lineNumber":510,"sourceCode":"            `   Example: \"file.variable.yaml\" → \"file.${sanitizedBranchName}.variable.yaml\"`\n          );\n        }\n\n        // Read current config, add workspace entry, and write it back\n        const currentConfig = await readConfigFile();\n\n        if (!currentConfig.workspaces) {\n          currentConfig.workspaces = {} as WorkspacesConfig;\n        }\n        (currentConfig.workspaces as any)[currentBranch] = {};\n\n        await writeFile(\"wmill.yaml\", yamlStringify(currentConfig), \"utf-8\");\n\n        log.info(\n          `✅ Created empty workspace configuration for '${currentBranch}'`\n        );\n      } else {\n        log.warn(\n          \"⚠️  WARNING: Workspace creation cancelled. You can manually add a workspace to the 'workspaces' section in wmill.yaml or use 'wmill gitsync-settings pull' to pull configuration from an existing windmill workspace git-sync configuration.\"\n        );\n        return;\n      }\n    } else {\n      // Warn about filesystem-unsafe characters in branch name\n      if (/[\\/\\\\:*?\"<>|.]/.test(currentBranch)) {\n        const sanitizedBranchName = currentBranch.replace(\n          /[\\/\\\\:*?\"<>|.]/g,\n          \"_\"\n        );\n        log.warn(\n          `⚠️  WARNING: Branch name \"${currentBranch}\" contains filesystem-unsafe characters (/ \\\\ : * ? \" < > | .).`\n        );\n        log.warn(\n          `   Branch-specific files will use sanitized name: \"${sanitizedBranchName}\"`\n        );\n      }","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/core/conf.ts#L492-L528","documentation":"Emitted by `validateBranchConfiguration` when, in an interactive session, the current branch matches no configured workspace and the user answers \"No\" to the `Confirm.prompt` asking to create an empty workspace configuration for the branch. The function returns without modifying `wmill.yaml`; subsequent push/pull behavior relies on the user fixing the config manually. It is a warning, not an abort of the whole CLI process at this point.","triggerScenarios":"Running `wmill push`/`pull` in a git repo (TTY attached, no `--yes`, no `--workspace`, no `--skip-branch-validation`), branch unmatched by `findWorkspaceByGitBranch`, and the user declines the \"Create empty workspace configuration for branch 'X'?\" prompt.","commonSituations":"Developers who don't want the CLI to auto-edit their checked-in `wmill.yaml` during CI-adjacent work, or who realize they are on the wrong branch and prefer to fix the mapping by hand.","solutions":["Manually add a `workspaces` entry for the current branch in `wmill.yaml`.","Run `wmill gitsync-settings pull` against an existing workspace to import its git-sync configuration.","Re-run the command and answer \"Yes\" to the prompt to let the CLI create the entry.","Switch to a branch that already has a workspace entry."],"exampleFix":"# before\nworkspaces:\n  main:\n    gitBranch: main\n\n# after (current branch: develop)\nworkspaces:\n  main:\n    gitBranch: main\n  develop:\n    gitBranch: develop","handlingStrategy":"validation","validationCode":"const branch = $(\"git branch --show-current\").trim();\nconst cfg = await Deno.readTextFile(\"wmill.yaml\");\nif (!cfg.includes(branch)) console.warn(`No workspace entry for branch \"${branch}\" — add one to wmill.yaml or accept the interactive prompt`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Accept the interactive prompt once so the entry lands in `wmill.yaml`, then commit it.","Use `wmill gitsync-settings pull` after setting up a workspace to import its mapping.","In non-interactive contexts never rely on the prompt — pre-add entries."],"tags":["cli","git","configuration","interactive"],"backgroundTag":"missing-workspace-mapping","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"}