{"record":{"id":"ee786775a628cd9a","repo":"theonedev/onedev","slug":"no-applicable-executor-discovered-for-current-job","errorCode":null,"errorMessage":"No applicable executor discovered for current job","messagePattern":"No applicable executor discovered for current job","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/job/DefaultJobService.java","lineNumber":548,"sourceCode":"\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());\n\t\t\t\t\t\t\treturn jobExecutor;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow new ExplicitException(\"No applicable executor discovered for current job\");\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate Future<Boolean> execute(Build build) {\t\t\n\t\tString jobToken = build.getToken();\n\t\tJobVariableInterpolator interpolator = new JobVariableInterpolator(build, build.getParamCombination());\n\n\t\tTaskLogger jobLogger = logService.newLogger(build.getLoggingSupport());\n\t\tString jobExecutorName = interpolator.interpolate(build.getJob().getJobExecutor());\n\t\tJobExecutor jobExecutor = interpolator.interpolateProperties(getJobExecutor(build, jobExecutorName, jobLogger));\n\t\tString sequentialGroup = interpolator.interpolate(build.getJob().getSequentialGroup());\n\t\tString sequentialKey;\n\t\tif (sequentialGroup != null)\n\t\t\tsequentialKey = jobExecutorName + \":\" + sequentialGroup;\n\t\telse\n\t\t\tsequentialKey = null;\n\t\tLong projectId = build.getProject().getId();","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/job/DefaultJobService.java#L530-L566","documentation":"Thrown by DefaultJobService.getJobExecutor when no explicit executor is named and none of the globally configured, enabled job executors pass isApplicable for the current build. OneDev iterates all executors in order, logs 'Discovered ...' for the first match, and throws this ExplicitException only after exhausting the list.","triggerScenarios":"Submitting a job when settingService.getJobExecutors() is non-empty but every executor is either disabled or not applicable (wrong project/branch/job criteria, no registered runners), or the executor list is empty of usable entries for the job.","commonSituations":"Fresh OneDev instance with default executors only and the job requires Docker/K8s; all runners offline; executors all scoped to other projects/branches; admin disabled executors during maintenance while CI jobs keep being submitted.","solutions":["Enable at least one job executor in Server Setting > Job Executors and ensure its criteria match this job.","Register/bring online the required runners (docker host, k8s cluster, remote agent).","Broaden executor criteria so they apply to this project/branch/job.","Name a specific executor in the build spec if auto-discovery ordering is the problem."],"exampleFix":"// Admin: Server Setting > Job Executors > Add Executor\n// e.g. add a Docker Executor with project criteria '*' and enable it,\n// then verify a runner is registered:\n// Admin > Runners/Agents > Add Runner, use the token in your docker agent container","handlingStrategy":"validation","validationCode":"// Java: verify at least one enabled executor applies before queueing jobs\nboolean anyApplicable = OneDev.getInstance(SettingService.class)\n        .getJobExecutors().stream()\n        .anyMatch(it -> it.isEnabled());\nif (!anyApplicable) {\n    throw new IllegalStateException(\"No enabled job executors configured\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    jobService.submit(build);\n} catch (ExplicitException e) {\n    if (e.getMessage().contains(\"No applicable executor\")) {\n        // alert admins to enable/register executors; retry after config fix\n    }\n}","preventionTips":["Keep at least one catch-all enabled executor with broad criteria","Monitor runner/agent connectivity so capacity-backed executors stay applicable","After instance migration, verify executor configuration before enabling CI"],"tags":["job-executor","configuration","runner","ci-pipeline"],"backgroundTag":"empty-result-set","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"}