{"record":{"id":"b052f8effd8e8299","repo":"GoogleContainerTools/jib","slug":"container-approot-is-not-an-absolute-unix-style-pa-b052f8","errorCode":null,"errorMessage":"container.appRoot is not an absolute Unix-style path: ${invalidPathValue}","messagePattern":"container\\.appRoot 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":125,"sourceCode":"      if (Strings.isNullOrEmpty(jibExtension.getTo().getImage())) {\n        throw new GradleException(\n            HelpfulSuggestions.forToNotConfigured(\n                \"Missing target image parameter\",\n                \"'jib.to.image'\",\n                \"build.gradle\",\n                \"gradle jib --image <your image name>\"));\n      }\n\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);","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/BuildImageTask.java#L107-L143","documentation":"The Jib Gradle plugin validates that container.appRoot is an absolute Unix-style path (e.g. /app) because it is used as the destination directory for application files inside the image. InvalidAppRootException is thrown when the value is relative, Windows-style, or otherwise not an absolute Unix path, and the task rethrows it as this GradleException.","triggerScenarios":"Setting jib.container.appRoot to a relative path like 'app' or 'C:\\\\app' (or a Windows drive path) and running any jib build task.","commonSituations":"Developers on Windows copying example config with backslashes; forgetting the leading slash ('app' instead of '/app'); migrating from another plugin where appRoot was relative; setting appRoot for WAR-style layouts to a path with a trailing filename expectation.","solutions":["Prefix the value with a forward slash, e.g. appRoot = '/app'.","Remove any Windows-style path (drive letter, backslashes) and use a Unix path.","If unsure, remove appRoot entirely to use Jib's default."],"exampleFix":"// before\njib {\n  container { appRoot = 'app' }\n}\n// after\njib {\n  container { appRoot = '/app' }\n}","handlingStrategy":"validation","validationCode":"def appRoot = jib.container.appRoot\nif (appRoot != null && !(appRoot ==~ '^/[A-Za-z0-9._/-]+$')) {\n  throw new GradleException(\"container.appRoot must be an absolute Unix path, got: $appRoot\")\n}","typeGuard":null,"tryCatchPattern":"try {\n  tasks.named('jib').get().execute()\n} catch (GradleException e) {\n  if (e.message?.startsWith('container.appRoot is not')) {\n    logger.error(\"Fix appRoot (must start with '/'): ${e.message}\")\n  }\n  throw e\n}","preventionTips":["Always include the leading slash in appRoot.","Never use Windows drive letters or backslashes in image paths.","Centralize the appRoot value in one convention plugin to avoid divergence."],"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-14T00:17:10.932Z"}