GoogleContainerTools/jib · error · GradleException

error running extension '${extensionClassName}': ${message}

Error message

error running extension '${extensionClassName}': ${message}

What it means

Thrown when a Jib plugin extension fails during execution. Jib extensions (e.g. jib-spring-boot, build layers extensions) are run as part of the build; any exception they throw is wrapped in JibPluginExtensionException and rethrown as a GradleException naming the extension class and its message.

Source

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

    } 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) {
      throw new GradleException(
          HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);

    } catch (ExtraDirectoryNotFoundException ex) {
      throw new GradleException(
          "extraDirectories.paths contain \"from\" directory that doesn't exist locally: "
              + ex.getPath(),
          ex);
    } finally {

View on GitHub (pinned to fb949e2676)

Solutions

  1. Read the nested cause: run with --stacktrace/--info to see the underlying extension failure
  2. Ensure the extension's plugin/dependency is declared on the buildscript classpath with a version compatible with your Jib plugin version
  3. Remove or disable the pluginExtension block to confirm it is the failing component, then fix or update the extension

Example fix

// before
jib { pluginExtensions { pluginExtension { implementation = 'com.example.OldExtension' } } } // incompatible version
// after
buildscript { dependencies { classpath('com.example:new-extension:2.0') } }
jib { pluginExtensions { pluginExtension { implementation = 'com.example.NewExtension' } } }
Defensive patterns

Strategy: try-catch

Validate before calling

jib.pluginExtensions.each { ext ->
  try { Class.forName(ext.implementation) } catch (ClassNotFoundException e) {
    throw new GradleException("Extension class not on classpath: " + ext.implementation)
  }
}

Try / catch

try { jibBuild.run() } catch (GradleException e) { if (e.message.startsWith('error running extension')) { logger.error("Extension failed: " + e.message); e.cause?.printStackTrace() }; throw e }

Prevention

When it happens

Trigger: Configuring an extension via jibExtension in the plugin config whose plugin is not on the buildscript classpath, the extension class throws internally (e.g. cannot process the project), or the extension API version is incompatible with the Jib plugin version.

Common situations: Using jib { pluginExtensions { pluginExtension { implementation = 'com.example.MyExtension' } } } with a missing dependency, or a Jib extension plugin (like the spring-boot extension) failing on an unexpected project structure or after a Jib version upgrade.

Related errors


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