{"record":{"id":"7755431ac2adf6ca","repo":"GoogleContainerTools/jib","slug":"message-from-invalidimagereferenceexception-via-h-775543","errorCode":null,"errorMessage":"<message from InvalidImageReferenceException via HelpfulSuggestions.forInvalidImageReference>","messagePattern":"<message from InvalidImageReferenceException via HelpfulSuggestions\\.forInvalidImageReference>","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java","lineNumber":149,"sourceCode":"          \"<container><creationTime> should be an ISO 8601 date-time (see \"\n              + \"DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\\\"EPOCH\\\", \"\n              + \"\\\"USE_CURRENT_TIMESTAMP\\\"): \"\n              + ex.getInvalidCreationTime(),\n          ex);\n\n    } catch (JibPluginExtensionException ex) {\n      String extensionName = ex.getExtensionClass().getName();\n      throw new MojoExecutionException(\n          \"error running extension '\" + extensionName + \"': \" + ex.getMessage(), ex);\n\n    } catch (IncompatibleBaseImageJavaVersionException ex) {\n      throw new MojoExecutionException(\n          HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForMaven(\n              ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),\n          ex);\n\n    } catch (InvalidImageReferenceException ex) {\n      throw new MojoExecutionException(\n          HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);\n\n    } catch (IOException\n        | CacheDirectoryCreationException\n        | MainClassInferenceException\n        | InvalidGlobalConfigException ex) {\n      throw new MojoExecutionException(ex.getMessage(), ex);\n\n    } catch (BuildStepsExecutionException ex) {\n      throw new MojoExecutionException(ex.getMessage(), ex.getCause());\n\n    } catch (ExtraDirectoryNotFoundException ex) {\n      throw new MojoExecutionException(\n          \"<extraDirectories><paths> contain \\\"from\\\" directory that doesn't exist locally: \"\n              + ex.getPath(),\n          ex);\n    } finally {\n      tempDirectoryProvider.close();","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/BuildTarMojo.java#L131-L167","documentation":"Thrown as a MojoExecutionException from BuildTarMojo.execute when the configured image reference cannot be parsed (InvalidImageReferenceException). The message comes from HelpfulSuggestions.forInvalidImageReference and restates the invalid reference with hints about the expected format.","triggerScenarios":"Setting <to><image>, <from><image>, or an extra tag to a malformed reference such as 'My Image', 'registry.example.com:port/img' (non-numeric port), 'Image:v1 final', or an empty string; also via -Dimage=... overrides.","commonSituations":"Typos in the image name, spaces or uppercase in repository names, unescaped tags with invalid characters, environment-variable-substituted values that resolve to empty or partial strings in CI.","solutions":["Fix the image reference to a valid Docker-style reference: [registry-host[:port]/]namespace/repo[:tag][@digest], lowercase repository name.","Remove spaces, illegal characters, or an empty tag from the reference.","If the value comes from a property (e.g. -Dimage or CI variable), print/verify its resolved value — it may be empty or truncated.","Use a fully qualified reference if the registry host is ambiguous, e.g. registry.example.com:5000/myapp:1.0."],"exampleFix":"// before\n<to><image>My App:latest</image></to>\n// after\n<to><image>registry.example.com/myteam/my-app:latest</image></to>","handlingStrategy":"validation","validationCode":"// regex per Docker distribution reference grammar (simplified)\njava.util.regex.Pattern REF = java.util.regex.Pattern.compile(\n  \"^(?:[a-zA-Z0-9][a-zA-Z0-9.-]*(?::[0-9]+)??/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[a-zA-Z0-9._-]+)?(?:@[a-f0-9]{64})?$\");\nif (!REF.matcher(imageRef).matches()) throw new IllegalArgumentException(\"invalid image ref: \" + imageRef);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep repository names lowercase, no spaces or underscores-only segments.","Use fully-qualified references with registry host and explicit tag.","Echo property-derived image names in CI before the build to catch empty/truncated values.","Avoid hand-built references with string concatenation that can leave stray separators."],"tags":["maven","jib","image-reference","configuration"],"backgroundTag":"invalid-url-format","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"}