{"record":{"id":"b62dd5429d0f2e88","repo":"GoogleContainerTools/jib","slug":"container-workingdirectory-is-not-an-absolute-unix-b62dd5","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/BuildImageTask.java","lineNumber":133,"sourceCode":"\n      PluginConfigurationProcessor.createJibBuildRunnerForRegistryImage(\n              new GradleRawConfiguration(jibExtension),\n              ignored -> 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    } 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(\n          \"container.filesModificationTime should be an ISO 8601 date-time (see \"","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java#L115-L151","documentation":"container.workingDirectory must be an absolute Unix-style path (e.g. /workspace) because it becomes the WORKDIR in the image. Jib throws InvalidWorkingDirectoryException when the configured value is relative or not a Unix path, and the Gradle task wraps it in this GradleException.","triggerScenarios":"Setting jib.container.workingDirectory to a relative path ('workspace'), an empty string, or a Windows-style path, then running any jib build task.","commonSituations":"Windows developers entering 'C:\\\\workdir' or backslash paths; forgetting the leading slash; copying Dockerfile WORKDIR syntax with relative paths; programmatic plugin usage passing null-like or relative values from another config source.","solutions":["Use a fully qualified Unix path with a leading slash, e.g. workingDirectory = '/app'.","Remove workingDirectory to fall back to Jib's default work directory.","Normalize any Windows path input in scripts that generate the config."],"exampleFix":"// before\njib {\n  container { workingDirectory = 'workspace' }\n}\n// after\njib {\n  container { workingDirectory = '/workspace' }\n}","handlingStrategy":"validation","validationCode":"def wd = jib.container.workingDirectory\nif (wd != null && !(wd ==~ '^/[A-Za-z0-9._/-]+$')) {\n  throw new GradleException(\"workingDirectory must be an absolute Unix path, got: $wd\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  tasks.named('jib').get().execute()\n} catch (GradleException e) {\n  if (e.message?.startsWith('container.workingDirectory is not')) {\n    logger.error(\"Fix workingDirectory (must start with '/'): ${e.message}\")\n  }\n  throw e\n}","preventionTips":["Use leading-slash Unix paths for any Docker-image path setting.","Skip Windows drive letters even when building on Windows hosts.","Keep workingDirectory defined in one shared build script."],"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"}