{"record":{"id":"7c3fdac75d8ee668","repo":"AlexxIT/go2rtc","slug":"tapo-wrond-status-res-status","errorCode":null,"errorMessage":"tapo: wrond status: ${res.Status}","messagePattern":"tapo: wrond status: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/tapo/client.go","lineNumber":327,"sourceCode":"\t}\n\n\tif err = req.Write(conn); err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tr := bufio.NewReader(conn)\n\n\tres, err := http.ReadResponse(r, req)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\t_, _ = io.Copy(io.Discard, res.Body) // discard leftovers\n\t_ = res.Body.Close()                 // ignore response body\n\n\tauth := res.Header.Get(\"WWW-Authenticate\")\n\n\tif res.StatusCode != http.StatusUnauthorized || !strings.HasPrefix(auth, \"Digest\") {\n\t\treturn nil, nil, errors.New(\"tapo: wrond status: \" + res.Status)\n\t}\n\n\tif brand == \"tapo\" && password == \"\" {\n\t\t// support cloud password in place of username\n\t\tif strings.Contains(auth, `encrypt_type=\"3\"`) {\n\t\t\tpassword = fmt.Sprintf(\"%32X\", sha256.Sum256([]byte(username)))\n\t\t} else {\n\t\t\tpassword = fmt.Sprintf(\"%16X\", md5.Sum([]byte(username)))\n\t\t}\n\t\tusername = \"admin\"\n\t} else if brand == \"vigi\" && username == \"admin\" {\n\t\tpassword = securityEncode(password)\n\t}\n\n\trealm := tcp.Between(auth, `realm=\"`, `\"`)\n\tnonce := tcp.Between(auth, `nonce=\"`, `\"`)\n\tqop := tcp.Between(auth, `qop=\"`, `\"`)\n\turi := req.URL.RequestURI()","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/tapo/client.go#L309-L345","documentation":"Tapo dial guard: the preliminary request did not return the expected 401 with a Digest WWW-Authenticate challenge (status appended, note the source typo 'wrond'). Tapo cameras are expected to demand Digest auth; getting 200/403/anything else means the endpoint or firmware behaves differently, so credentials cannot be negotiated.","triggerScenarios":"Thrown at pkg/tapo/client.go:327 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the URL hits the camera's stream endpoint ('/stream0' style paths)","Check firmware — non-Tapo devices on the same protocol may not use Digest","Handle 403 by confirming device time/credentials, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","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-15T23:17:13.987Z"}