GoogleContainerTools/jib · error · MojoExecutionException
<container><volumes> is not an absolute Unix-style path: <in
Error message
<container><volumes> is not an absolute Unix-style path: <invalidVolume>
What it means
Every path listed in <container><volumes> must be an absolute Unix-style path starting with '/'. Jib throws InvalidContainerVolumeException for a non-absolute volume path during configuration processing, and BuildDockerMojo.execute() surfaces it as a MojoExecutionException including the invalid volume value.
Source
Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildDockerMojo.java:138
throw new MojoExecutionException(
"<from><platforms> contains a platform configuration that is missing required values or has invalid values: "
+ ex.getMessage()
+ ": "
+ ex.getInvalidPlatform(),
ex);
} catch (InvalidContainerVolumeException ex) {
throw new MojoExecutionException(
"<container><volumes> is not an absolute Unix-style path: " + ex.getInvalidVolume(), ex);
} catch (InvalidFilesModificationTimeException ex) {
throw new MojoExecutionException(
"<container><filesModificationTime> should be an ISO 8601 date-time (see "
+ "DateTimeFormatter.ISO_DATE_TIME) or special keyword \"EPOCH_PLUS_SECOND\": "
+ ex.getInvalidFilesModificationTime(),
ex);
} catch (InvalidCreationTimeException ex) {
throw new MojoExecutionException(
"<container><creationTime> should be an ISO 8601 date-time (see "
+ "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", "
+ "\"USE_CURRENT_TIMESTAMP\"): "
+ ex.getInvalidCreationTime(),
ex);
} catch (JibPluginExtensionException ex) {
String extensionName = ex.getExtensionClass().getName();
throw new MojoExecutionException(
"error running extension '" + extensionName + "': " + ex.getMessage(), ex);
} catch (IncompatibleBaseImageJavaVersionException ex) {
throw new MojoExecutionException(
HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(
ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),
ex);
} catch (InvalidImageReferenceException ex) {View on GitHub (pinned to fb949e2676)
Solutions
- Change each <volume> value to an absolute Unix path starting with '/', e.g. /data/logs.
- Convert backslash Windows paths to forward-slash absolute paths.
- Remove invalid volume entries if they were placeholders.
Example fix
<!-- before --> <container><volumes><volume>data/logs</volume></volumes></container> <!-- after --> <container><volumes><volume>/data/logs</volume></volumes></container>
Defensive patterns
Strategy: validation
Validate before calling
for (String v : pomVolumes) {
if (!v.startsWith("/")) {
throw new IllegalArgumentException("<volumes> entries must be absolute Unix paths: " + v);
}
} Type guard
boolean isAbsoluteUnixPath(String p) { return p != null && p.startsWith("/"); } Prevention
- Write volume paths exactly as they should appear in the container (leading slash).
- Convert any Dockerfile VOLUME conventions before porting them to Jib config.
- Keep volume lists short and reviewed, since a bad entry fails the whole build.
When it happens
Trigger: Building with a <volumes><volume>data/logs</volume></volumes> entry (no leading slash) or Windows-style paths under <container><volumes> in the pom or via -Djib.container.volumes overrides.
Common situations: Mirroring Dockerfile VOLUME directives that used relative or Windows paths; generating the volume list from properties that lost the leading slash; hand-editing the XML in an editor that stripped the slash or used backslashes.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- <container><appRoot> is not an absolute Unix-style path: ${e
- <container><appRoot> is not an absolute Unix-style path: <in
- <container><workingDirectory> is not an absolute Unix-style
- <container><appRoot> is not an absolute Unix-style path: <in
- <container><workingDirectory> is not an absolute Unix-style
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/638359d5b20eec65.
Report an issue: GitHub.