{"record":{"id":"80d0735b12b8b171","repo":"GoogleContainerTools/jib","slug":"container-workingdirectory-is-not-an-absolute-unix","errorCode":null,"errorMessage":"container.workingDirectory is not an absolute Unix-style path: ${invalidPathValue}","messagePattern":"container\\.workingDirectory is not an absolute Unix-style path: (.+?)","errorType":"validation","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java","lineNumber":137,"sourceCode":"\n      PluginConfigurationProcessor.createJibBuildRunnerForDockerDaemonImage(\n              new GradleRawConfiguration(jibExtension),\n              ignored -> java.util.Optional.empty(),\n              projectProperties,\n              globalConfig,\n              new GradleHelpfulSuggestions(HELPFUL_SUGGESTIONS_PREFIX))\n          .runBuild();\n\n    } catch (InvalidAppRootException ex) {\n      throw new GradleException(\n          \"container.appRoot is not an absolute Unix-style path: \" + ex.getInvalidPathValue(), ex);\n\n    } catch (InvalidContainerizingModeException ex) {\n      throw new GradleException(\n          \"invalid value for containerizingMode: \" + ex.getInvalidContainerizingMode(), ex);\n\n    } catch (InvalidWorkingDirectoryException ex) {\n      throw new GradleException(\n          \"container.workingDirectory is not an absolute Unix-style path: \"\n              + ex.getInvalidPathValue(),\n          ex);\n\n    } catch (InvalidPlatformException ex) {\n      throw new GradleException(\n          \"from.platforms contains a platform configuration that is missing required values or has invalid values: \"\n              + ex.getMessage()\n              + \": \"\n              + ex.getInvalidPlatform(),\n          ex);\n\n    } catch (InvalidContainerVolumeException ex) {\n      throw new GradleException(\n          \"container.volumes is not an absolute Unix-style path: \" + ex.getInvalidVolume(), ex);\n\n    } catch (InvalidFilesModificationTimeException ex) {\n      throw new GradleException(","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildDockerTask.java#L119-L155","documentation":"Thrown when container.workingDirectory is not an absolute Unix-style path. Jib validates that the working directory configured for the container's runtime starts with '/' and contains no Windows-style components. The invalid value is included in the GradleException message.","triggerScenarios":"Setting workingDirectory in jib { container { ... } } to a relative path like 'home/user', a Windows path like 'C:\\workdir', or an empty/garbage string.","commonSituations":"Copying Dockerfile WORKDIR conventions incorrectly, Windows-development machine path habits leaking into build configs, or typos dropping the leading slash.","solutions":["Use an absolute Unix path, e.g. workingDirectory = \"/home/myapp\"","Remove drive letters and backslashes","Ensure the value is non-empty and starts with '/'"],"exampleFix":"// before\njib { container { workingDirectory = 'workdir' } }\n// after\njib { container { workingDirectory = '/workdir' } }","handlingStrategy":"validation","validationCode":"def wd = jib.container.workingDirectory\nif (wd != null && !wd.startsWith('/')) {\n  throw new GradleException(\"workingDirectory must be absolute Unix path, got: $wd\")\n}","typeGuard":null,"tryCatchPattern":"try { jibBuild.run() } catch (GradleException e) { if (e.message.contains('workingDirectory')) { logger.error(e.message) }; throw e }","preventionTips":["Always use absolute Unix-style working directories","Strip drive letters/backslashes from configs shared across OSes","Model paths after Dockerfile WORKDIR conventions (absolute only)"],"tags":["gradle","jib","configuration","path-validation"],"backgroundTag":"invalid-config-value","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"}