{"record":{"id":"160629a4321b09c3","repo":"SnapDrop/snapdrop","slug":"ice-gathering-failed","errorCode":null,"errorMessage":"ICE Gathering failed","messagePattern":"ICE Gathering failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/scripts/network.js","lineNumber":325,"sourceCode":"    }\n\n    _onConnectionStateChange(e) {\n        console.log('RTC: state changed:', this._conn.connectionState);\n        switch (this._conn.connectionState) {\n            case 'disconnected':\n                this._onChannelClosed();\n                break;\n            case 'failed':\n                this._conn = null;\n                this._onChannelClosed();\n                break;\n        }\n    }\n\n    _onIceConnectionStateChange() {\n        switch (this._conn.iceConnectionState) {\n            case 'failed':\n                console.error('ICE Gathering failed');\n                break;\n            default:\n                console.log('ICE Gathering', this._conn.iceConnectionState);\n        }\n    }\n\n    _onError(error) {\n        console.error(error);\n    }\n\n    _send(message) {\n        if (!this._channel) return this.refresh();\n        this._channel.send(message);\n    }\n\n    _sendSignal(signal) {\n        signal.type = 'signal';\n        signal.to = this._peerId;","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/SnapDrop/snapdrop/blob/b8b78cc22a672fd7c442f5a4866a8d9b0c05362e/client/scripts/network.js#L307-L343","documentation":"Fires in _onIceConnectionStateChange when this._conn.iceConnectionState becomes 'failed': the WebRTC ICE agent found no usable candidate path (host, srflx, or relay) between the peers, so NAT/firewall traversal for this connection failed. Despite the wording, it signals overall ICE connectivity failure, not just gathering.","triggerScenarios":"Thrown at client/scripts/network.js:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify a STUN server (e.g. stun.l.google.com:19302) is configured in the RTCPeerConnection iceServers","Add a TURN server with credentials so candidates can be relayed when direct traversal fails","Check that neither side blocks UDP egress or TURN ports (3478/5349)","Call conn.restartIce() on 'failed' to retry with fresh candidates instead of only logging","Invoke this._onChannelClosed() on failure so the UI can prompt a reconnect"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b8b78cc22a672fd7c442f5a4866a8d9b0c05362e","analyzedAt":"2026-09-02T16:11:56.727Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}