GoogleContainerTools/jib · error · InvalidContainerizingModeException

${rawMode}

Error message

${rawMode}

What it means

ContainerizingMode.from parses the `containerizingMode` configuration value (e.g. for exploded Docker builds). If the raw string is not entirely lowercase (the mode must be lowercase), it immediately throws InvalidContainerizingModeException with the raw value in the message. Valid values are the enum names lowercased, e.g. `exploded` and `packaged`.

Source

Thrown at jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/ContainerizingMode.java:45

 * </ul>
 */
public enum ContainerizingMode {
  EXPLODED,
  PACKAGED;

  /**
   * Converts a string representation of ContainerizingMode to Enum. It requires an all lowercase
   * string that matches the enum value exactly.
   *
   * @param rawMode the raw string to parse
   * @return the enum equivalent of the mode
   * @throws InvalidContainerizingModeException when not lowercase, or cannot match to an values of
   *     this enum class
   */
  public static ContainerizingMode from(String rawMode) throws InvalidContainerizingModeException {
    try {
      if (!rawMode.toLowerCase(Locale.US).equals(rawMode)) {
        throw new InvalidContainerizingModeException(rawMode, rawMode);
      }
      return ContainerizingMode.valueOf(rawMode.toUpperCase(Locale.US));
    } catch (IllegalArgumentException ex) {
      throw new InvalidContainerizingModeException(rawMode, rawMode);
    }
  }
}

View on GitHub (pinned to fb949e2676)

Solutions

  1. Use the all-lowercase value: `containerizingMode = "exploded"`.
  2. Valid modes: `exploded` (default) and `packaged`; pick one of those exactly.
  3. Check pom.xml/build.gradle for a leftover uppercase value and fix it.

Example fix

// before
jib { containerizingMode = "Exploded" }
// after
jib { containerizingMode = "exploded" }
Defensive patterns

Strategy: validation

Validate before calling

// validate the mode is a known lowercase value before building
const modes = ['exploded', 'packaged'];
if (!modes.includes(containerizingMode)) throw new Error('mode must be one of ' + modes);

Try / catch

try { jibBuild() } catch (InvalidContainerizingModeException e) {
  // normalize and retry
  mode = mode.toLowerCase(Locale.ROOT);
}

Prevention

When it happens

Trigger: Setting `containerizingMode = "Exploded"` or `"PACKAGED"` (any uppercase letters) via Gradle/Maven config or the `jib.containerizingMode` property.

Common situations: Copy-pasting an enum name in CamelCase or uppercase from docs/source into build configuration.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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