{"record":{"id":"06da984c9dce6f16","repo":"quarkusio/quarkus","slug":"unable-to-find-command-s-in-path-s","errorCode":null,"errorMessage":"Unable to find command: %s in $PATH: %s","messagePattern":"Unable to find command: (.+?) in \\$PATH: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/ContainerRuntimeUtil.java","lineNumber":156,"sourceCode":"                case PODMAN_ROOTLESS:\n                    if (PODMAN_PATTERN.matcher(versionOutput).matches()) {\n                        return ContainerRuntime.PODMAN;\n                    }\n                    break;\n            }\n        }\n\n        return ContainerRuntime.UNAVAILABLE;\n    }\n\n    private static ContainerRuntime fullyResolveContainerRuntime(ContainerRuntime containerRuntimeEnvironment,\n            boolean silent) {\n        String execName = containerRuntimeEnvironment.getExecutableName();\n        try {\n            Optional<Path> execPath = ProcessUtil.pathOfCommand(Path.of(execName));\n            if (execPath.isEmpty()) {\n                // this should never happen as we have detected the presence of the Docker/Podman CLI before\n                throw new IllegalStateException(\n                        String.format(\"Unable to find command: %s in $PATH: %s\", execName, ProcessUtil.searchPath()));\n            }\n\n            return ProcessBuilder.newBuilder(execPath.get())\n                    .arguments(\"info\")\n                    .output().gatherOnFail(true).processWith(br -> {\n                        boolean rootless = false;\n                        boolean isInWindowsWSL = false;\n                        boolean isDocker = containerRuntimeEnvironment.isDocker();\n                        String line;\n                        while ((line = br.readLine()) != null) {\n                            if (isDocker) {\n                                if (line.trim().equals(\"rootless\") || line.contains(\"Docker Desktop\")\n                                        || line.contains(\"desktop-linux\")) {\n                                    rootless = true;\n                                }\n                            } else {\n                                if (line.trim().equals(\"rootless: true\")) {","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/ContainerRuntimeUtil.java#L138-L174","documentation":"After a container runtime CLI is detected, ContainerRuntimeUtil.fullyResolveContainerRuntime resolves its full identity (rootless/WSL variants) by locating the executable with ProcessUtil.pathOfCommand. If the executable name exists during version probing but cannot be resolved to a Path, it throws IllegalStateException(\"Unable to find command: %s in $PATH: %s\"). The code comments this 'should never happen', so it usually indicates PATH changed mid-build or detection ran with a non-PATH-resolvable executable.","triggerScenarios":"docker/podman passed detection (version probe succeeded) but ProcessUtil.pathOfCommand(Path.of(\"docker\")) returns empty — e.g. the 'executable' matched via CONTAINER_EXECUTABLE config is an alias/function not a real file, PATH was mutated between checks, or a wrapper script named differently is resolved inconsistently.","commonSituations":"quarkus.native.container-runtime set to a custom wrapper name; PATH differs between the Maven process and shell (IDE-launched builds); Docker Desktop's docker CLI installed in a user-specific path not in the Maven process's PATH.","solutions":["Check the $PATH printed in the message and ensure the docker/podman binary's directory is in it for the process running the build","Verify the executable is a real on-disk binary, not a shell alias/function: which docker / command -v docker","Align PATH between your IDE/CI launcher and shell (launch Maven from a login shell or set PATH in CI config)","Set -Dquarkus.native.container-runtime=docker|podman to force a known-good runtime name"],"exampleFix":"// before: alias set in ~/.bashrc, not visible to Maven\nalias docker=podman\n// after: ensure a real binary on PATH (e.g. symlink)\nsudo ln -s $(command -v podman) /usr/local/bin/docker","handlingStrategy":"validation","validationCode":"static boolean resolvableOnPath(String exec) {\n    return ProcessUtil.pathOfCommand(java.nio.file.Path.of(exec)).isPresent();\n}\n// call before build: require resolvableOnPath(\"docker\") || resolvableOnPath(\"podman\")\n","typeGuard":null,"tryCatchPattern":"try {\n    ContainerRuntime rt = ContainerRuntimeUtil.detectContainerRuntime();\n} catch (IllegalStateException e) {\n    // message contains the $PATH actually used — fix PATH for this process and retry\n}\n","preventionTips":["Ensure the Maven/Gradle process inherits the same PATH as your shell (IDE launch configs, CI env blocks)","Don't rely on shell aliases/functions for docker/podman; install real binaries or symlinks","Log `echo $PATH` inside the failing environment and compare with the message's $PATH"],"tags":["docker","podman","path","environment"],"backgroundTag":"executable-not-on-path","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}