GoogleContainerTools/jib · error · GradleException

from.platforms contains a platform configuration that is mis

Error message

from.platforms contains a platform configuration that is missing required values or has invalid values: ${message}: ${invalidPlatform}

What it means

Thrown when a from.platforms entry is missing required fields (architecture and os are mandatory) or contains invalid values. Jib validates each platform configuration used for multi-architecture (platform-specific) image builds and wraps InvalidPlatformException with the detailed message and offending platform.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java:143

              new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))
          .runBuild();

    } catch (InvalidAppRootException ex) {
      throw new GradleException(
          "container.appRoot is not an absolute Unix-style path: " + ex.getInvalidPathValue(), ex);

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

    } catch (InvalidWorkingDirectoryException ex) {
      throw new GradleException(
          "container.workingDirectory is not an absolute Unix-style path: "
              + ex.getInvalidPathValue(),
          ex);

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

    } catch (InvalidFilesModificationTimeException ex) {
      throw new GradleException(
          "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) {

View on GitHub (pinned to fb949e2676)

Solutions

  1. Set both architecture and os on every platform, e.g. architecture = 'amd64', os = 'linux'
  2. Use the OCI values: architecture one of amd64/arm64/386 etc., os 'linux' or 'windows'
  3. Remove empty/invalid platform blocks if multi-platform is not needed

Example fix

// before
jib { from { platforms { platform { architecture = 'arm' } } } }
// after
jib { from { platforms { platform { architecture = 'arm64'; os = 'linux' } } } }
Defensive patterns

Strategy: validation

Validate before calling

jib.from.platforms.each { p ->
  if (!p.architecture || !p.os) throw new GradleException("platform needs architecture and os: $p")
  if (!(p.os in ['linux','windows'])) throw new GradleException("unsupported os: $p.os")
}

Try / catch

try { jibBuild.run() } catch (GradleException e) { if (e.message.contains('from.platforms')) { logger.error("Fix platform config: " + e.message) }; throw e }

Prevention

When it happens

Trigger: Declaring platforms { platform { } } without architecture or os, using unsupported values like architecture = 'x86_64' instead of 'amd64', or empty strings for either field.

Common situations: Configuring multi-platform builds for Apple Silicon/ARM deployments, copying platform snippets that omit os, or using Docker's platform string format ('linux/amd64') instead of separate fields.

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