{"record":{"id":"c0469687ddcbb729","repo":"AlexxIT/go2rtc","slug":"webrtc-c04696","errorCode":null,"errorMessage":"webrtc: ","messagePattern":"webrtc: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/webrtc/kinesis.go","lineNumber":109,"sourceCode":"\t\tcase *pion.ICECandidate:\n\t\t\t_ = sendOffer.Wait()\n\n\t\t\treq.Action = \"ICE_CANDIDATE\"\n\t\t\treq.Payload, _ = json.Marshal(msg.ToJSON())\n\t\t\tif err = conn.WriteJSON(&req); err != nil {\n\t\t\t\tconnState.Done(err)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlog.Trace().Msgf(\"[webrtc] kinesis send: %s\", req)\n\n\t\tcase pion.PeerConnectionState:\n\t\t\tswitch msg {\n\t\t\tcase pion.PeerConnectionStateConnecting:\n\t\t\tcase pion.PeerConnectionStateConnected:\n\t\t\t\tconnState.Done(nil)\n\t\t\tdefault:\n\t\t\t\tconnState.Done(errors.New(\"webrtc: \" + msg.String()))\n\t\t\t}\n\t\t}\n\t})\n\n\tvar payload any\n\n\tif sdpOffer == nil {\n\t\tmedias := []*core.Media{\n\t\t\t{Kind: core.KindVideo, Direction: core.DirectionRecvonly},\n\t\t\t{Kind: core.KindAudio, Direction: core.DirectionRecvonly},\n\t\t}\n\n\t\t// 4. Create offer\n\t\tvar offer string\n\t\tif offer, err = prod.CreateOffer(medias); err != nil {\n\t\t\treturn nil, err\n\t\t}\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/AlexxIT/go2rtc/blob/c245815e75e2a5fd60b4290f12bfc04e55a984d3/internal/webrtc/kinesis.go#L91-L127","documentation":"Same pattern as client.go but in the Kinesis-based WebRTC client: the peer connection state became something other than Connecting/Connected (e.g. failed or closed), returned as \"webrtc: <state>\" via connState.Done.","triggerScenarios":"Kinesis WebRTC signaling succeeded but ICE/DTLS subsequently failed — unreachable ICE servers, master/viewer session expired, signaling channel revoked, or network interruption during setup.","commonSituations":"AWS KVS signalled sessions timing out (viewer session TTL); NAT/firewall blocking the media path; wrong ICE server config for the Kinesis stream.","solutions":["Inspect the appended state message to see the exact pion state","Verify STUN/TURN configuration works for both peers","Re-check the Kinesis signaling channel and its credentials/expiry","Retry the connection; transient ICE failures often resolve with reachable TURN"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"prod, err := kinesisClient(...)\nif err != nil && strings.HasPrefix(err.Error(), \"webrtc: \") {\n\t// re-request the signaling session and retry, with backoff\n}","preventionTips":["Keep Kinesis signaling sessions refreshed and credentials valid","Ensure STUN/TURN reachability for KVS media relay","Monitor pion state changes with logging during bring-up"],"tags":["go","webrtc","kinesis","ice"],"backgroundTag":"connection-failed","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"}