{"record":{"id":"ca3a90538d8ba918","repo":"GoogleContainerTools/jib","slug":"extradirectories-paths-contain-from-directory-th-ca3a90","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/BuildImageTask.java","lineNumber":182,"sourceCode":"    } 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 BuildImageTask setJibExtension(JibExtension jibExtension) {\n    this.jibExtension = jibExtension;\n    return this;\n  }\n}\n","sourceCodeStart":164,"sourceCodeEnd":197,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java#L164-L197","documentation":"Jib throws ExtraDirectoryNotFoundException when a directory configured under jib.extraDirectories.paths has a 'from' path that does not exist on the local filesystem, aborting the build before layer creation. The Gradle task wraps it in a GradleException naming the missing path.","triggerScenarios":"Running gradle jib/jibBuild/DockerBuild with jib { extraDirectories { paths { path { from = 'some/dir' } } } } where 'some/dir' (or a default src/main/jib directory configured with an explicit from) does not exist locally.","commonSituations":"Renaming or deleting a resources directory without updating build.gradle; wrong working directory when running Gradle; CI checkout missing the extra directory (not committed or generated by an earlier step that was skipped); typos in the path.","solutions":["Create the missing directory or fix the path in jib.extraDirectories.paths so it points at an existing directory","Commit/generate the extra directory in CI before running jib (e.g. a resources-generation step)","Remove the extraDirectories block entirely if the extra files are no longer needed","If only a 'to' destination inside the image is wanted, set 'to' but ensure 'from' still exists locally"],"exampleFix":"// before\njib { extraDirectories { paths { path { from = 'src/main/extra-jib' } } } } // dir deleted\n// after\njib { extraDirectories { paths { path { from = 'src/main/jib' } } } } // dir exists in repo","handlingStrategy":"validation","validationCode":"def extraFrom = 'src/main/jib'\ndef f = file(extraFrom)\nif (!f.exists()) throw new GradleException(\"Extra directory missing: $extraFrom\")\nif (!f.isDirectory()) throw new GradleException(\"Extra directory is not a directory: $extraFrom\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit extra directories to source control or generate them in an earlier task wired with dependsOn","Re-check extraDirectories paths after refactoring project layout","Use relative paths anchored to the project directory in CI"],"tags":["jib","gradle","file-not-found","extra-directories"],"backgroundTag":"file-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"}