Troubleshooting Guide
Common issues and their solutions when running Surgewave.
Connection Issues
Cannot Connect to Broker
Symptoms:
BrokerConnectionException: Failed to connect to broker- Connection timeout errors
SocketException: Connection refused
Solutions:
Verify broker is running:
surgewave health # or check process ps aux | grep surgewave-brokerCheck port availability:
netstat -an | grep 9092Verify firewall rules:
# Linux sudo ufw status # Windows netsh advfirewall firewall show rule name=all | findstr 9092Check bootstrap servers configuration:
// Ensure correct format options.BootstrapServers = "localhost:9092"; // Not "http://localhost:9092"
Connection Drops / Disconnects
Symptoms:
Disconnectedevent fires unexpectedly- Intermittent
IOExceptionerrors
Solutions:
Enable auto-reconnect (default):
options.EnableAutoReconnect = true; options.MaxReconnectAttempts = 10; options.ReconnectBackoffMs = 100;Check network stability:
ping localhost surgewave health --verboseIncrease timeouts:
options.RequestTimeoutMs = 60000; options.SessionTimeoutMs = 30000;
Producer Issues
Messages Not Being Delivered
Symptoms:
ProduceAsynchangs or times out- No messages appearing in topic
Solutions:
Check topic exists:
surgewave topics list surgewave topics create my-topic --partitions 3Verify serialization:
// Ensure serializer matches data type options.ValueSerializer = Serializers.Json<Order>();Flush pending messages:
await producer.FlushAsync();
MessageTooLarge Error
Symptoms:
SurgewaveExceptionwithMessageTooLargeerror code
Solutions:
Check message size against broker limit:
surgewave config get message.max.bytesEnable compression:
// Use compression for large messages .UsePreset(SendPreset.HighCompression)Split large messages:
// Chunk large payloads var chunks = SplitIntoChunks(largePayload, maxSize: 900_000);
Consumer Issues
Consumer Not Receiving Messages
Symptoms:
ConsumeAsyncreturns null repeatedly- Consumer appears stuck
Solutions:
Verify subscription:
// Must subscribe before consuming consumer.Subscribe("my-topic"); // or await consumer.SubscribeAsync(cancellationToken, "my-topic");Check offset reset policy:
// Start from beginning if no committed offset options.AutoOffsetReset = AutoOffsetReset.Earliest;Check for paused partitions:
var paused = consumer.PausedPartitions; if (paused.Count > 0) consumer.Resume(paused.ToArray());Verify messages exist:
surgewave consume my-topic --from-beginning --max-messages 1
Consumer Lag Growing
Symptoms:
GetLagAsyncreturns increasing values- Processing falling behind
Solutions:
Check consumer throughput:
var lag = await consumer.GetAllLagAsync(); foreach (var (tp, lagValue) in lag) Console.WriteLine($"{tp}: {lagValue} behind");Increase parallelism:
// Process messages concurrently var tasks = messages.Select(ProcessAsync); await Task.WhenAll(tasks);Batch commits:
// Don't commit every message if (processedCount % 100 == 0) await consumer.CommitAsync();Scale consumers:
- Add more consumers to the group (up to partition count)
Rebalancing Too Frequently
Symptoms:
- Frequent
PartitionsRevoked/PartitionsAssignedevents - Processing interruptions
Solutions:
Increase session timeout:
options.SessionTimeoutMs = 45000; // Default 30000 options.HeartbeatIntervalMs = 10000; // Default 3000Reduce processing time per message:
options.MaxPollIntervalMs = 600000; // 10 minutesHandle rebalance gracefully:
consumer.PartitionsRevoked += async (s, e) => { await consumer.CommitAsync(); // Commit before losing partitions };
Consumer Group Issues
UnknownMemberId Error
Symptoms:
ProtocolExceptionwithUnknownMemberId- Consumer kicked from group
Solutions:
Rejoin the group:
await consumer.SubscribeAsync(cancellationToken, topics);Ensure timely polling:
// Don't let MaxPollIntervalMs expire while (!ct.IsCancellationRequested) { var result = await consumer.ConsumeAsync(ct); // Process quickly or in background }
GroupCoordinatorNotAvailable
Symptoms:
- Cannot join consumer group
- Group operations fail
Solutions:
Check broker health:
surgewave health surgewave cluster statusRetry with backoff:
// Built-in auto-reconnect handles this options.EnableAutoReconnect = true;
Storage Issues
Disk Space Running Low
Symptoms:
- Write failures
- Broker performance degradation
Solutions:
Check disk usage:
surgewave storage status df -h /var/surgewave/dataReduce retention:
surgewave topics alter my-topic --retention-ms 86400000 # 1 dayEnable log compaction:
surgewave topics alter my-topic --cleanup-policy compactUse tiered storage:
{ "Surgewave": { "Storage": { "Mode": "Tiered", "TieredStorage": { "HotRetentionMs": 86400000, "RemoteStorage": "s3://my-bucket/surgewave" } } } }
Slow Read/Write Performance
Symptoms:
- High latency on produce/consume
- Broker CPU/IO saturation
Solutions:
Check storage mode:
surgewave config get storage.modeUse faster storage backend:
{ "Surgewave": { "Storage": { "Mode": "ZeroCopyWal" // Faster than FileSystem } } }Tune OS settings:
# Increase file descriptors ulimit -n 65535 # Tune vm settings sysctl -w vm.swappiness=1
Cluster Issues
Leader Election Failing
Symptoms:
- Partitions without leaders
NotLeaderForPartitionerrors
Solutions:
Check cluster health:
surgewave cluster status surgewave cluster nodesCheck quorum:
- Ensure majority of nodes are healthy
- For 3-node cluster, at least 2 must be up
Force leader election:
surgewave cluster elect-leaders --all
Replication Falling Behind
Symptoms:
- ISR (In-Sync Replicas) shrinking
- Follower lag increasing
Solutions:
Check replica status:
surgewave topics describe my-topic --show-replicasIncrease replication bandwidth:
{ "Surgewave": { "Clustering": { "ReplicationFetchMaxBytes": 10485760 } } }
Diagnostic Commands
# Overall health
surgewave health --verbose
# Topic details
surgewave topics describe my-topic
# Consumer group status
surgewave groups describe my-group
# Broker metrics
surgewave metrics --category broker
# Recent errors
surgewave logs --level error --since 1h
# Cluster status
surgewave cluster status
Getting Help
If issues persist:
Collect diagnostics:
surgewave diagnose --output diagnostics.zipCheck logs:
surgewave logs --level debug --since 30m > debug.logReport issue: GitHub Issues