{"record":{"id":"618a0875b9d95a13","repo":"theonedev/onedev","slug":"onedev-running-inside-kubernetes-cluster-does-not-618a08","errorCode":null,"errorMessage":"OneDev running inside kubernetes cluster does not support workspaces yet","messagePattern":"OneDev running inside kubernetes cluster does not support workspaces yet","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-plugin/server-plugin-provisioner-servershell/src/main/java/io/onedev/server/plugin/provisioner/servershell/ServerShellProvisioner.java","lineNumber":95,"sourceCode":"\n\tpublic void setConcurrency(Integer concurrency) {\n\t\tthis.concurrency = concurrency;\n\t}\n\n\t@Editable(order=100, name=\"tmux Executable\", placeholder=\"Use default\", description=\"\"\"\n\t\t\tOptionally specify <a href='https://github.com/tmux/tmux' target='_blank'>tmux</a> executable, \n\t\t\tfor instance <i>/usr/local/bin/tmux</i>. Leave empty to use tmux executable in PATH\"\"\")\n\tpublic String getTmuxExecutable() {\n\t\treturn tmuxExecutable;\n\t}\n\t\n\tpublic void setTmuxExecutable(String tmuxExecutable) {\n\t\tthis.tmuxExecutable = tmuxExecutable;\n\t}\n\n\tprivate void checkApplicable() {\n\t\tif (OneDev.getK8sService() != null) {\n\t\t\tthrow new ExplicitException(\"OneDev running inside kubernetes cluster does not support workspaces yet\");\n\t\t}\n\t}\n\n\t@Override\n\tpublic void test(None testData, TaskLogger logger) {\n\t\tcheckApplicable();\n\t\t\n\t\ttestCommands(logger);\n\t\ttestTmuxAvailability(newTmux(), logger);\n\t}\n\n\tpublic Commandline newTmux() {\n\t\tvar tmux = getTmuxExecutable();\n\t\tif (tmux == null) \n\t\t\ttmux = \"tmux\";\n\t\treturn new Commandline(tmux);\n\t}\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-provisioner-servershell/src/main/java/io/onedev/server/plugin/provisioner/servershell/ServerShellProvisioner.java#L77-L113","documentation":"ServerShellProvisioner.checkApplicable throws ExplicitException when OneDev is running inside a Kubernetes cluster. Server-shell workspaces (tmux sessions on the OneDev host) are unsupported in k8s deployments.","triggerScenarios":"Using the Server Shell provisioner (test() or provision()) on an OneDev instance where OneDev.getK8sService() is non-null.","commonSituations":"OneDev installed via k8s Helm chart, then configuring server shell workspaces; migrating on-prem configs to a k8s deployment without changing provisioner type.","solutions":["Run workspaces via k8s-compatible executors instead of server shell","Deploy OneDev outside kubernetes if server shell workspaces are required","Verify the deployment mode — if not truly k8s, check why k8sService is initialized"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"if (OneDev.getK8sService() != null) { throw new IllegalStateException('Server shell workspaces require OneDev outside kubernetes'); }","typeGuard":null,"tryCatchPattern":"try { provisioner.test(testData, logger); } catch (ExplicitException e) { if (e.getMessage().contains('kubernetes')) useK8sNativeExecutor(); else throw e; }","preventionTips":["Verify deployment mode before provisioning server shell workspaces","Use k8s-native execution when OneDev runs in kubernetes","Keep provisioner choice consistent with the platform OneDev runs on"],"tags":["kubernetes","provisioner","unsupported-platform"],"backgroundTag":"unsupported-platform","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}