{"record":{"id":"e23df21c6af22b4c","repo":"theonedev/onedev","slug":"specified-job-executor-jobexecutorname-i","errorCode":null,"errorMessage":"Specified job executor '\" + jobExecutorName + \"' is disabled","messagePattern":"Specified job executor '\" \\+ jobExecutorName \\+ \"' is disabled","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/job/DefaultJobService.java","lineNumber":523,"sourceCode":"\t\t\t\treturn executor.isApplicable(sourceContext) && executor.isApplicable(targetContext);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn executor.isApplicable(new JobMatchContext(\n\t\t\t\t\tbuild.getProject(), null, build.getCommitId(),\n\t\t\t\t\tbuild.getJobName()));\n\t\t}\n\t}\n\n\tprivate JobExecutor getJobExecutor(Build build, @Nullable String jobExecutorName, TaskLogger jobLogger) {\n\t\tif (jobExecutorName != null) {\n\t\t\tvar jobExecutor = settingService.getJobExecutors().stream()\n\t\t\t\t.filter(it -> it.getName().equals(jobExecutorName))\n\t\t\t\t.findFirst()\n\t\t\t\t.orElseThrow(() -> new ExplicitException(\"Unable to find specified job executor '\" + jobExecutorName + \"'\"));\n\t\t\tif (!jobExecutor.isEnabled())\n\t\t\t\tthrow new ExplicitException(\"Specified job executor '\" + jobExecutorName + \"' is disabled\");\n\t\t\telse if (!isApplicable(build, jobExecutor))\n\t\t\t\tthrow new ExplicitException(\"Specified job executor '\" + jobExecutorName + \"' is not applicable for current job\");\n\t\t\telse \n\t\t\t\treturn jobExecutor;\n\t\t} else {\n\t\t\tif (!settingService.getJobExecutors().isEmpty()) {\n\t\t\t\treturn settingService.getJobExecutors().stream()\n\t\t\t\t\t.filter(it -> it.isEnabled() && isApplicable(build, it))\n\t\t\t\t\t.findFirst()\n\t\t\t\t\t.orElseThrow(() -> new ExplicitException(\"No applicable job executor\"));\n\t\t\t} else {\n\t\t\t\tjobLogger.log(\"No job executor defined, auto-discovering...\");\n\t\t\t\tList<JobExecutorDiscoverer> discoverers = new ArrayList<>(OneDev.getExtensions(JobExecutorDiscoverer.class));\n\t\t\t\tdiscoverers.sort(Comparator.comparing(JobExecutorDiscoverer::getOrder));\n\t\t\t\tfor (var discoverer : discoverers) {\n\t\t\t\t\tJobExecutor jobExecutor = discoverer.discover();\n\t\t\t\t\tif (jobExecutor != null) {\n\t\t\t\t\t\tjobExecutor.setName(\"auto-discovered\");","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java#L505-L541","documentation":"Thrown by DefaultJobService.getJobExecutor when the build spec names a specific job executor (via jobExecutorName) that exists in the server settings but has its isEnabled flag set to false. OneDev refuses to run jobs on disabled executors even when they are explicitly named. It is an ExplicitException surfaced as the build's failure reason.","triggerScenarios":"A job spec sets 'executor: <name>' (jobExecutorName) where <name> matches a configured executor in Server Config > Job Executors whose Enabled checkbox is unchecked; then submitting or running the build triggers jobExecutor -> getJobExecutor.","commonSituations":"Admin disabled a Docker/Kubernetes executor during maintenance; spec written before the executor was disabled; executor temporarily disabled to stop runaway resource usage; specs copied from another instance where the executor is enabled.","solutions":["Re-enable the named executor in Server Setting > Job Executors.","Change the job's executor name in the build spec to an enabled executor.","Remove the explicit executor name so OneDev auto-discovers an applicable enabled executor.","If the executor was disabled intentionally, migrate the job to an alternative runner type."],"exampleFix":"// before (.onedev-buildspec.yml)\njobs:\n  - name: Build\n    executor:\n      name: My Disabled Docker Executor\n\n// after: either enable it in admin settings, or point to an enabled one\njobs:\n  - name: Build\n    executor:\n      name: Docker Executor","handlingStrategy":"validation","validationCode":"// Java, before submitting a job with explicit executor\nJobExecutorSetting exec = OneDev.getInstance(SettingService.class)\n        .getJobExecutors().stream()\n        .filter(it -> it.getName().equals(\"My Executor\"))\n        .findFirst().orElse(null);\nif (exec == null || !exec.isEnabled()) {\n    throw new IllegalStateException(\"Executor 'My Executor' missing or disabled\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    jobService.submit(build);\n} catch (ExplicitException e) {\n    if (e.getMessage().contains(\"is disabled\")) {\n        // fall back to auto-discovery by removing executor name from spec\n    }\n}","preventionTips":["Pin executor names in specs only after confirming they are enabled in server settings","Re-check specs after admin maintenance windows that disable executors","Prefer omitting the executor name and letting auto-discovery choose an enabled executor"],"tags":["job-executor","disabled","configuration","ci-pipeline"],"backgroundTag":"feature-not-enabled","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"}