{"record":{"id":"d9c2ac29986b50a4","repo":"AlexxIT/go2rtc","slug":"login-failed-v","errorCode":null,"errorMessage":"login failed: %v","messagePattern":"login failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"internal/tuya/tuya.go","lineNumber":54,"sourceCode":"\n\tvar tuyaRegion *tuya.Region\n\tfor _, r := range tuya.AvailableRegions {\n\t\tif r.Host == region {\n\t\t\ttuyaRegion = &r\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif tuyaRegion == nil {\n\t\thttp.Error(w, fmt.Sprintf(\"invalid region: %s\", region), http.StatusBadRequest)\n\t\treturn\n\t}\n\n\thttpClient := tuya.CreateHTTPClientWithSession()\n\n\t_, err := login(httpClient, tuyaRegion.Host, email, password, tuyaRegion.Continent)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"login failed: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\ttuyaAPI, err := tuya.NewTuyaSmartApiClient(\n\t\thttpClient,\n\t\ttuyaRegion.Host,\n\t\temail,\n\t\tpassword,\n\t\t\"\",\n\t)\n\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tvar devices []tuya.Device\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/tuya/tuya.go#L36-L72","documentation":"HTTP 500 returned by the Tuya auth API handler when the email/password login against the selected regional Tuya host fails (invalid credentials, region mismatch, or network error), with the login error embedded in the response text.","triggerScenarios":"Thrown at internal/tuya/tuya.go:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify email/password and region","Retry on transient network failures","Inspect the wrapped cause for the specific auth step that failed"],"exampleFix":null,"handlingStrategy":"retry","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"}