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

  1. Change each <volume> value to an absolute Unix path starting with '/', e.g. /data/logs.
  2. Convert backslash Windows paths to forward-slash absolute paths.
  3. 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

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


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/638359d5b20eec65. Report an issue: GitHub.