{"record":{"id":"b60917dd51e97440","repo":"GoogleContainerTools/jib","slug":"from-platforms-contains-a-platform-configuration-t-b60917","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/BuildImageTask.java","lineNumber":138,"sourceCode":"              globalConfig,\n              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    } 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":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java#L120-L156","documentation":"Jib validates each entry in from.platforms (container build platforms, e.g. architecture/os pairs). InvalidPlatformException is thrown when a platform configuration is missing required fields (like os or architecture) or has invalid values, and the task rethrows it as this GradleException with the underlying message and the invalid platform value.","triggerScenarios":"Configuring jib.from.platforms with a platform missing 'architecture' or 'os', empty strings, or unsupported os/architecture combinations, then running a jib build task.","commonSituations":"Copy-paste of multi-platform (arm64/amd64) config with a field accidentally deleted; setting only 'architecture' without 'os'; typos like 'arch' instead of 'architecture'; specifying platforms with a plugin version that requires both fields.","solutions":["Ensure each platform specifies both architecture and os, e.g. { architecture = 'amd64'; os = 'linux' }.","Fix unsupported values (use os 'linux' or 'windows'; architectures like 'amd64', 'arm64').","Remove the platforms block to use the default linux/amd64 platform.","Read the embedded ex.getMessage() for which field was invalid."],"exampleFix":"// before\njib {\n  from { platforms { platform { architecture = 'arm64' } } }\n}\n// after\njib {\n  from {\n    platforms {\n      platform { architecture = 'arm64'; os = 'linux' }\n    }\n  }\n}","handlingStrategy":"validation","validationCode":"jib.from.platforms.each { p ->\n  if (!p.architecture || !p.os) {\n    throw new GradleException(\"Each platform needs non-empty architecture and os, got: $p\")\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  tasks.named('jib').get().execute()\n} catch (GradleException e) {\n  if (e.message?.startsWith('from.platforms contains a platform')) {\n    logger.error(\"Check each platform's architecture/os fields: ${e.message}\")\n  }\n  throw e\n}","preventionTips":["Always set both architecture and os on every platform entry.","Use canonical values: linux/windows and amd64/arm64.","Remove the platforms block if you only need the default linux/amd64."],"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-14T00:17:10.932Z"}