{"record":{"id":"a1bc46058298183c","repo":"GoogleContainerTools/jib","slug":"platform-configuration-is-missing-an-os-value","errorCode":null,"errorMessage":"platform configuration is missing an OS value","messagePattern":"platform configuration is missing an OS value","errorType":"validation","errorClass":"InvalidPlatformException","httpStatus":null,"severity":"error","filePath":"jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java","lineNumber":813,"sourceCode":"   * @throws InvalidPlatformException if there exists a {@link PlatformConfiguration} in the\n   *     specified platforms list that is missing required fields or has invalid values\n   */\n  @VisibleForTesting\n  static Set<Platform> getPlatformsSet(RawConfiguration rawConfiguration)\n      throws InvalidPlatformException {\n    Set<Platform> platforms = new LinkedHashSet<>();\n    for (PlatformConfiguration platformConfiguration : rawConfiguration.getPlatforms()) {\n      Optional<String> architecture = platformConfiguration.getArchitectureName();\n      Optional<String> os = platformConfiguration.getOsName();\n      String platformToString =\n          \"architecture=\" + architecture.orElse(\"<missing>\") + \", os=\" + os.orElse(\"<missing>\");\n\n      if (!architecture.isPresent()) {\n        throw new InvalidPlatformException(\n            \"platform configuration is missing an architecture value\", platformToString);\n      }\n      if (!os.isPresent()) {\n        throw new InvalidPlatformException(\n            \"platform configuration is missing an OS value\", platformToString);\n      }\n\n      platforms.add(new Platform(architecture.get(), os.get()));\n    }\n    return platforms;\n  }\n\n  /**\n   * Parses the list of raw volumes directories to a set of {@link AbsoluteUnixPath}.\n   *\n   * @param rawConfiguration raw configuration data\n   * @return the set of parsed volumes.\n   * @throws InvalidContainerVolumeException if {@code volumes} are not valid absolute Unix paths\n   */\n  @VisibleForTesting\n  static Set<AbsoluteUnixPath> getVolumesSet(RawConfiguration rawConfiguration)\n      throws InvalidContainerVolumeException {","sourceCodeStart":795,"sourceCodeEnd":831,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java#L795-L831","documentation":"Jib validates each entry in the <platforms>/<platform> configuration and requires both an architecture and an OS. When a platform block omits <os>, Jib throws InvalidPlatformException with 'platform configuration is missing an OS value' and echoes the partially-specified platform (e.g. architecture=amd64, os=<missing>). This happens while processing common plugin configuration before any image build begins.","triggerScenarios":"Calling processCommonConfiguration -> getPlatformsSet when a platform configuration entry (Maven <platform> or Gradle platform{...} block, or a JibSystemProperties/extension-supplied PlatformConfiguration) has an architecture but getOsName() returns empty Optional.","commonSituations":"Users write only <architecture>amd64</architecture> in the platform block assuming OS defaults to linux; platform blocks built programmatically (e.g. from YAML or build scripts) that set architecture but forget os; empty <os></os> tags parsed as missing.","solutions":["Add the <os> element (usually linux) to the platform block: <platform><architecture>amd64</architecture><os>linux</os></platform>.","If configuring programmatically, call setOsName(...) (or the builder equivalent) on every PlatformConfiguration before passing it to Jib.","Check the '<missing>' value in the exception message to confirm which platform block is incomplete, then fix that specific entry."],"exampleFix":"// before (Maven)\n<platform><architecture>amd64</architecture></platform>\n// after\n<platform><architecture>amd64</architecture><os>linux</os></platform>","handlingStrategy":"validation","validationCode":"// Before running Jib, check each configured platform\nplatforms.forEach(p -> {\n  if (p.getArchitecture() == null || p.getArchitecture().isEmpty())\n    throw new IllegalStateException(\"platform missing architecture\");\n  if (p.getOs() == null || p.getOs().isEmpty())\n    throw new IllegalStateException(\"platform missing os\");\n});","typeGuard":null,"tryCatchPattern":"// Maven/Gradle fail before the build; if calling Jib APIs directly:\ntry {\n  Set<Platform> platforms = getPlatformsSet(rawConfig);\n} catch (InvalidPlatformException e) {\n  logger.error(\"Fix the platform config: \" + e.getMessage());\n}","preventionTips":["Always specify both <architecture> and <os> in every platform block","Standard block: architecture=amd64, os=linux unless targeting ARM (arm64/linux)","Validate extension-generated platform configs in CI before invoking Jib"],"tags":["container-image","configuration","java"],"backgroundTag":"missing-required-config-field","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"}