{"record":{"id":"3992d1d43602fd72","repo":"GoogleContainerTools/jib","slug":"invalid-volume-path-volume","errorCode":null,"errorMessage":"Invalid volume path: + volume","messagePattern":"Invalid volume path: \\+ volume","errorType":"validation","errorClass":"BadContainerConfigurationFormatException","httpStatus":null,"severity":"error","filePath":"jib-core/src/main/java/com/google/cloud/tools/jib/image/json/JsonToImageTranslator.java","lineNumber":271,"sourceCode":"   * {\"/var/log/my-app-logs\":{}}} -> {@code AbsoluteUnixPath().get(\"/var/log/my-app-logs\")}).\n   *\n   * @param volumeMap the map to convert\n   * @return a set of {@link AbsoluteUnixPath}s\n   */\n  @VisibleForTesting\n  static ImmutableSet<AbsoluteUnixPath> volumeMapToSet(\n      @Nullable Map<String, Map<String, String>> volumeMap)\n      throws BadContainerConfigurationFormatException {\n    if (volumeMap == null) {\n      return ImmutableSet.of();\n    }\n\n    ImmutableSet.Builder<AbsoluteUnixPath> volumeList = ImmutableSet.builder();\n    for (String volume : volumeMap.keySet()) {\n      try {\n        volumeList.add(AbsoluteUnixPath.get(volume));\n      } catch (IllegalArgumentException exception) {\n        throw new BadContainerConfigurationFormatException(\"Invalid volume path: \" + volume);\n      }\n    }\n\n    return volumeList.build();\n  }\n\n  private JsonToImageTranslator() {}\n}\n","sourceCodeStart":253,"sourceCodeEnd":280,"githubUrl":"https://github.com/GoogleContainerTools/jib/blob/fb949e2676afbbd7dd7a1ef61e20251931325654/jib-core/src/main/java/com/google/cloud/tools/jib/image/json/JsonToImageTranslator.java#L253-L280","documentation":"Thrown by JsonToImageTranslator.volumeMapToSet when a key in the container configuration's 'volumes' map cannot be parsed as an absolute UNIX path (AbsoluteUnixPath.get throws IllegalArgumentException). Jib requires volume entries to be absolute container paths like '/data'. It surfaces as BadContainerConfigurationFormatException naming the bad path.","triggerScenarios":"A volumes entry that is relative ('data'), empty (''), contains invalid characters, or is a Windows-style path ('C:\\\\data') passed via containerConfiguration.volumes.","commonSituations":"Users mirroring Docker Compose volume syntax with host paths, typos dropping the leading slash, or config generated programmatically with relative path variables.","solutions":["Prefix the volume path with '/' so it is an absolute container path (e.g. '/data').","Remove any host-side or Windows-style path components; only container-internal absolute paths are allowed.","Check for empty strings or trailing whitespace in the volumes keys."],"exampleFix":"// before\nvolumes: \"data\"\n// after\nvolumes: \"/data\"","handlingStrategy":"validation","validationCode":"// validate volume paths before configuring Jib\nfor (String volume : volumesConfig.keySet()) {\n    if (!volume.startsWith(\"/\"))\n        throw new IllegalArgumentException(\"Invalid volume path: \" + volume);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use absolute, POSIX-style container paths ('/data'), never host or relative paths.","Trim whitespace and reject empty strings in volume config before building.","Reuse Jib's AbsoluteUnixPath.get() in your own validation to mirror its rules."],"tags":["docker","container-config","volumes","path"],"backgroundTag":"invalid-argument-format","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"}