HKUDS/nanobot · error · ConnectionError

Signal SSE stream ended unexpectedly

Error message

Signal SSE stream ended unexpectedly

What it means

Transport failure in _start_http_mode: the Server-Sent-Events stream used to receive inbound Signal messages terminated unexpectedly (server closed the stream or the connection dropped) instead of running for the channel's lifetime.

Solutions

  1. Let the reconnect loop re-establish the SSE stream; transient drops are expected
  2. Check signal-cli daemon stability and restart it if it is crashing
  3. Verify network stability between the bot and the daemon host
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at nanobot/channels/signal/runtime.py:508 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/2a0a72b2a5bada7c. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/channels/signal/runtime.py:508

                    else:
                        raise ConnectionRefusedError(
                            f"signal-cli daemon check returned status {response.status_code}"
                        )
                except Exception as e:
                    raise ConnectionRefusedError(f"signal-cli daemon not responding: {e}")

                # Reset reconnect delay after successful connection check.
                reconnect_delay_s = 1.0

                # Ensure account-level typing indicators are enabled.
                await self._ensure_typing_indicators_enabled()

                # Start SSE receiver and supervise it. If it exits while we're still
                # running, treat it as a disconnect and reconnect.
                self._sse_task = asyncio.create_task(self._sse_receive_loop())
                await self._sse_task
                if self._running:
                    raise ConnectionError("Signal SSE stream ended unexpectedly")

            except asyncio.CancelledError:
                break
            except ConnectionRefusedError as e:
                self.logger.error(
                    "{}. Make sure signal-cli daemon is running: "
                    "signal-cli -a {} daemon --http {}:{}",
                    e,
                    self.config.phone_number,
                    self.config.daemon_host,
                    self.config.daemon_port,
                )
            except Exception as e:
                self.logger.error("Signal channel error: {}", e)
            finally:
                if self._sse_task:
                    if not self._sse_task.done():
                        self._sse_task.cancel()

View on GitHub (pinned to 42f37dc4c0)