{"record":{"id":"1d5c92bd15dea829","repo":"caddyserver/caddy","slug":"path-missing","errorCode":null,"errorMessage":"path missing","messagePattern":"path missing","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"admin.go","lineNumber":1185,"sourceCode":"\t\terr = json.Unmarshal(body, &val)\n\t\tif err != nil {\n\t\t\tif jsonErr, ok := err.(*json.SyntaxError); ok {\n\t\t\t\treturn fmt.Errorf(\"decoding request body: %w, at offset %d\", jsonErr, jsonErr.Offset)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"decoding request body: %w\", err)\n\t\t}\n\t}\n\n\tenc := json.NewEncoder(out)\n\n\tcleanPath := strings.Trim(path, \"/\")\n\tif cleanPath == \"\" {\n\t\treturn fmt.Errorf(\"no traversable path\")\n\t}\n\n\tparts := strings.Split(cleanPath, \"/\")\n\tif len(parts) == 0 {\n\t\treturn fmt.Errorf(\"path missing\")\n\t}\n\n\t// A path that ends with \"...\" implies:\n\t// 1) the part before it is an array\n\t// 2) the payload is an array\n\t// and means that the user wants to expand the elements\n\t// in the payload array and append each one into the\n\t// destination array, like so:\n\t//     array = append(array, elems...)\n\t// This special case is handled below.\n\tellipses := parts[len(parts)-1] == \"...\"\n\tif ellipses {\n\t\tparts = parts[:len(parts)-1]\n\t}\n\n\tvar ptr any = rawCfg\n\ntraverseLoop:","sourceCodeStart":1167,"sourceCodeEnd":1203,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/admin.go#L1167-L1203","documentation":"Defensive check in unsyncedConfigAccess after splitting the trimmed path on '/': strings.Split never returns a zero-length slice for any input, so 'path missing' is effectively unreachable in practice. It exists purely as a guard against future changes to the trimming/splitting logic.","triggerScenarios":"Not reachable through any current code path: strings.Split on any string (including \"\") returns at least one element, and the empty case is already rejected by the 'no traversable path' check above.","commonSituations":"Should never appear. If it does, the file has been modified locally or a fork changed the split logic.","solutions":["If you genuinely see this, verify you are running stock Caddy and not a patched build","Report it upstream with the exact request that produced it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"If this impossible error appears, log the full request and check for a patched/non-standard build before debugging anything else.","preventionTips":["Run stock releases of Caddy for admin API work","Treat sightings as a code-integrity signal, not a usage error"],"tags":["caddy","admin-api","config","internal","defensive"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}