quarkusio/quarkus · error · UncheckedIOException
Unable to add extra files in
Error message
Unable to add extra files in
What it means
When quarkus.jib.jvm-extra-files (or native extra files) points at a directory copied verbatim into the container, JibProcessor walks jibFilesRoot and builds an extra files layer. If any I/O on that tree fails (missing root, unreadable file, symlink issues), the IOException is wrapped as UncheckedIOException("Unable to add extra files in '<jibFilesRoot>' to the container").
Source
Thrown at extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java:912
}
FileEntriesLayer extraFilesLayer;
try {
extraFilesLayer = ContainerBuilderHelper.extraDirectoryLayerConfiguration(
jibFilesRoot,
AbsoluteUnixPath.get("/"),
Collections.emptyMap(),
(localPath, ignored2) -> {
try {
return Files.getLastModifiedTime(localPath).toInstant();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
});
jibContainerBuilder.addFileEntriesLayer(
extraFilesLayer);
} catch (IOException e) {
throw new UncheckedIOException(
"Unable to add extra files in '" + jibFilesRoot.toAbsolutePath().toString() + "' to the container", e);
}
}
private Map<String, String> allLabels(ContainerImageJibConfig jibConfig, ContainerImageConfig containerImageConfig,
List<ContainerImageLabelBuildItem> containerImageLabels) {
if (containerImageLabels.isEmpty() && containerImageConfig.labels().isEmpty()) {
return Collections.emptyMap();
}
final Map<String, String> allLabels = new HashMap<>(containerImageConfig.labels());
for (ContainerImageLabelBuildItem containerImageLabel : containerImageLabels) {
// we want the user supplied labels to take precedence so the user can override labels generated from other extensions if desired
allLabels.putIfAbsent(containerImageLabel.getName(), containerImageLabel.getValue());
}
return allLabels;
}
View on GitHub (pinned to e1c734241f)
Solutions
- Verify the configured extra-files path exists relative to the module root (ls the exact absolute path printed in the message)
- Use an absolute path or fix the relative path in application.properties
- Check read permissions on the directory tree for the user running the build
- Remove symlinks/broken entries from the extra-files directory
Example fix
// before: application.properties quarkus.jib.jvm-extra-files=./extra-files // after: correct, existing path relative to the module quarkus.jib.jvm-extra-files=src/main/jib # (src/main/jib is the conventional location and must exist)
Defensive patterns
Strategy: validation
Validate before calling
// before enabling extra files
String extra = System.getProperty("quarkus.jib.jvm-extra-files", "");
if (!extra.isEmpty() && !java.nio.file.Files.isDirectory(java.nio.file.Path.of(extra))) {
throw new IllegalStateException("quarkus.jib.jvm-extra-files does not exist: " + extra);
} Prevention
- Resolve extra-files paths relative to the module root and verify with an absolute path locally
- Commit the extra-files directory to version control
- Use the conventional src/main/jib location
- Keep the tree free of symlinks and unreadable files
When it happens
Trigger: quarkus.jib.jvm-extra-files (or quarkus.jib.native-extra-files) is set to a path that does not exist, is not readable, or contains files that disappear/fail during the copy walk.
Common situations: Typo in the extra-files path, path relative to a different working directory than expected (config resolves against project root vs module dir), CI copying config between projects where the extra-files directory was not committed, permission-restricted files in the directory.
Related errors
- Unable to get last modified time for
- Could not find builder image '${effectiveBuilderImage}' loca
- Buildpack build unable to verify project dir
- Unable to save enhanced Dockerfile contents to disk
- The native binary produced by the build is not a Linux binar
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/5843813ea8ba7b2a.
Report an issue: GitHub.