{"record":{"id":"8640c9af65ccf999","repo":"AlexxIT/go2rtc","slug":"yandex-can-t-get-snapshot-url-for-device-s","errorCode":null,"errorMessage":"yandex: can't get snapshot url for device: %s","messagePattern":"yandex: can't get snapshot url for device: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yandex/session.go","lineNumber":153,"sourceCode":"\tfor _, household := range data.Households {\n\t\tdevices = append(devices, household.All...)\n\t}\n\treturn devices, nil\n}\n\nfunc (s *Session) GetSnapshotURL(deviceID string) (string, error) {\n\tdevices, err := s.GetDevices()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tfor _, device := range devices {\n\t\tif device.Id == deviceID {\n\t\t\treturn device.Parameters.SnapshotUrl, nil\n\t\t}\n\t}\n\n\treturn \"\", errors.New(\"yandex: can't get snapshot url for device: \" + deviceID)\n}\n\nfunc (s *Session) WebrtcCreateRoom(deviceID string) (*Room, error) {\n\tcsrf, err := s.GetCSRF()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq, err := http.NewRequest(\n\t\t\"POST\", \"https://iot.quasar.yandex.ru/m/v3/user/devices/\"+deviceID+\"/webrtc/create-room\",\n\t\tstrings.NewReader(`{\"protocol\":\"whip\"}`),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"X-CSRF-Token\", csrf)","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/yandex/session.go#L135-L171","documentation":"Yandex GetSnapshotURL guard: the deviceID was not found among any household's devices returned by GetDevices (device id appended). Either the ID is wrong, the device is not shared with this account, or the devices list is stale.","triggerScenarios":"Thrown at pkg/yandex/session.go:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the device ID matches one from GetDevices()","Confirm the Yandex account has access (sharing) to that camera","Refresh the session/devices list if it may be stale"],"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"}