{"record":{"id":"addb57a3109aa874","repo":"GoogleContainerTools/jib","slug":"extradirectories-paths-contain-from-directory-th-addb57","errorCode":null,"errorMessage":"extraDirectories.paths contain \"from\" directory that doesn't exist locally: ${ex.getPath()}","messagePattern":"extraDirectories\\.paths contain \"from\" directory that doesn't exist locally: (.+?)","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildTarTask.java","lineNumber":203,"sourceCode":"\n    } catch (JibPluginExtensionException ex) {\n      String extensionName = ex.getExtensionClass().getName();\n      throw new GradleException(\n          \"error running extension '\" + extensionName + \"': \" + ex.getMessage(), ex);\n\n    } catch (IncompatibleBaseImageJavaVersionException ex) {\n      throw new GradleException(\n          HelpfulSuggestions.forIncompatibleBaseImageJavaVersionForGradle(\n              ex.getBaseImageMajorJavaVersion(), ex.getProjectMajorJavaVersion()),\n          ex);\n\n    } catch (InvalidImageReferenceException ex) {\n      throw new GradleException(\n          HelpfulSuggestions.forInvalidImageReference(ex.getInvalidReference()), ex);\n\n    } catch (ExtraDirectoryNotFoundException ex) {\n      throw new GradleException(\n          \"extraDirectories.paths contain \\\"from\\\" directory that doesn't exist locally: \"\n              + ex.getPath(),\n          ex);\n    } finally {\n      tempDirectoryProvider.close();\n      TaskCommon.finishUpdateChecker(projectProperties, updateCheckFuture);\n      projectProperties.waitForLoggingThread();\n    }\n  }\n\n  @Override\n  public BuildTarTask setJibExtension(JibExtension jibExtension) {\n    this.jibExtension = jibExtension;\n    return this;\n  }\n}\n","sourceCodeStart":185,"sourceCodeEnd":219,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildTarTask.java#L185-L219","documentation":"BuildTarTask.buildTar catches ExtraDirectoryNotFoundException and throws a GradleException stating that an extraDirectories.paths entry with a 'from' directory does not exist locally. Jib validates extra-layer source directories before building and aborts when a configured source path is missing.","triggerScenarios":"Configuring jib { extraDirectories { paths { path { from = file('src/main/jib-custom') } } } } where that 'from' directory does not exist on disk when the jibBuildTar task runs.","commonSituations":"Directory renamed or deleted; path only generated by another task that did not run (task ordering); CI checkout excludes the directory; relative path resolved against the wrong project/module directory in multi-project builds.","solutions":["Create the missing 'from' directory or correct the path in extraDirectories.paths","Ensure any task that generates the directory runs before the jib task (e.g. make jibBuildTar dependOn it)","In multi-module builds, verify the path is relative to the correct project's directory or use an absolute path via project.file(...)"],"exampleFix":"// before\njib { extraDirectories { paths { path { from = file('src/main/jib-extra') } } } } // directory absent\n// after: create src/main/jib-extra, or point to an existing dir\njib { extraDirectories { paths { path { from = file('src/main/jib') } } } }","handlingStrategy":"validation","validationCode":"def extraDir = file('src/main/jib-extra')\nif (!extraDir.isDirectory()) throw new GradleException(\"extra dir missing: $extraDir\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit extra-directory sources to version control or create them in an init task","Wire task dependencies so generating tasks run before jib tasks","Use project.file(...) so paths resolve against the right project directory in multi-module builds"],"tags":["jib","gradle","file-not-found","configuration"],"backgroundTag":"directory-not-found","analyzedSha":"fb949e2676afbbd7dd7a1ef61e20251931325654","analyzedAt":"2026-09-06T14:04:09.491Z","contentChangedAt":"2026-09-06T14:04:09.491Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}