{"record":{"id":"34ea154f91bb9b08","repo":"GoogleContainerTools/jib","slug":"extradirectories-paths-contain-from-directory-th","errorCode":null,"errorMessage":"extraDirectories.paths contain \"from\" directory that doesn't exist locally: ${path}","messagePattern":"extraDirectories\\.paths contain \"from\" directory that doesn't exist locally: (.+?)","errorType":"validation","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java","lineNumber":185,"sourceCode":"          ex);\n\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 BuildDockerTask setJibExtension(JibExtension jibExtension) {\n    this.jibExtension = jibExtension;\n    return this;\n  }\n}\n","sourceCodeStart":167,"sourceCodeEnd":202,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java#L167-L202","documentation":"The Jib Gradle plugin throws this when an extraDirectories entry points to a local directory path configured as the 'from' location, but that directory does not exist on disk at build time. Jib copies files from these directories into the image, so a missing source directory is treated as a configuration error rather than silently producing an empty layer. It is wrapped in a GradleException with the offending path in the message.","triggerScenarios":"Running any jib task (e.g. gradle jib, jibDockerBuild, buildTar) where jib.extraDirectories.paths contains a path whose 'from' directory does not exist locally, typically after renaming/moving a resources directory or a typo in the path.","commonSituations":"Developers add extraDirectories config referencing 'src/main/jib' variants that were deleted or renamed; CI checkouts missing directories because they are gitignored or generated by a prior step; switching branches where the directory doesn't exist; absolute paths valid on one machine but not another.","solutions":["Create the missing directory at the configured path (e.g. mkdir -p src/main/jib) or commit it to version control.","Fix the path in build.gradle so jib.extraDirectories.points to an existing directory.","Remove the extraDirectories entry if it is no longer needed.","If the directory is generated, ensure the generation task runs before the Jib task (dependsOn)."],"exampleFix":"// before\njib {\n  extraDirectories {\n    paths { path 'src/main/jib-resources' }\n  }\n}\n// after\njib {\n  extraDirectories {\n    paths { path 'src/main/jib' } // directory exists in the project\n  }\n}","handlingStrategy":"validation","validationCode":"def extraDir = 'src/main/jib'\ndef f = file(extraDir)\nif (!f.isDirectory()) throw new GradleException(\"extraDirectories 'from' path does not exist: $extraDir\")","typeGuard":null,"tryCatchPattern":"try {\n  tasks.named('jib').get().execute()\n} catch (GradleException e) {\n  if (e.message?.startsWith('extraDirectories.paths contain')) {\n    logger.error(\"Create or fix the directory named in: ${e.message}\")\n  }\n  throw e\n}","preventionTips":["Commit extra-directories to the repo or create them in a build task before Jib runs.","Use paths relative to the project directory and verify with a CI check.","Avoid absolute paths that differ between machines."],"tags":["gradle","jib","configuration","directory"],"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-14T05:17:10.506Z"}