Skip to content

Troubleshooting guide

Solutions for common rChat problems.


Symptoms: The client hangs at Connecting to wss://... and eventually times out.

Check:

  1. Server port is accessible:
Terminal window
# From a different machine
nc -zv your-server.com 443
curl -I https://your-server.com
  1. Firewall allows port 443:
Terminal window
sudo ufw status # UFW
sudo iptables -L -n | grep 443 # iptables
  1. TLS certificate is valid:
Terminal window
openssl s_client -connect your-server.com:443 -servername your-server.com </dev/null 2>/dev/null | openssl x509 -noout -dates

Symptoms: Client shows TLS handshake failed or certificate verify failed.

Causes and solutions:

  1. Let’s Encrypt certificate not renewed:
Terminal window
sudo certbot certificates
sudo systemctl reload rchat-server
  1. Wrong hostname in server address:
# The hostname must match the certificate
wss://your-server.com # Certificate must be for your-server.com
  1. SNI mismatch:
# If connecting through a CDN or by IP
wss://10.0.0.1
# Set SNI hostname separately in client settings

Symptoms: Client fails instantly with Connection refused.

Check:

Terminal window
# Is the server running?
sudo systemctl status rchat-server
# Is it listening on the right port?
sudo ss -tlnp | grep 443
# Can you connect locally?
curl -I http://127.0.0.1:8443

Symptoms: Connection succeeds but messages cannot be sent.

Causes:

  1. Contact has not published their key: Both parties must publish their public key bundle to the server before starting a conversation.

  2. Wrong identity key: Verify the contact’s identity key is correct. A single character error will prevent the handshake.

  3. Server restart: If the server restarted without message_queue_persist_path, queued messages are lost. Re-initiate the conversation.


Check connection count:

Terminal window
curl -s http://localhost:9090/metrics | grep rchat_connections_total

Check for memory leaks:

Terminal window
# Restart the server as a temporary measure
sudo systemctl restart rchat-server

Check current limits:

Terminal window
ulimit -n

Increase limits:

Terminal window
ulimit -n 1000000

Permanent change: Add to /etc/security/limits.conf:

* soft nofile 1000000
* hard nofile 1000000

  • Verify server address is correct and includes wss:// (not https://)
  • Ensure identity key is generated
  • Ensure the server is running and accessible
  • Verify the contact’s identity key is correct
  • Ensure the contact has published their key to the same server
  • Try starting the conversation again

Possible causes:

  1. Network instability (Wi-Fi to cellular handoff)
  2. iOS suspending the app in background
  3. Server instability

Solutions:

  1. Enable Background App Refresh for rChat in iOS Settings
  2. Check for iOS/macOS updates
  3. Verify your server is stable

Run rchat-cli keygen first, or specify the path:

Terminal window
rchat-cli --identity-key ~/.config/rchat/identity.key

Ensure the binary is executable:

Terminal window
chmod +x /usr/local/bin/rchat-cli

On macOS, you may also need to remove the quarantine attribute:

Terminal window
xattr -d com.apple.quarantine /usr/local/bin/rchat-cli

Check latency to server:

Terminal window
ping your-server.com

If latency is high even to the server, the issue is geographic distance, not rChat.

Optimise:

  1. Use a server closer to your location
  2. Check server load: uptime, htop

Check:

  1. Server bandwidth
  2. Client hardware: encryption is CPU-intensive on older devices
  3. Network congestion

Optimise server:

[server]
rate_limit_bps = 10485760 # Increase to 10 MB/s

For detailed client logs:

Terminal window
RUST_LOG=debug rchat-cli --server wss://your-server.com

For server logs:

Terminal window
RUST_LOG=debug sudo rchat-server --config /etc/rchat/server.toml
Terminal window
# systemd journal
sudo journalctl -u rchat-server -f
# kernel logs
sudo dmesg | grep -i tcp
Terminal window
# Trace path to server
traceroute your-server.com
# Check server listening ports
sudo ss -tlnp
Log messageMeaning
Listening on 0.0.0.0:443Server started successfully
WebSocket endpoint readyWebSocket handler is active
Metrics endpoint: 0.0.0.0:9090Prometheus metrics are available
X3DH handshake completeEncryption established with a contact
Circuit createdA new relay circuit has been set up
Rate limitedA client exceeded the per-circuit bandwidth limit