{"record":{"id":"18ba43928ad04528","repo":"GoogleContainerTools/jib","slug":"registrymirrors-mirrors-property-is-missing","errorCode":null,"errorMessage":"'registryMirrors.mirrors' property is missing","messagePattern":"'registryMirrors\\.mirrors' 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":95,"sourceCode":"      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   */\n  public static Path getConfigDir() {\n    String configDirProperty = System.getProperty(PropertyNames.CONFIG_DIRECTORY);\n    if (!Strings.isNullOrEmpty(configDirProperty)) {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/globalconfig/GlobalConfig.java#L77-L113","documentation":"Jib's global config validation rejects a registryMirrors entry whose 'mirrors' list is empty. Every registry entry must include at least one mirror URL; otherwise the config is invalid and the build fails with InvalidGlobalConfigException.","triggerScenarios":"GlobalConfig.from() throws when mirrorConfig.getMirrors().isEmpty() — a JSON entry like {\"registry\": \"docker.io\", \"mirrors\": []} or a missing 'mirrors' key in ~/.jib/jib-config.json.","commonSituations":"Adding a registry entry as a placeholder before filling in mirrors; hand-editing the config and leaving the array empty; JSON tooling writing null for an unset list.","solutions":["Provide at least one mirror URL in each registryMirrors entry's 'mirrors' array","Remove the entry entirely if no mirrors are needed for that registry","Verify the property is named 'mirrors' (plural) and is an array of strings"],"exampleFix":"// before: ~/.jib/jib-config.json\n{ \"registryMirrors\": [ { \"registry\": \"docker.io\", \"mirrors\": [] } ] }\n// after\n{ \"registryMirrors\": [ { \"registry\": \"docker.io\", \"mirrors\": [\"mirror.gcr.io\"] } ] }","handlingStrategy":"validation","validationCode":"// Ensure each mirrors array is non-empty\nfor (Object o : (java.util.List<?>) json.get(\"registryMirrors\")) {\n  java.util.List<?> m = (java.util.List<?>) ((java.util.Map<?,?>) o).get(\"mirrors\");\n  if (m == null || m.isEmpty())\n    throw new IllegalArgumentException(\"registryMirrors entry missing non-empty 'mirrors'\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave a 'mirrors' array empty; remove the entry instead","Spell the key exactly 'mirrors' (plural)","Validate the JSON schema before saving the config"],"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"}