{"record":{"id":"8c0de0c51b604a03","repo":"theonedev/onedev","slug":"specified-workspace-provisioner-provisioner-i-8c0de0","errorCode":null,"errorMessage":"Specified workspace provisioner '${provisioner}' is not applicable for current workspace","messagePattern":"Specified workspace provisioner '(.+?)' is not applicable for current workspace","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.java","lineNumber":744,"sourceCode":"\t\t\tif (provisioner != null) {\n\t\t\t\tprovisioner.setName(AUTO_DISCOVERED_PROVISIONER_NAME);\n\t\t\t\tif (isApplicable(workspace, spec, provisioner))\n\t\t\t\t\treturn provisioner;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate WorkspaceProvisioner getProvisioner(Workspace workspace, WorkspaceSpec spec, TaskLogger logger) {\n\t\tif (spec.getProvisioner() != null) {\n\t\t\tvar provisioner = settingService.getWorkspaceProvisioners().stream()\n\t\t\t\t.filter(it -> it.getName().equals(spec.getProvisioner()))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(() -> new ExplicitException(\"Unable to find specified workspace provisioner '\" + spec.getProvisioner() + \"'\"));\n\t\t\tif (!provisioner.isEnabled())\n\t\t\t\tthrow new ExplicitException(\"Specified workspace provisioner '\" + spec.getProvisioner() + \"' is disabled\");\n\t\t\telse if (!isApplicable(workspace, spec, provisioner))\n\t\t\t\tthrow new ExplicitException(\"Specified workspace provisioner '\" + spec.getProvisioner() + \"' is not applicable for current workspace\");\n\t\t\telse\n\t\t\t\treturn provisioner;\n\t\t} else if (!settingService.getWorkspaceProvisioners().isEmpty()) {\n\t\t\treturn settingService.getWorkspaceProvisioners().stream()\n\t\t\t\t.filter(it -> it.isEnabled() && isApplicable(workspace, spec, it))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(() -> new ExplicitException(\"No applicable workspace provisioner\"));\n\t\t} else {\n\t\t\tlogger.log(\"No workspace provisioner defined, auto-discovering...\");\n\t\t\tvar provisioner = discoverProvisioner(workspace, spec);\n\t\t\tif (provisioner != null) {\n\t\t\t\tlogger.log(\"Discovered \" + EditableUtils.getDisplayName(provisioner.getClass()).toLowerCase());\n\t\t\t\treturn provisioner;\n\t\t\t}\n\n\t\t\tif (spec.isRunInContainer()) {\n\t\t\t\tthrow new ExplicitException(\"\"\"\n\t\t\t\t\tNo applicable provisioner discovered for current workspace. \\","sourceCodeStart":726,"sourceCodeEnd":762,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/workspace/DefaultWorkspaceService.java#L726-L762","documentation":"DefaultWorkspaceService verifies that an explicitly named provisioner is applicable to the current workspace (isApplicable checks e.g. platform/arch/OS compatibility of existing workspace data). A provisioner that exists and is enabled but not applicable to this workspace throws this error.","triggerScenarios":"Workspace spec names provisioner P, P is enabled, but isApplicable(workspace, spec, P) returns false — e.g. the workspace was created on a different OS/architecture than P supports, or the spec's requirements don't match P.","commonSituations":"Switching a workspace from shell-provisioned (server host OS) to kubernetes/docker (container) or vice versa; moving jobs between agents with different platforms while reusing the workspace; provisioner OS/arch constraints vs cached workspace image.","solutions":["Delete the old workspace cache so a fresh workspace matching the new provisioner is created.","Choose a provisioner applicable to the workspace's current platform.","Align the spec's runInContainer/platform requirements with the named provisioner."],"exampleFix":"// before\nprovisioner: kubernetes-pool  # workspace previously shell-provisioned on Linux host\n// after\n# clear workspace cache first, then:\nprovisioner: kubernetes-pool","handlingStrategy":"fallback","validationCode":"// verify workspace platform (OS/arch) is supported by the target provisioner before assigning","typeGuard":null,"tryCatchPattern":"try { provision(...); } catch (ExplicitException e) { if (e.getMessage().contains(\"not applicable\")) { clearWorkspaceCache(); retry(); } }","preventionTips":["Clear workspace caches when changing provisioner or platform.","Match provisioner OS/arch constraints to job requirements.","Test provisioning on a scratch project after changing provisioners."],"tags":["provisioner","compatibility","workspace"],"backgroundTag":"invalid-state-transition","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"}