{"record":{"id":"894a83ca160de0b0","repo":"AlexxIT/go2rtc","slug":"failed-to-unmarshal-socket-ticket-response-w","errorCode":null,"errorMessage":"failed to unmarshal socket ticket response: %w","messagePattern":"failed to unmarshal socket ticket response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/ring/api.go","lineNumber":397,"sourceCode":"\tallCameras = append(allCameras, interfaceSlice(devices.StickupCams)...)\n\tallCameras = append(allCameras, interfaceSlice(devices.AuthorizedDoorbots)...)\n\tallCameras = append(allCameras, interfaceSlice(onvifCameras)...)\n\tallCameras = append(allCameras, interfaceSlice(intercoms)...)\n\n\tdevices.AllCameras = allCameras\n\n\treturn &devices, nil\n}\n\nfunc (c *RingApi) GetSocketTicket() (*SocketTicketResponse, error) {\n\tresponse, err := c.Request(\"POST\", AppAPI(\"clap/ticket/request/signalsocket\"), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to fetch socket ticket: %w\", err)\n\t}\n\n\tvar ticket SocketTicketResponse\n\tif err := json.Unmarshal(response, &ticket); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to unmarshal socket ticket response: %w\", err)\n\t}\n\n\treturn &ticket, nil\n}\n\nfunc (c *RingApi) Request(method, url string, body interface{}) ([]byte, error) {\n\t// Ensure we have a valid session\n\tif err := c.ensureSession(); err != nil {\n\t\treturn nil, fmt.Errorf(\"session validation failed: %w\", err)\n\t}\n\n\tvar bodyReader io.Reader\n\tif body != nil {\n\t\tjsonBody, err := json.Marshal(body)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to marshal request body: %w\", err)\n\t\t}\n\t\tbodyReader = bytes.NewReader(jsonBody)","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/pkg/ring/api.go#L379-L415","documentation":"Raised in GetSocketTicket when the JSON body returned by Ring's clap/ticket/request/signalsocket endpoint cannot be unmarshalled into a SocketTicketResponse, typically because the endpoint returned an error page or an unexpected schema.","triggerScenarios":"Thrown at pkg/ring/api.go:397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the ticket request","Update SocketTicketResponse to match the current 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"}