{"record":{"id":"9808e8158a5b259a","repo":"GoogleContainerTools/jib","slug":"registrymirrors-registry-property-is-missing","errorCode":null,"errorMessage":"'registryMirrors.registry' property is missing","messagePattern":"'registryMirrors\\.registry' property is missing","errorType":"validation","errorClass":"InvalidGlobalConfigException","httpStatus":null,"severity":"error","filePath":"jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/globalconfig/GlobalConfig.java","lineNumber":92,"sourceCode":"              + configFile);\n\n    } catch (IOException ex) {\n      throw new IOException(\n          \"Failed to create, open, or parse global Jib config file; see \"\n              + \"https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#where-is-the-global-jib-configuration-file-and-how-i-can-configure-it \"\n              + \"to fix or you may need to delete \"\n              + configFile,\n          ex);\n    }\n  }\n\n  private static GlobalConfig from(GlobalConfigTemplate configJson)\n      throws InvalidGlobalConfigException {\n    ImmutableListMultimap.Builder<String, String> registryMirrors = ImmutableListMultimap.builder();\n    for (RegistryMirrorsTemplate mirrorConfig : configJson.getRegistryMirrors()) {\n      // validation\n      if (Strings.isNullOrEmpty(mirrorConfig.getRegistry())) {\n        throw new InvalidGlobalConfigException(\"'registryMirrors.registry' property is missing\");\n      }\n      if (mirrorConfig.getMirrors().isEmpty()) {\n        throw new InvalidGlobalConfigException(\"'registryMirrors.mirrors' property is missing\");\n      }\n\n      registryMirrors.putAll(mirrorConfig.getRegistry(), mirrorConfig.getMirrors());\n    }\n\n    return new GlobalConfig(configJson.isDisableUpdateCheck(), registryMirrors.build());\n  }\n\n  /**\n   * Returns the config directory set by {@link PropertyNames#CONFIG_DIRECTORY} if not null,\n   * otherwise returns the default config directory.\n   *\n   * @return the config directory set by {@link PropertyNames#CONFIG_DIRECTORY} if not null,\n   *     otherwise returns the default config directory.\n   */","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/globalconfig/GlobalConfig.java#L74-L110","documentation":"Jib's global config validation rejects a registryMirrors entry whose 'registry' property is null or empty. Each mirrors entry must name the registry it applies to, so an entry without one makes the whole config invalid and the build fails with InvalidGlobalConfigException.","triggerScenarios":"GlobalConfig.from() iterates configJson.getRegistryMirrors() and throws when Strings.isNullOrEmpty(mirrorConfig.getRegistry()) — i.e. a JSON entry like {\"mirrors\": [...]} with no 'registry' key or \"registry\": \"\" in ~/.jib/jib-config.json.","commonSituations":"Hand-editing the global config and omitting the registry key; copying a partial example from docs; typos like 'registery' silently yielding null registry.","solutions":["Add a non-empty 'registry' value to every entry in the registryMirrors array","Check for misspelled property names that leave registry null","Remove the incomplete entry if mirrors were not intended for it"],"exampleFix":"// before: ~/.jib/jib-config.json\n{ \"registryMirrors\": [ { \"mirrors\": [\"mirror.gcr.io\"] } ] }\n// after\n{ \"registryMirrors\": [ { \"registry\": \"docker.io\", \"mirrors\": [\"mirror.gcr.io\"] } ] }","handlingStrategy":"validation","validationCode":"// Validate registryMirrors entries before building\nObject mirrors = json.get(\"registryMirrors\");\nfor (Object o : (java.util.List<?>) mirrors) {\n  java.util.Map<?,?> entry = (java.util.Map<?,?>) o;\n  Object registry = entry.get(\"registry\");\n  if (!(registry instanceof String) || ((String) registry).isEmpty())\n    throw new IllegalArgumentException(\"registryMirrors entry missing 'registry'\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a non-empty 'registry' string in every registryMirrors entry","Avoid hand-editing; copy a full documented example","Watch for misspelled keys that silently map to null"],"tags":["jib","config","validation"],"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"}