quarkusio/quarkus · error · RuntimeException
Buildpack build unable to verify project dir
Error message
Buildpack build unable to verify project dir
What it means
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.
Source
Thrown at extensions/container-image/container-image-buildpack/deployment/src/main/java/io/quarkus/container/image/buildpack/deployment/BuildpackProcessor.java:154
outputTarget, true /* isNative */);
artifactResultProducer.produce(new ArtifactResultBuildItem(null, "native-container",
Collections.singletonMap("container-image", targetImageName)));
containerImageBuilder.produce(new ContainerImageBuilderBuildItem(BUILDPACK));
}
private Map<ProjectDirs, Path> getPaths(OutputTargetBuildItem outputTarget) {
Path targetDirectory = outputTarget.getOutputDirectory();
Map.Entry<Path, Path> mainSourcesRoot = findMainSourcesRoot(targetDirectory);
if (mainSourcesRoot == null) {
throw new RuntimeException("Buildpack build unable to determine project dir");
}
Path sourceRoot = mainSourcesRoot.getKey();
Path projectRoot = mainSourcesRoot.getValue();
if (!projectRoot.toFile().exists() || !sourceRoot.toFile().exists()) {
throw new RuntimeException("Buildpack build unable to verify project dir");
}
Map<ProjectDirs, Path> result = new HashMap<>();
result.put(ProjectDirs.ROOT, projectRoot);
result.put(ProjectDirs.SOURCE, sourceRoot);
result.put(ProjectDirs.TARGET, targetDirectory);
return result;
}
private String runBuildpackBuild(BuildpackConfig buildpackConfig,
ContainerImageInfoBuildItem containerImage,
ContainerImageConfig containerImageConfig,
boolean buildContainerImage,
boolean pushContainerImage,
OutputTargetBuildItem outputTarget,
boolean isNativeBuild) {
Map<ProjectDirs, Path> dirs = getPaths(outputTarget);View on GitHub (pinned to e1c734241f)
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
Defensive patterns
Strategy: validation
Validate before calling
Path projectRoot = Path.of(System.getProperty("user.dir"));
if (!Files.isDirectory(projectRoot.resolve("src", "main"))) {
throw new IllegalStateException("project sources missing from workspace");
} Try / catch
try {
imageBuild();
} catch (RuntimeException e) {
if (e.getMessage().contains("unable to verify project dir")) {
// ensure sources exist in the workspace before rebuilding
} else { throw e; }
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: CI pipelines copying only artifacts; Docker-in-Docker builds where host paths differ; stale build caches pointing at removed directories.
Related errors
- The native binary produced by the build is not a Linux binar
- Buildpack build unable to determine project dir
- Buildpack build failed
- Unable to save enhanced Dockerfile contents to disk
- Unable to get last modified time for
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/dab97eb377368ef6.
Report an issue: GitHub.