{"record":{"id":"00312d0c6fed920f","repo":"Tencent/WeKnora","slug":"http-marshal-list-engines-request-w","errorCode":null,"errorMessage":"http marshal list-engines request: %w","messagePattern":"http marshal list-engines request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/http_parser.go","lineNumber":140,"sourceCode":"}\n\ntype httpListEnginesResponse struct {\n\tEngines []httpParserEngineInfo `json:\"engines\"`\n}\n\nfunc (p *HTTPDocumentReader) ListEngines(ctx context.Context, overrides map[string]string) ([]types.ParserEngineInfo, error) {\n\tbase := p.base()\n\tif base == \"\" {\n\t\treturn nil, errNotConnected\n\t}\n\tif err := secutils.ValidateURLForSSRF(base); err != nil {\n\t\treturn nil, fmt.Errorf(\"docreader address failed SSRF validation: %w\", err)\n\t}\n\n\tbody := httpListEnginesRequest{ConfigOverrides: overrides}\n\tjsonBody, err := json.Marshal(body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http marshal list-engines request: %w\", err)\n\t}\n\n\thttpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, base+PathListEngines, bytes.NewReader(jsonBody))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http new request: %w\", err)\n\t}\n\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := p.client.Do(httpReq)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"http list-engines failed: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\trespBytes, _ := io.ReadAll(resp.Body)\n\t\treturn nil, fmt.Errorf(\"http list-engines status %d: %s\", resp.StatusCode, string(respBytes))\n\t}\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/http_parser.go#L122-L158","documentation":"json.Marshal of the HTTP docreader list-engines request body (config overrides map) failed in HTTPDocumentReader.ListEngines. Practically unreachable for plain maps; indicates a non-serializable override value.","triggerScenarios":"Thrown at internal/infrastructure/docparser/http_parser.go:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure config overrides are string-keyed, serializable values","Log the marshal error to find the offending override","Validate overrides before calling ListEngines"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}