Skip to content

[Bug] Telegram connection failure causes the entire OpenClaw service to fail on startup #53

@TorosFanny

Description

@TorosFanny

Description:
When the Telegram channel is enabled, if the service is unable to establish a connection to the Telegram API (due to network issues, DNS failure, or API timeouts), the entire openclaw process terminates. This prevents other functional parts of the gateway (such as the web interface or other active channels) from starting.

Environment:

  • OS: NixOS / Home Manager
  • OpenClaw Version: (Current main branch)

Steps to Reproduce:

  1. Configure the Telegram channel in home.nix:
programs.openclaw = {
  channels = {
    telegram = {
      enabled = true; # Enabled here
      botToken = "YOUR_BOT_TOKEN";
      dmPolicy = "pairing";
      allowFrom = [ 5456577721 ];
      mediaMaxMb = 20;
      streamMode = "partial";
    };
  };
};
  1. Run the service in an environment where the Telegram API is unreachable (e.g., no internet, or blocked by a firewall/proxy).

Actual Behavior:
The service attempts to connect to Telegram, fails, and then the process exits with an error. Systemd marks the service as failed.

Note: This is particularly problematic in regions with strict network environments where Telegram might be intermittently blocked.

Expected Behavior:
The service should handle connection errors gracefully. If Telegram is unreachable:

  1. It should log a warning/error.
  2. It should continue to start the rest of the application (so other channels remain usable).
  3. It should ideally attempt to reconnect to the Telegram API in the background.

Impact:
A single channel's connectivity issue should not be a "fatal error" for the entire system. Currently, it reduces the overall availability of the OpenClaw gateway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions