AlexxIT/go2rtc · error

webrtc:

Error message

webrtc: 

What it means

OpenIPC WebRTC watcher reports a terminal PeerConnectionState: any state other than Connecting/Connected (i.e. failed, disconnected, closed) is converted into this error with the state name appended. It signals the DTLS/ICE session died before or after establishment; connState.Done(err) unblocks whoever waits for connection completion.

Solutions

  1. Check NAT/STUN reachability between client and camera for ICE failures
  2. Verify the camera's WebRTC support and firmware state; reboot the camera if it dropped the session
  3. Reconnect: re-run the openipc handshake to establish a fresh peer connection
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/webrtc/openipc.go:82 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/d5633f9b14c0fab0. Report an issue: GitHub.

Appendix: source

Thrown at internal/webrtc/openipc.go:82

			req := openIPCReq{
				Data: msg.ToJSON().Candidate,
				Req:  "candidate",
			}
			if err = conn.WriteJSON(&req); err != nil {
				connState.Done(err)
				return
			}

			log.Trace().Msgf("[webrtc] openipc send: %s", req)

		case pion.PeerConnectionState:
			switch msg {
			case pion.PeerConnectionStateConnecting:
			case pion.PeerConnectionStateConnected:
				connState.Done(nil)
			default:
				connState.Done(errors.New("webrtc: " + msg.String()))
			}
		}
	})

	go func() {
		var err error

		// will be closed when conn will be closed
		for err == nil {
			var rep openIPCReply
			if err = conn.ReadJSON(&rep); err != nil {
				// some buggy messages from Amazon servers
				if errors.Is(err, io.ErrUnexpectedEOF) {
					continue
				}
				break
			}

View on GitHub (pinned to c245815e75)