{"record":{"id":"b41499ff189a22d8","repo":"AlexxIT/go2rtc","slug":"failed-to-unmarshal-devices-response-w","errorCode":null,"errorMessage":"failed to unmarshal devices response: %w","messagePattern":"failed to unmarshal devices response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/ring/api.go","lineNumber":345,"sourceCode":"\t}\n\n\t// Refresh the cached client\n\tcacheMutex.Lock()\n\tclientCache[c.cacheKey] = c\n\tcacheMutex.Unlock()\n\n\treturn c.authToken, nil\n}\n\nfunc (c *RingApi) FetchRingDevices() (*RingDevicesResponse, error) {\n\tresponse, err := c.Request(\"GET\", ClientAPI(\"ring_devices\"), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to fetch ring devices: %w\", err)\n\t}\n\n\tvar devices RingDevicesResponse\n\tif err := json.Unmarshal(response, &devices); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to unmarshal devices response: %w\", err)\n\t}\n\n\t// Process \"other\" devices\n\tvar onvifCameras []CameraData\n\tvar intercoms []CameraData\n\n\tfor _, device := range devices.Other {\n\t\tkind, ok := device[\"kind\"].(string)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\n\t\tswitch RingDeviceType(kind) {\n\t\tcase OnvifCameraType:\n\t\t\tvar camera CameraData\n\t\t\tif deviceJson, err := json.Marshal(device); err == nil {\n\t\t\t\tif err := json.Unmarshal(deviceJson, &camera); err == nil {\n\t\t\t\t\tonvifCameras = append(onvifCameras, camera)","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/ring/api.go#L327-L363","documentation":"The ring_devices response was received but json.Unmarshal into RingDevicesResponse failed, so the payload is malformed or has an unexpected schema. Wraps the unmarshal error; no device data is returned.","triggerScenarios":"Thrown at pkg/ring/api.go:345 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry in case of a truncated response","Update RingDevicesResponse fields to match the current Ring API schema"],"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"}