{"record":{"id":"97893172fce1faff","repo":"netbirdio/netbird","slug":"failed-to-create-request-access-token-v","errorCode":null,"errorMessage":"failed to create request access token: %v","messagePattern":"failed to create request access token: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/internal/auth/device_flow.go","lineNumber":215,"sourceCode":"\t\treturn uri\n\t}\n\n\tquery := parsedURL.Query()\n\tquery.Set(\"login_hint\", loginHint)\n\tparsedURL.RawQuery = query.Encode()\n\n\treturn parsedURL.String()\n}\n\nfunc (d *DeviceAuthorizationFlow) requestToken(info AuthFlowInfo) (TokenRequestResponse, error) {\n\tform := url.Values{}\n\tform.Add(\"client_id\", d.providerConfig.ClientID)\n\tform.Add(\"grant_type\", HostedGrantType)\n\tform.Add(\"device_code\", info.DeviceCode)\n\n\treq, err := http.NewRequest(\"POST\", d.providerConfig.TokenEndpoint, strings.NewReader(form.Encode()))\n\tif err != nil {\n\t\treturn TokenRequestResponse{}, fmt.Errorf(\"failed to create request access token: %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 TokenRequestResponse{}, fmt.Errorf(\"failed to request access token with error: %v\", err)\n\t}\n\n\tdefer func() {\n\t\terr := res.Body.Close()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t}()\n\n\tbody, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn TokenRequestResponse{}, fmt.Errorf(\"failed reading access token response body with error: %v\", err)","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/internal/auth/device_flow.go#L197-L233","documentation":"Error \"failed to create request access token: %v\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/internal/auth/device_flow.go:215 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"}