Troubleshooting
Common issues and solutions.
CDC Pipeline
Debezium Not Connecting
Symptoms: No CDC events, Debezium logs show connection errors.
Solutions:
- Check PostgreSQL is running and healthy
- Verify
wal_level = logical - Check credentials in application.properties
- Ensure replication slots are available
# Check WAL level
docker exec ds-postgres psql -U datastream -c "SHOW wal_level;"
# Check replication slots
docker exec ds-postgres psql -U datastream -c "SELECT * FROM pg_replication_slots;"
Events Not Arriving
Symptoms: Debezium healthy, but no events in NATS.
Solutions:
- Check NATS JetStream is enabled
- Verify stream exists
- Check table include list
# Check NATS streams
curl -s http://localhost:8222/jsz | jq
# Check Debezium health
curl -s http://localhost:8080/q/health
Streaming
WebSocket Closes Immediately
Symptoms: onclose fires right after onopen.
Solutions:
- Check game slug is valid
- Verify Redis connection
- Look at backend logs
# Check backend logs
docker logs ds-backend --tail 100
# Test with curl
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: test" -H "Sec-WebSocket-Version: 13" \
http://localhost:3000/ws/crash
SSE No Events
Symptoms: Initial event received, but no updates.
Solutions:
- Verify Redis Pub/Sub
- Check consumer is running
- Generate test data
# Test Redis Pub/Sub
redis-cli SUBSCRIBE stream:crash &
redis-cli PUBLISH stream:crash '{"test":true}'
# Generate test round
task db:simulate
High Latency
Symptoms: Events delayed by seconds.
Solutions:
- Check network connectivity
- Reduce batch sizes
- Scale consumer
# Check NATS consumer lag
nats consumer info ROUNDS consumer-name
Redis
Connection Refused
Solutions:
- Verify Redis is running
- Check connection URL
- Check firewall rules
# Test Redis connection
redis-cli -h localhost -p 6379 ping
Out of Memory
Solutions:
- Configure maxmemory
- Set TTL on keys
- Use LRU eviction
# Check memory usage
redis-cli INFO memory
Backend
404 on Endpoints
Solutions:
- Check route registration
- Verify game slug
- Look at Fiber logs
Rate Limited
Symptoms: HTTP 429 responses.
Solutions:
- Reduce request rate
- Implement client-side caching
- Use streaming instead of polling
Docker
Container Won't Start
# Check logs
docker compose logs service-name
# Check health
docker compose ps
# Rebuild
docker compose up -d --build service-name
Network Issues
# List networks
docker network ls
# Inspect network
docker network inspect data-stream_default
Getting Help
- Check logs:
docker compose logs -f - Verify health:
docker compose ps - Test endpoints:
curl http://localhost:3000/api/games - Open issue on GitHub