{"record":{"id":"087f555bff894174","repo":"netbirdio/netbird","slug":"doing-request-failed-with-error-v","errorCode":null,"errorMessage":"doing request failed with error: %v","messagePattern":"doing request failed with error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/internal/auth/device_flow.go","lineNumber":155,"sourceCode":"\td.providerConfig.LoginHint = hint\n}\n\n// RequestAuthInfo requests a device code login flow information from Hosted\nfunc (d *DeviceAuthorizationFlow) RequestAuthInfo(ctx context.Context) (AuthFlowInfo, error) {\n\tform := url.Values{}\n\tform.Add(\"client_id\", d.providerConfig.ClientID)\n\tform.Add(\"audience\", d.providerConfig.Audience)\n\tform.Add(\"scope\", d.providerConfig.Scope)\n\treq, err := http.NewRequest(\"POST\", d.providerConfig.DeviceAuthEndpoint,\n\t\tstrings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn AuthFlowInfo{}, fmt.Errorf(\"creating request failed with error: %v\", err)\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\tres, err := d.HTTPClient.Do(req)\n\tif err != nil {\n\t\treturn AuthFlowInfo{}, fmt.Errorf(\"doing request failed with error: %v\", err)\n\t}\n\n\tdefer res.Body.Close()\n\tbody, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn AuthFlowInfo{}, fmt.Errorf(\"reading body failed with error: %v\", err)\n\t}\n\n\tif res.StatusCode != 200 {\n\t\treturn AuthFlowInfo{}, fmt.Errorf(\"request device code returned status %d error: %s\", res.StatusCode, string(body))\n\t}\n\n\tdeviceCode := AuthFlowInfo{}\n\terr = json.Unmarshal(body, &deviceCode)\n\tif err != nil {\n\t\treturn AuthFlowInfo{}, fmt.Errorf(\"unmarshaling response failed with error: %v\", err)\n\t}\n","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/internal/auth/device_flow.go#L137-L173","documentation":"Error \"doing request failed with error: %v\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/internal/auth/device_flow.go:155 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":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}