{"record":{"id":"5b2d4e93725c47e7","repo":"AlexxIT/go2rtc","slug":"wyze-login-failed-code-s-s","errorCode":null,"errorMessage":"wyze: login failed (code %s): %s","messagePattern":"wyze: login failed \\(code (.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/wyze/cloud.go","lineNumber":128,"sourceCode":"\treq.Header.Set(\"Apikey\", c.apiKey)\n\treq.Header.Set(\"Keyid\", c.keyID)\n\treq.Header.Set(\"User-Agent\", \"go2rtc\")\n\n\tresp, err := c.client.Do(req)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar errResp apiError\n\t_ = json.Unmarshal(body, &errResp)\n\tif errResp.hasError() {\n\t\treturn fmt.Errorf(\"wyze: login failed (code %s): %s\", errResp.code(), errResp.message())\n\t}\n\n\tvar result loginResponse\n\tif err := json.Unmarshal(body, &result); err != nil {\n\t\treturn fmt.Errorf(\"wyze: failed to parse login response: %w\", err)\n\t}\n\n\tif len(result.MFAOptions) > 0 {\n\t\treturn &AuthError{\n\t\t\tMessage:  \"MFA required\",\n\t\t\tNeedsMFA: true,\n\t\t\tMFAType:  strings.Join(result.MFAOptions, \",\"),\n\t\t}\n\t}\n\n\tif result.AccessToken == \"\" {\n\t\treturn errors.New(\"wyze: no access token in response\")\n\t}","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/wyze/cloud.go#L110-L146","documentation":"The Wyze cloud login API responded with an error payload (apiError.hasError), so authentication was rejected — e.g. wrong credentials, expired token, or account issues. Includes the API's error code and message; raised in Login, also reachable via LoginWithCaptcha.","triggerScenarios":"Thrown at pkg/wyze/cloud.go:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify email/password and API key/id","Handle MFA via LoginWithCaptcha/LoginWithVerify when required","Retry after rate limiting clears"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c245815e75e2a5fd60b4290f12bfc04e55a984d3","analyzedAt":"2026-09-07T11:47:02.965Z","contentChangedAt":"2026-09-07T11:47:02.965Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}