{"record":{"id":"3d42d9ddf576cdaf","repo":"ipfs/kubo","slug":"invalid-request-path-s","errorCode":null,"errorMessage":"invalid request path '%s'","messagePattern":"invalid request path '(.+?)'","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"core/corehttp/p2p_proxy.go","lineNumber":66,"sourceCode":"\t}\n}\n\ntype proxyRequest struct {\n\ttarget   string\n\tname     protocol.ID\n\thttpPath string // path to send to the proxy-host\n}\n\n// from the url path parse the peer-ID, name and http path\n// /p2p/$peer_id/http/$http_path\n// or\n// /p2p/$peer_id/x/$protocol/http/$http_path\nfunc parseRequest(request *http.Request) (*proxyRequest, error) {\n\tpath := request.URL.Path\n\n\tsplit := strings.SplitN(path, \"/\", 5)\n\tif len(split) < 5 {\n\t\treturn nil, fmt.Errorf(\"invalid request path '%s'\", path)\n\t}\n\n\tif _, err := peer.Decode(split[2]); err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid request path '%s'\", path)\n\t}\n\n\tif split[3] == \"http\" {\n\t\treturn &proxyRequest{split[2], protocol.ID(\"/http\"), split[4]}, nil\n\t}\n\n\tsplit = strings.SplitN(path, \"/\", 7)\n\tif len(split) < 7 || split[3] != \"x\" || split[5] != \"http\" {\n\t\treturn nil, fmt.Errorf(\"invalid request path '%s'\", path)\n\t}\n\n\treturn &proxyRequest{split[2], protocol.ID(\"/x/\" + split[4] + \"/http\"), split[6]}, nil\n}\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/corehttp/p2p_proxy.go#L48-L84","documentation":"The libp2p HTTP proxy gateway could not parse the request URL into peer ID, protocol name and inner HTTP path. It fires when the path has too few segments or the peer-ID segment does not decode, i.e. it does not match /p2p/<peerid>/http/<path> or /p2p/<peerid>/x/<proto>/http/<path>.","triggerScenarios":"Thrown at core/corehttp/p2p_proxy.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the documented forms: /p2p/<peerID>/http/<path> or /p2p/<peerID>/x/<protocol>/http/<path>","Verify the peer ID segment is a valid multibase peer ID (starts with 12D3KooW, Qm..., etc.)","Ensure the listener was started with 'ipfs p2p listen' or that the target peer supports the protocol"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}