GoogleContainerTools/jib · error · GradleException
error running extension '${extensionName}': ${ex.getMessage(
Error message
error running extension '${extensionName}': ${ex.getMessage()} What it means
When a Jib plugin extension (JibPluginExtensionException) fails during jibBuildTar, BuildTarTask.buildTar rethrows it as a GradleException with the extension class' fully-qualified name and the extension's own message. This means a Jib extension (e.g. jib-spring-boot or a custom build-plan modifier) threw while computing or applying its container build plan.
Source
Thrown at jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildTarTask.java:188
} 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
- Read the wrapped extension message in the cause ('Caused by') and fix the project/config issue it describes
- Remove or disable the pluginExtension configuration if it is not needed (e.g. jib-spring-boot on a non-Boot project)
- Check the extension's documentation for prerequisites (required tasks, artifacts, Jib API version) and update the extension/Jib to compatible versions
Example fix
// before (non-Boot project with spring-boot extension configured)
jib { pluginExtensions { pluginExtension { implementation = 'com.google.cloud.tools.jib.gradle.extension.springboot.JibSpringBootExtension' } } }
// after: remove the pluginExtension block, or make the project a Spring Boot application so bootJar exists Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure prerequisites exist before running jib with extensions
tasks.named('jibBuildTar') { dependsOn tasks.named('jar') } Try / catch
try {
tasks.named('jibBuildTar')
} catch (GradleException e) {
if (e.message.startsWith('error running extension')) {
logger.error('Extension failed: ' + e.cause?.message)
// fall back to a build without the extension or rethrow with context
} else throw e
} Prevention
- Only register extensions whose documented prerequisites (tasks, plugins, project layout) your project satisfies
- Keep jib-gradle-plugin and extensions on compatible versions
- Test extension-enabled builds in CI before relying on them
When it happens
Trigger: Running a jib task with a pluginExtension configured whose extend() implementation (or a Jib-provided extension) throws a JibPluginExtensionException; the exception message is propagated verbatim into 'error running extension <FQCN>: <message>'.
Common situations: Using jib-spring-boot against a project that is not a Spring Boot app (no bootJar artifacts); a third-party extension with a bug or incompatible Jib version; extension fails because the project layout does not match its assumptions.
Related errors
- invalid base image reference: ${buildPlan.getBaseImage()}
- extension ${extension.getClass().getSimpleName()} does not e
- extension crashed: ${ex.getMessage()}
- container.appRoot is not an absolute Unix-style path: ${inva
- invalid value for containerizingMode: ${invalidContainerizin
AI-assisted analysis of GoogleContainerTools/jib@fb949e2676 (2026-09-06).
Data as JSON: /api/errors/a400efe48bd3d33c.
Report an issue: GitHub.