GoogleContainerTools/jib · error · GradleException

container.filesModificationTime should be an ISO 8601 date-t

Error message

container.filesModificationTime should be an ISO 8601 date-time (see DateTimeFormatter.ISO_DATE_TIME) or special keyword "EPOCH_PLUS_SECOND": ${ex.getInvalidFilesModificationTime()}

What it means

jib.container.filesModificationTime must be either an ISO 8601 date-time string or the special keyword EPOCH_PLUS_SECOND; Jib throws InvalidFilesModificationTimeException for any other value when building via jibBuildTar, and this GradleException echoes the invalid value.

Source

Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildTarTask.java:172

    } catch (InvalidWorkingDirectoryException ex) {
      throw new GradleException(
          "container.workingDirectory is not an absolute Unix-style path: "
              + ex.getInvalidPathValue(),
          ex);
    } catch (InvalidPlatformException ex) {
      throw new GradleException(
          "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);

View on GitHub (pinned to fb949e2676)

Solutions

  1. Use the keyword: jib { container { filesModificationTime = 'EPOCH_PLUS_SECOND' } }
  2. Or supply a valid ISO 8601 date-time, e.g. '2024-01-01T00:00:00Z' (DateTimeFormatter.ISO_DATE_TIME format)
  3. Remove the setting to use the default (EPOCH_PLUS_SECOND behavior)
  4. Check the Jib plugin version's docs for supported keywords before using newer ones

Example fix

// before
jib { container { filesModificationTime = '2024/01/01 10:00' } }
// after
jib { container { filesModificationTime = '2024-01-01T10:00:00Z' } }
Defensive patterns

Strategy: validation

Validate before calling

def t = project.jib.container.filesModificationTime.getOrElse('EPOCH_PLUS_SECOND')
def ok = t == 'EPOCH_PLUS_SECOND' || (t ==~ /^\d{4}-\d{2}-\d{2}T.+/ && { try { java.time.format.DateTimeFormatter.ISO_DATE_TIME.parse(t); true } catch (e) { false } }())
assert ok : "Invalid filesModificationTime: $t"

Prevention

When it happens

Trigger: Running gradle jibBuildTar with jib { container { filesModificationTime = 'yesterday' } } or any non-ISO-8601, non-keyword string (e.g. '2024/01/01 10:00', 'now', epoch seconds like '1700000000').

Common situations: Trying to set a fixed timestamp using a human-readable format that isn't ISO 8601; passing a Unix epoch number; misspelling the keyword (e.g. 'EPOCH_PLUS_1SEC'); copying a value accepted by a different tool.

Related errors


AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06). Data as JSON: /api/errors/4c7ceb70cd8763aa. Report an issue: GitHub.