{"record":{"id":"38ba3fe6591339c9","repo":"theonedev/onedev","slug":"specified-job-executor-jobexecutorname-i-38ba3f","errorCode":null,"errorMessage":"Specified job executor '\" + jobExecutorName + \"' is not applicable for current job","messagePattern":"Specified job executor '\" \\+ jobExecutorName \\+ \"' is not applicable for current job","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/job/DefaultJobService.java","lineNumber":525,"sourceCode":"\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\");\n\t\t\t\t\t\tif (isApplicable(build, jobExecutor)) {\n\t\t\t\t\t\t\tjobLogger.log(\"Discovered \" + EditableUtils.getDisplayName(jobExecutor.getClass()).toLowerCase());","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java#L507-L543","documentation":"Thrown by DefaultJobService.getJobExecutor when the job spec names an enabled executor whose isApplicable(build, jobExecutor) check fails — i.e., the executor's criteria (project, job name, branch/tag, ref filters, runner capability) do not match the current build. The executor exists and is enabled, but it cannot run this particular job.","triggerScenarios":"Specifying 'executor: <name>' where that executor defines applicability criteria (e.g., restricted to certain projects, branches, job names, or requires a registered runner) that the current build/job does not satisfy; then jobExecutor -> getJobExecutor throws.","commonSituations":"Executor narrowed to main branch while job runs on a feature branch; executor scoped to specific projects; spec copied from another project; executor requires a docker image field the job doesn't set; runners unregistered so capacity criteria fail.","solutions":["Broaden the executor's criteria in Server Setting > Job Executors (project/branch/job filters) to include this job.","Change the job spec to name an executor whose criteria match this build.","Remove the explicit executor name to let auto-discovery pick any applicable enabled executor.","Register the required runner/agent so the executor's capacity requirements are satisfied."],"exampleFix":"// before: executor scoped to main branch only, job on feature branch\n// after (build spec): omit executor name for auto-discovery\njobs:\n  - name: Build\n    steps: !<CommandLine>\n      shellScript: mvn package","handlingStrategy":"validation","validationCode":"// Confirm the named executor's criteria include this project/branch/job\n// before referencing it in .onedev-buildspec.yml:\n// Admin > Job Executors > <name> : check project/branch/job criteria\n// and required capabilities for the job being submitted","typeGuard":null,"tryCatchPattern":"try {\n    jobService.submit(build);\n} catch (ExplicitException e) {\n    if (e.getMessage().contains(\"is not applicable\")) {\n        // broaden executor criteria or drop the explicit executor name\n    }\n}","preventionTips":["Match executor criteria (project, branch, job name filters) against every branch the spec runs on","Avoid copying executor names from other projects without checking their criteria","Register runners so capability-based applicability passes"],"tags":["job-executor","applicability","configuration","ci-pipeline"],"backgroundTag":"invalid-config-value","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"}