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

BuildTarMojo.execute throws this when an entry in <container><volumes> is not an absolute Unix-style path. InvalidContainerVolumeException provides the invalid volume string embedded in the message. Each volume must be an absolute path like /var/log.

Source

Thrown at jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java:119

    } catch (InvalidContainerizingModeException ex) {
      throw new MojoExecutionException(
          "invalid value for <containerizingMode>: " + ex.getInvalidContainerizingMode(), ex);

    } catch (InvalidWorkingDirectoryException ex) {
      throw new MojoExecutionException(
          "<container><workingDirectory> is not an absolute Unix-style path: "
              + ex.getInvalidPathValue(),
          ex);
    } catch (InvalidPlatformException ex) {
      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) {

View on GitHub (pinned to fb949e2676)

Solutions

  1. Prefix each volume with '/', e.g. /var/log.
  2. Use only forward slashes and remove drive letters.
  3. Remove invalid <volume> entries if they are not needed.

Example fix

<!-- before -->
<container><volumes><volume>var/log</volume></volumes></container>
<!-- after -->
<container><volumes><volume>/var/log</volume></volumes></container>
Defensive patterns

Strategy: validation

Validate before calling

String volume = "var/log";
if (!volume.startsWith("/") || volume.contains("\\")) {
  throw new IllegalArgumentException("<volumes> entries must be absolute Unix paths: " + volume);
}

Try / catch

try { ... } catch (MojoExecutionException e) { if (e.getMessage().startsWith("<container><volumes>")) { /* make volume path absolute */ } throw e; }

Prevention

When it happens

Trigger: Running 'mvn jib:buildTar' with <container><volumes><volume>var/log</volume></volumes></container> (missing leading slash) or a Windows-style path.

Common situations: Listing volumes relative by mistake; copy-pasting bind-mount host paths (C:\data) instead of in-container mount points; whitespace typos.

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/6256942945b04f1d. Report an issue: GitHub.