{"record":{"id":"a184410c3578f8bc","repo":"GoogleContainerTools/jib","slug":"from-platforms-contains-a-platform-configuration-t","errorCode":null,"errorMessage":"from.platforms contains a platform configuration that is missing required values or has invalid values: ${message}: ${invalidPlatform}","messagePattern":"from\\.platforms contains a platform configuration that is missing required values or has invalid values: (.+?): (.+?)","errorType":"validation","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java","lineNumber":143,"sourceCode":"              new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))\n          .runBuild();\n\n    } catch (InvalidAppRootException ex) {\n      throw new GradleException(\n          \"container.appRoot is not an absolute Unix-style path: \" + ex.getInvalidPathValue(), ex);\n\n    } catch (InvalidContainerizingModeException ex) {\n      throw new GradleException(\n          \"invalid value for containerizingMode: \" + ex.getInvalidContainerizingMode(), ex);\n\n    } catch (InvalidWorkingDirectoryException ex) {\n      throw new GradleException(\n          \"container.workingDirectory is not an absolute Unix-style path: \"\n              + ex.getInvalidPathValue(),\n          ex);\n\n    } catch (InvalidPlatformException ex) {\n      throw new GradleException(\n          \"from.platforms contains a platform configuration that is missing required values or has invalid values: \"\n              + ex.getMessage()\n              + \": \"\n              + ex.getInvalidPlatform(),\n          ex);\n\n    } catch (InvalidContainerVolumeException ex) {\n      throw new GradleException(\n          \"container.volumes is not an absolute Unix-style path: \" + ex.getInvalidVolume(), ex);\n\n    } catch (InvalidFilesModificationTimeException ex) {\n      throw new GradleException(\n          \"container.filesModificationTime should be an ISO 8601 date-time (see \"\n              + \"DateTimeFormatter.ISO_DATE_TIME) or special keyword \\\"EPOCH_PLUS_SECOND\\\": \"\n              + ex.getInvalidFilesModificationTime(),\n          ex);\n\n    } catch (InvalidCreationTimeException ex) {","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java#L125-L161","documentation":"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.","triggerScenarios":"Declaring platforms { platform { } } without architecture or os, using unsupported values like architecture = 'x86_64' instead of 'amd64', or empty strings for either field.","commonSituations":"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.","solutions":["Set both architecture and os on every platform, e.g. architecture = 'amd64', os = 'linux'","Use the OCI values: architecture one of amd64/arm64/386 etc., os 'linux' or 'windows'","Remove empty/invalid platform blocks if multi-platform is not needed"],"exampleFix":"// before\njib { from { platforms { platform { architecture = 'arm' } } } }\n// after\njib { from { platforms { platform { architecture = 'arm64'; os = 'linux' } } } }","handlingStrategy":"validation","validationCode":"jib.from.platforms.each { p ->\n  if (!p.architecture || !p.os) throw new GradleException(\"platform needs architecture and os: $p\")\n  if (!(p.os in ['linux','windows'])) throw new GradleException(\"unsupported os: $p.os\")\n}","typeGuard":null,"tryCatchPattern":"try { jibBuild.run() } catch (GradleException e) { if (e.message.contains('from.platforms')) { logger.error(\"Fix platform config: \" + e.message) }; throw e }","preventionTips":["Always set both architecture and os on every platform","Use OCI values (amd64/arm64, linux/windows), not Docker's combined 'linux/amd64' string","Test multi-platform config with a dry run before CI"],"tags":["gradle","jib","configuration","platform-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}