GoogleContainerTools/jib · error · GradleException
container.creationTime should be an ISO 8601 date-time (see
Error message
container.creationTime should be an ISO 8601 date-time (see DateTimeFormatter.ISO_DATE_TIME) or a special keyword ("EPOCH", "USE_CURRENT_TIMESTAMP"): ${ex.getInvalidCreationTime()} What it means
jib's buildTar task wraps InvalidCreationTimeException in a GradleException because the 'container.creationTime' build configuration could not be parsed. Jib expects the value to be an ISO 8601 date-time parseable by DateTimeFormatter.ISO_DATE_TIME, or one of the special keywords "EPOCH" or "USE_CURRENT_TIMESTAMP". The raw invalid string is included in the message via ex.getInvalidCreationTime().
Source
Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildTarTask.java:179
"from.platforms contains a platform configuration that is missing required values or has invalid values: "
+ ex.getMessage()
+ ": "
+ ex.getInvalidPlatform(),
ex);
} catch (InvalidContainerVolumeException ex) {
throw new GradleException(
"container.volumes is not an absolute Unix-style path: " + ex.getInvalidVolume(), ex);
} catch (InvalidFilesModificationTimeException ex) {
throw new GradleException(
"container.filesModificationTime should be an ISO 8601 date-time (see "
+ "DateTimeFormatter.ISO_DATE_TIME) or special keyword \"EPOCH_PLUS_SECOND\": "
+ ex.getInvalidFilesModificationTime(),
ex);
} catch (InvalidCreationTimeException ex) {
throw new GradleException(
"container.creationTime should be an ISO 8601 date-time (see "
+ "DateTimeFormatter.ISO_DATE_TIME) or a special keyword (\"EPOCH\", "
+ "\"USE_CURRENT_TIMESTAMP\"): "
+ ex.getInvalidCreationTime(),
ex);
} catch (JibPluginExtensionException ex) {
String extensionName = ex.getExtensionClass().getName();
throw new GradleException(
"error running extension '" + extensionName + "': " + ex.getMessage(), ex);
} catch (IncompatibleBaseImageJavaVersionException ex) {
throw new GradleException(
HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForGradle(
ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),
ex);
} catch (InvalidImageReferenceException ex) {View on GitHub (pinned to fb949e2676)
Solutions
- Change container.creationTime to a full ISO 8601 date-time, e.g. '2023-01-15T10:30:00+00:00' or '2023-01-15T10:30:00Z'
- Use the special keyword 'USE_CURRENT_TIMESTAMP' to stamp images with build time, or 'EPOCH' for Unix epoch 0
- If the value comes from a property, print/validate it with java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(value) before passing it to Jib
Example fix
// before jib.container.creationTime = '01/15/2023 10:30' // after jib.container.creationTime = '2023-01-15T10:30:00Z' // or jib.container.creationTime = 'USE_CURRENT_TIMESTAMP'
Defensive patterns
Strategy: validation
Validate before calling
def validCreationTime = { s ->
s in ['EPOCH', 'USE_CURRENT_TIMESTAMP'] ||
{ try { java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(s); true } catch (ignored) { false } ) }
}
assert validCreationTime(jib.container.creationTime.get()) Prevention
- Use the keywords EPOCH or USE_CURRENT_TIMESTAMP unless reproducible timestamps are required
- Always store ISO 8601 with time and zone offset (e.g. 2023-01-15T10:30:00Z), never locale-formatted strings
- Add a build-script assertion that parses the timestamp with DateTimeFormatter.ISO_DATE_TIME
When it happens
Trigger: Setting container { creationTime = ... } in the jib Gradle extension with a string that is neither ISO 8601 (e.g. '2021-07-13' date-only, or a custom format like 'MM/dd/yyyy HH:mm:ss') nor the exact keywords EPOCH / USE_CURRENT_TIMESTAMP, then running any jib task including jibBuildTar (BuildTarTask.buildTar).
Common situations: Developers copy a human-readable date from logs or a Dockerfile-style date into creationTime; they use a date-only value without time and offset; they use a different keyword like 'now' or 'current' assuming it is supported.
Related errors
- container.filesModificationTime should be an ISO 8601 date-t
- container.creationTime should be an ISO 8601 date-time (see
- container.filesModificationTime should be an ISO 8601 date-t
- container.filesModificationTime should be an ISO 8601 date-t
- container.creationTime should be an ISO 8601 date-time (see
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/7b486b1b711c85d4.
Report an issue: GitHub.