{"record":{"id":"dab97eb377368ef6","repo":"quarkusio/quarkus","slug":"buildpack-build-unable-to-verify-project-dir","errorCode":null,"errorMessage":"Buildpack build unable to verify project dir","messagePattern":"Buildpack build unable to verify project dir","errorType":"error_code","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java","lineNumber":154,"sourceCode":"                outputTarget, true /* isNative */);\n\n        artifactResultProducer.produce(new ArtifactResultBuildItem(null, \"native-container\",\n                Collections.singletonMap(\"container-image\", targetImageName)));\n        containerImageBuilder.produce(new ContainerImageBuilderBuildItem(BUILDPACK));\n    }\n\n    private Map<ProjectDirs, Path> getPaths(OutputTargetBuildItem outputTarget) {\n\n        Path targetDirectory = outputTarget.getOutputDirectory();\n\n        Map.Entry<Path, Path> mainSourcesRoot = findMainSourcesRoot(targetDirectory);\n        if (mainSourcesRoot == null) {\n            throw new RuntimeException(\"Buildpack build unable to determine project dir\");\n        }\n        Path sourceRoot = mainSourcesRoot.getKey();\n        Path projectRoot = mainSourcesRoot.getValue();\n        if (!projectRoot.toFile().exists() || !sourceRoot.toFile().exists()) {\n            throw new RuntimeException(\"Buildpack build unable to verify project dir\");\n        }\n\n        Map<ProjectDirs, Path> result = new HashMap<>();\n        result.put(ProjectDirs.ROOT, projectRoot);\n        result.put(ProjectDirs.SOURCE, sourceRoot);\n        result.put(ProjectDirs.TARGET, targetDirectory);\n        return result;\n    }\n\n    private String runBuildpackBuild(BuildpackConfig buildpackConfig,\n            ContainerImageInfoBuildItem containerImage,\n            ContainerImageConfig containerImageConfig,\n            boolean buildContainerImage,\n            boolean pushContainerImage,\n            OutputTargetBuildItem outputTarget,\n            boolean isNativeBuild) {\n\n        Map<ProjectDirs, Path> dirs = getPaths(outputTarget);","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java#L136-L172","documentation":"After resolving the project root and sources root, getPaths verifies that both directories actually exist on disk; if either is missing the build fails with a RuntimeException because buildpack cannot source files from a nonexistent project.","triggerScenarios":"findMainSourcesRoot returned paths that don't exist — e.g. the build ran in a workspace where source directories were deleted/moved, or paths were computed for another filesystem (containers, CI checkouts).","commonSituations":"CI pipelines copying only artifacts; Docker-in-Docker builds where host paths differ; stale build caches pointing at removed directories.","solutions":["Verify the project source and root directories exist before running the image build","Run the container-image build from the actual project checkout","Fix CI to include sources (not just target artifacts) when building images"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"Path projectRoot = Path.of(System.getProperty(\"user.dir\"));\nif (!Files.isDirectory(projectRoot.resolve(\"src\", \"main\"))) {\n    throw new IllegalStateException(\"project sources missing from workspace\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    imageBuild();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"unable to verify project dir\")) {\n        // ensure sources exist in the workspace before rebuilding\n    } else { throw e; }\n}","preventionTips":["Keep full sources in CI workspaces, not just target artifacts","Confirm source directories exist before container-image builds","Avoid building images from detached/copied artifact trees"],"tags":["buildpack","container-image","filesystem"],"backgroundTag":"project-dir-not-found","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"}