{"record":{"id":"f8dd9cdf3a7a375b","repo":"googleapis/mcp-toolbox","slug":"error-reading-response-body-url-v-err-v","errorCode":null,"errorMessage":"error reading response body: url: [%v], err: [%v]","messagePattern":"error reading response body: url: \\[(.+?)\\], err: \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/sources/dgraph/dgraph.go","lineNumber":262,"sourceCode":"\t\treturn nil, fmt.Errorf(\"error performing HTTP request: %w\", err)\n\t} else if err != nil && strings.Contains(err.Error(), \"Token is expired\") {\n\t\tif errLogin := hc.loginWithToken(); errLogin != nil {\n\t\t\treturn nil, errLogin\n\t\t}\n\t\tif hc.HttpToken != nil {\n\t\t\treq.Header.Add(\"X-Dgraph-AccessToken\", hc.AccessJwt)\n\t\t}\n\t\tresp, err = hc.httpClient.Do(req)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tdefer resp.Body.Close()\n\n\trespBody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading response body: url: [%v], err: [%v]\", req.URL, err)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"got non 200 resp: %v\", string(respBody))\n\t}\n\n\treturn respBody, nil\n}\n\nfunc (hc *DgraphClient) loginWithCredentials() error {\n\tcredentials := map[string]interface{}{\n\t\t\"userid\":    hc.UserId,\n\t\t\"password\":  hc.Password,\n\t\t\"namespace\": hc.Namespace,\n\t}\n\treturn hc.doLogin(credentials)\n}\n\nfunc (hc *DgraphClient) loginWithToken() error {","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/sources/dgraph/dgraph.go#L244-L280","documentation":"Error \"error reading response body: url: [%v], err: [%v]\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/sources/dgraph/dgraph.go:262 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}