{"record":{"id":"59a92c6e023184fa","repo":"GoogleContainerTools/jib","slug":"approot","errorCode":null,"errorMessage":"${appRoot}","messagePattern":"\\$\\{appRoot\\}","errorType":"validation","errorClass":"InvalidAppRootException","httpStatus":null,"severity":"error","filePath":"jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java","lineNumber":869,"sourceCode":"   * @param projectProperties the project properties\n   * @return the app root value\n   * @throws InvalidAppRootException if {@code appRoot} value is not an absolute Unix path\n   */\n  @VisibleForTesting\n  static AbsoluteUnixPath getAppRootChecked(\n      RawConfiguration rawConfiguration, ProjectProperties projectProperties)\n      throws InvalidAppRootException {\n    String appRoot = rawConfiguration.getAppRoot();\n    if (appRoot.isEmpty()) {\n      appRoot =\n          projectProperties.isWarProject()\n              ? DEFAULT_JETTY_APP_ROOT\n              : JavaContainerBuilder.DEFAULT_APP_ROOT;\n    }\n    try {\n      return AbsoluteUnixPath.get(appRoot);\n    } catch (IllegalArgumentException ex) {\n      throw new InvalidAppRootException(appRoot, appRoot, ex);\n    }\n  }\n\n  static ContainerizingMode getContainerizingModeChecked(\n      RawConfiguration rawConfiguration, ProjectProperties projectProperties)\n      throws InvalidContainerizingModeException {\n    ContainerizingMode mode = ContainerizingMode.from(rawConfiguration.getContainerizingMode());\n    if (mode == ContainerizingMode.PACKAGED && projectProperties.isWarProject()) {\n      throw new UnsupportedOperationException(\n          \"packaged containerizing mode for WAR is not yet supported\");\n    }\n    return mode;\n  }\n\n  @VisibleForTesting\n  static Optional<AbsoluteUnixPath> getWorkingDirectoryChecked(RawConfiguration rawConfiguration)\n      throws InvalidWorkingDirectoryException {\n    Optional<String> directory = rawConfiguration.getWorkingDirectory();","sourceCodeStart":851,"sourceCodeEnd":887,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java#L851-L887","documentation":"Jib resolves the appRoot configuration (where the app is placed in the container, e.g. /app) via getAppRootChecked. If appRoot is set but is not a valid absolute Unix path, AbsoluteUnixPath.get fails and Jib throws InvalidAppRootException wrapping the configured value. An empty appRoot falls back to defaults (/app or the Jetty webapps root for WARs), so the error only occurs for non-empty invalid values.","triggerScenarios":"processCommonConfiguration -> getAppRootChecked when rawConfiguration.getAppRoot() is non-empty and AbsoluteUnixPath.get(appRoot) throws IllegalArgumentException (relative path, trailing/invalid characters, Windows path).","commonSituations":"Setting jib.container.appRoot = 'app' (missing leading slash); setting appRoot to a Windows-style path; stray quotes or spaces in the configured value; using a trailing slash segment pattern AbsoluteUnixPath rejects.","solutions":["Prefix the appRoot with '/', e.g. /app instead of app.","Remove invalid characters, quotes, or surrounding whitespace from the appRoot value.","If you actually want the default, clear the value entirely so Jib falls back to /app (or the Jetty default for WAR projects)."],"exampleFix":"// before\njib {\n  container { appRoot = 'myapp' }\n}\n// after\njib {\n  container { appRoot = '/myapp' }\n}","handlingStrategy":"validation","validationCode":"// Validate appRoot before configuring Jib\nif (appRoot != null && !appRoot.isEmpty() && !appRoot.startsWith(\"/\")) {\n  throw new IllegalArgumentException(\"appRoot must be an absolute unix path: \" + appRoot);\n}","typeGuard":null,"tryCatchPattern":"try {\n  processCommonConfiguration(...);\n} catch (InvalidAppRootException e) {\n  logger.error(\"Invalid appRoot '\" + e.getInvalidAppRoot() + \"'; must start with / (default: /app)\");\n}","preventionTips":["Omit appRoot entirely to get the sensible default (/app or Jetty webapps root)","Always use absolute paths starting with '/'","Beware property interpolation: confirm the resolved value at build time with --info/-X logging"],"tags":["container-image","path-validation","java"],"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"}