{"record":{"id":"b9c1a86accf14e16","repo":"GoogleContainerTools/jib","slug":"invalid-image-creation-time-containerconfigurat","errorCode":null,"errorMessage":"Invalid image creation time: + containerConfigurationTemplate.getCreated()","messagePattern":"Invalid image creation time: \\+ containerConfigurationTemplate\\.getCreated\\(\\)","errorType":"validation","errorClass":"BadContainerConfigurationFormatException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/image/json/JsonToImageTranslator.java","lineNumber":160,"sourceCode":"\n  private static void configureBuilderWithContainerConfiguration(\n      Image.Builder imageBuilder, ContainerConfigurationTemplate containerConfigurationTemplate)\n      throws BadContainerConfigurationFormatException {\n\n    containerConfigurationTemplate.getHistory().forEach(imageBuilder::addHistory);\n\n    if (containerConfigurationTemplate.getCreated() != null) {\n      try {\n        imageBuilder.setCreated(Instant.parse(containerConfigurationTemplate.getCreated()));\n      } catch (DateTimeParseException ex) {\n        try {\n          // TODO: remove when using Java >= 12.\n          // See https://github.com/GoogleContainerTools/jib/issues/2428\n          imageBuilder.setCreated(\n              DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(\n                  containerConfigurationTemplate.getCreated(), Instant::from));\n        } catch (DateTimeParseException ignored) {\n          throw new BadContainerConfigurationFormatException(\n              \"Invalid image creation time: \" + containerConfigurationTemplate.getCreated(), ex);\n        }\n      }\n    }\n\n    if (containerConfigurationTemplate.getArchitecture() != null) {\n      imageBuilder.setArchitecture(containerConfigurationTemplate.getArchitecture());\n    }\n    if (containerConfigurationTemplate.getOs() != null) {\n      imageBuilder.setOs(containerConfigurationTemplate.getOs());\n    }\n\n    imageBuilder.setEntrypoint(containerConfigurationTemplate.getContainerEntrypoint());\n    imageBuilder.setProgramArguments(containerConfigurationTemplate.getContainerCmd());\n\n    List<String> baseHealthCheckCommand = containerConfigurationTemplate.getContainerHealthTest();\n    if (baseHealthCheckCommand != null) {\n      DockerHealthCheck.Builder builder = DockerHealthCheck.fromCommand(baseHealthCheckCommand);","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/image/json/JsonToImageTranslator.java#L142-L178","documentation":"The container configuration's 'created' timestamp must be an ISO-8601 offset date-time. Jib parses it with DateTimeFormatter.ISO_OFFSET_DATE_TIME (working around the lack of Instant.parse for offsets on Java < 12) and throws BadContainerConfigurationFormatException when parsing fails.","triggerScenarios":"Calling JsonToImageTranslator.toImage with a container configuration whose 'created' field is absent of timezone offset, empty, or in a non-ISO format (e.g. epoch millis, 'yyyy-MM-dd HH:mm:ss').","commonSituations":"Container configs produced by non-Docker tooling writing local-format timestamps; hand-edited config JSON; registries serving configs with nonconforming created fields; configs from older builders using different date formats.","solutions":["Fix the container configuration's 'created' field to ISO-8601 with offset, e.g. '2023-01-15T10:30:00+00:00' or '...Z'","Pre-validate the timestamp with DateTimeFormatter.ISO_OFFSET_DATE_TIME parse in a try-catch before calling toImage","Catch BadContainerConfigurationFormatException and fall back to a default created time or omit the field"],"exampleFix":"// before\n\"created\": \"2023/01/15 10:30:00\"\n// after\n\"created\": \"2023-01-15T10:30:00Z\"","handlingStrategy":"validation","validationCode":"try {\n  DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(created, Instant::from);\n} catch (DateTimeParseException e) {\n  throw new IllegalArgumentException(\"created must be ISO-8601 offset date-time: \" + created);\n}","typeGuard":null,"tryCatchPattern":"try { JsonToImageTranslator.toImage(manifest, config); } catch (BadContainerConfigurationFormatException e) { /* normalize 'created' to ISO-8601 and retry */ }","preventionTips":["Write 'created' as ISO-8601 with offset (e.g. ...Z or +00:00)","Validate config timestamps before feeding configs from third-party tooling to Jib","Catch BadContainerConfigurationFormatException around all toImage calls"],"tags":["jib","container-config","date","iso-8601"],"backgroundTag":"invalid-date-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"}