Troubleshooting Guide
The failures people actually hit, what each one means, and the command that confirms it.
Build and Compilation Issues
Section titled “Build and Compilation Issues”Rust Version Too Old
Section titled “Rust Version Too Old”Symptom: Compilation errors mentioning unstable features or syntax errors.
error[E0658]: use of unstable library feature 'try_blocks'Solution: Update Rust to 1.97.1 or later.
# Check current versionrustc --version
# Update Rustrustup update
# Set specific toolchain (if needed)rustup override set 1.97.1Missing Dependencies
Section titled “Missing Dependencies”Symptom: Linker errors or missing system libraries.
error: linking with `cc` failedSolution: Install required system dependencies.
Linux (Debian/Ubuntu):
sudo apt-get updatesudo apt-get install build-essential pkg-config libssl-devLinux (Fedora/RHEL):
sudo dnf install gcc pkg-config openssl-develmacOS:
xcode-select --installbrew install openssl pkg-configBuild Hangs or Takes Forever
Section titled “Build Hangs or Takes Forever”Symptom: cargo build appears stuck or takes excessive time.
Solution:
- Check cargo build jobs:
# Limit parallel jobscargo build --jobs 2- Clean build cache:
cargo cleancargo build --release- Check disk space:
df -h# Clean target directory if lowrm -rf targetCompilation Errors After Git Pull
Section titled “Compilation Errors After Git Pull”Symptom: Build fails after pulling latest changes.
Solution: Clean and rebuild.
cargo cleancargo updatecargo build --workspace --releaseNetwork and Connection Issues
Section titled “Network and Connection Issues”Port Already in Use
Section titled “Port Already in Use”Symptom: Broker fails to start with error.
Error: Address already in use (os error 48)Solution: Change ports or kill conflicting process.
Option 1 - Change ports:
export FELIX_QUIC_BIND="0.0.0.0:5001"export FELIX_BROKER_METRICS_BIND="0.0.0.0:8081"cargo run --release -p brokerOption 2 - Find and kill process:
# Linux/Mac - find process on port 5000lsof -i :5000sudo kill -9 <PID>
# Or use ssss -tulpn | grep 5000Connection Refused
Section titled “Connection Refused”Symptom: Client cannot connect to broker.
Error: Connection refused (os error 111)Solutions:
- Verify broker is running:
ps aux | grep brokerlsof -i UDP:5000- Check bind address:
# Broker logs should show:# "QUIC listening on 0.0.0.0:5000"
# If binding to 127.0.0.1, external connections won't workexport FELIX_QUIC_BIND="0.0.0.0:5000"- Check firewall (Linux):
# Allow UDP 5000sudo ufw allow 5000/udp
# Or iptablessudo iptables -A INPUT -p udp --dport 5000 -j ACCEPT- Test connectivity:
# From client machinenc -zvu <broker-ip> 5000QUIC Handshake Timeout
Section titled “QUIC Handshake Timeout”Symptom: Connection hangs during QUIC handshake.
Error: HandshakeTimeoutSolutions:
-
Check network path: Ensure UDP traffic is not blocked.
-
Verify MTU: QUIC sensitive to MTU issues.
# Test with pingping -M do -s 1472 <broker-ip>
# Reduce MTU if needed (client-side)ip link set dev eth0 mtu 1400- Check NAT/Load Balancer: Ensure UDP pass-through.
Connection Reset by Peer
Section titled “Connection Reset by Peer”Symptom: Established connections drop unexpectedly.
Error: Connection reset by peer (os error 104)Solutions:
-
Check broker logs for crashes or panics.
-
Increase flow-control windows:
export FELIX_CACHE_CONN_RECV_WINDOW="536870912"export FELIX_EVENT_CONN_RECV_WINDOW="536870912"- Check resource limits:
# Increase open file limitulimit -n 65536Performance Issues
Section titled “Performance Issues”High Latency
Section titled “High Latency”Symptom: p99/p999 latency much higher than expected.
Solutions:
- Use release builds:
# Debug builds are 10-100x slowercargo build --releasecargo run --release -p broker- Disable timing collection:
export FELIX_DISABLE_TIMINGS="1"- Reduce batch delay:
export FELIX_EVENT_BATCH_MAX_DELAY_US="50"- Check system load:
tophtop# Look for CPU saturation, memory pressure- Profile with perf (Linux):
sudo perf record -g cargo run --release -p brokersudo perf reportLow Throughput
Section titled “Low Throughput”Symptom: Messages/second much lower than expected.
Solutions:
- Increase batch sizes:
export FELIX_EVENT_BATCH_MAX_EVENTS="256"export FELIX_EVENT_BATCH_MAX_BYTES="1048576"export FELIX_EVENT_BATCH_MAX_DELAY_US="1000"- Increase connection pools:
export FELIX_EVENT_CONN_POOL="16"export FELIX_CACHE_CONN_POOL="16"- Check network bandwidth:
iperf3 -c <broker-ip> -u -b 1G- Verify CPU affinity:
# Pin broker to specific corestaskset -c 0-7 cargo run --release -p brokerHigh Memory Usage
Section titled “High Memory Usage”Symptom: Broker consuming excessive memory.
OOM KilledSolutions:
- Check actual memory usage:
ps aux | grep brokerpmap <pid>- Reduce flow-control windows:
export FELIX_CACHE_CONN_RECV_WINDOW="134217728" # 128 MiBexport FELIX_CACHE_STREAM_RECV_WINDOW="33554432" # 32 MiBexport FELIX_EVENT_CONN_RECV_WINDOW="134217728"- Reduce queue depths:
export FELIX_BROKER_PUB_QUEUE_DEPTH="512"export FELIX_SUBSCRIBER_QUEUE_CAPACITY="64"- Limit connection pools (client-side):
export FELIX_EVENT_CONN_POOL="4"export FELIX_CACHE_CONN_POOL="4"- Check for memory leaks:
# Use valgrind (debug build)valgrind --leak-check=full ./target/debug/brokerCPU Saturation
Section titled “CPU Saturation”Symptom: Broker at 100% CPU, high latency.
Solutions:
-
Scale horizontally: Deploy multiple broker instances.
-
Reduce fanout batch size:
export FELIX_FANOUT_BATCH="32"- Disable telemetry:
export FELIX_DISABLE_TIMINGS="1"# Or rebuild without telemetry featurecargo build --release --no-default-features- Profile hot paths:
cargo flamegraph -p brokerRuntime Errors
Section titled “Runtime Errors”Panic or Crash
Section titled “Panic or Crash”Symptom: Broker exits with panic message.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value'Solutions:
- Enable backtraces:
export RUST_BACKTRACE=1cargo run --release -p broker-
Check logs for context before panic.
-
Run with debug symbols:
cargo build --profile release-with-debug./target/release-with-debug/broker- Report issue with full backtrace and reproduction steps.
Out of File Descriptors
Section titled “Out of File Descriptors”Symptom: Error opening connections or files.
Error: Too many open files (os error 24)Solution: Increase file descriptor limit.
# Check current limitulimit -n
# Increase temporarilyulimit -n 65536
# Increase permanently (Linux)echo "* soft nofile 65536" | sudo tee -a /etc/security/limits.confecho "* hard nofile 65536" | sudo tee -a /etc/security/limits.conf
# Verifyulimit -nQueue Full / Backpressure
Section titled “Queue Full / Backpressure”Symptom: Publish operations timing out.
Error: Publish queue full, timeout after 2000msSolutions:
- Increase queue depth:
export FELIX_BROKER_PUB_QUEUE_DEPTH="2048"- Increase timeout:
export FELIX_PUBLISH_QUEUE_WAIT_MS="5000"-
Slow down publisher or scale broker capacity.
-
Check subscriber health: Slow subscribers cause backpressure.
Docker and Container Issues
Section titled “Docker and Container Issues”Container Won’t Start
Section titled “Container Won’t Start”Symptom: Docker container exits immediately.
docker logs felix-broker# Check for errorsSolutions:
- Check image build:
docker compose build --no-cache- Run interactively:
docker run -it --rm felix/broker:latest /bin/sh- Verify entrypoint:
docker inspect felix/broker:latest | grep -A 5 EntrypointContainer Health Check Failing
Section titled “Container Health Check Failing”Symptom: Container marked unhealthy.
docker compose ps# STATUS: unhealthySolutions:
- Test health endpoint:
docker exec felix-broker wget -qO- http://localhost:8080/healthz- Check metrics bind:
environment: - FELIX_BROKER_METRICS_BIND=0.0.0.0:8080- Increase start period:
healthcheck: start_period: 30sVolume Permission Issues
Section titled “Volume Permission Issues”Symptom: Cannot write to mounted volume.
Permission deniedSolution: Fix volume permissions.
# Check user in containerdocker exec felix-broker id
# Fix ownershipdocker exec -u root felix-broker chown -R 10001:nogroup /data
# Or in DockerfileRUN chown -R 10001:nogroup /dataKubernetes Issues
Section titled “Kubernetes Issues”Pod Stuck in Pending
Section titled “Pod Stuck in Pending”Symptom: Pod never schedules.
kubectl describe pod felix-broker-0 -n felix# Events: FailedSchedulingSolutions:
- Check node resources:
kubectl describe nodeskubectl top nodes- Check PVC binding:
kubectl get pvc -n felix# Look for Pending PVCs- Check pod affinity:
kubectl get pods -n felix -o wide# Verify anti-affinity not blockingCrashLoopBackOff
Section titled “CrashLoopBackOff”Symptom: Pod repeatedly crashes.
kubectl get pods -n felix# STATUS: CrashLoopBackOffSolutions:
- Check logs:
kubectl logs felix-broker-0 -n felixkubectl logs felix-broker-0 -n felix --previous- Check events:
kubectl describe pod felix-broker-0 -n felix- Increase resources:
resources: limits: memory: "8Gi"Service Not Reachable
Section titled “Service Not Reachable”Symptom: Cannot connect to service.
Solutions:
- Test from within cluster:
kubectl run -it --rm debug --image=busybox -n felix -- shnc -zvu felix-broker-headless 5000- Check service endpoints:
kubectl get endpoints -n felix- Verify service selector:
kubectl get svc felix-broker -n felix -o yamlkubectl get pods -n felix --show-labelsStatefulSet Not Scaling
Section titled “StatefulSet Not Scaling”Symptom: Replicas not increasing.
Solutions:
- Check PVC provisioning:
kubectl get pvc -n felix- Check storage class:
kubectl get storageclasskubectl describe storageclass fast-ssd- Check events:
kubectl get events -n felix --sort-by='.lastTimestamp'Client SDK Issues
Section titled “Client SDK Issues”Connection Pool Exhaustion
Section titled “Connection Pool Exhaustion”Symptom: Client operations hang or timeout.
Solution: Increase pool sizes.
export FELIX_EVENT_CONN_POOL="16"export FELIX_CACHE_CONN_POOL="16"export FELIX_CACHE_STREAMS_PER_CONN="8"Stream Errors
Section titled “Stream Errors”Symptom: Stream operations fail unexpectedly.
Solutions:
-
Check broker logs for corresponding errors.
-
Verify stream exists:
# Use broker API or control planecurl http://broker:8080/streams- Increase timeouts (implementation-dependent).
Debugging Tools
Section titled “Debugging Tools”Enable Verbose Logging
Section titled “Enable Verbose Logging”# Debug all Felix cratesexport RUST_LOG="felix=debug"
# Trace specific crateexport RUST_LOG="felix_broker=trace"
# Multiple filtersexport RUST_LOG="felix_broker=debug,felix_wire=trace,felix_transport=debug"Capture Network Traffic
Section titled “Capture Network Traffic”# Capture QUIC trafficsudo tcpdump -i any -w felix.pcap udp port 5000
# Analyze with Wiresharkwireshark felix.pcapProfile Performance
Section titled “Profile Performance”Linux perf:
sudo perf record -g --call-graph dwarf cargo run --release -p brokersudo perf reportflamegraph:
cargo install flamegraphcargo flamegraph -p broker -- --custom-argsMemory profiling:
cargo install --locked cargo-profdatacargo profdata run -p brokerTest Latency Locally
Section titled “Test Latency Locally”# Run brokercargo run --release -p broker
# In another terminal, run latency democargo run --release -p broker --bin latency-demo -- \ --binary \ --fanout 1 \ --batch 1 \ --payload 1024 \ --total 5000Check System Limits
Section titled “Check System Limits”# File descriptorsulimit -n
# Max user processesulimit -u
# Memory lockedulimit -l
# See all limitsulimit -aCommon Configuration Mistakes
Section titled “Common Configuration Mistakes”Mismatched Window Sizes
Section titled “Mismatched Window Sizes”Issue: Client/broker window mismatch causes stalls.
Solution: Ensure consistent configuration.
# Brokerexport FELIX_CACHE_CONN_RECV_WINDOW="268435456"
# Client (matching)export FELIX_CACHE_SEND_WINDOW="268435456"Wrong Frame Format Assumptions
Section titled “Wrong Frame Format Assumptions”Issue: Client assumes JSON event frames.
Solution: Ensure clients decode binary EventBatch on subscription event streams.
Insufficient Resources
Section titled “Insufficient Resources”Issue: Resource limits too low for workload.
Solution: Profile and adjust limits.
# Monitor resourcesdocker statskubectl top pods -n felix
# Adjust based on observationsGetting Help
Section titled “Getting Help”If you’re still stuck:
-
Check GitHub Issues: https://github.com/gabloe/felix/issues
-
Search documentation: Use site search or
grepdocs directory -
Collect diagnostic info:
# Broker versioncargo run --release -p broker -- --version
# System infouname -arustc --versiondocker versionkubectl version
# Configurationenv | grep FELIX_
# Logs (last 100 lines)journalctl -u felix-broker -n 100-
Create minimal reproduction: Simplify to smallest failing case
-
Open an issue with:
- Felix version
- Operating system
- Rust version
- Configuration
- Full error message
- Steps to reproduce
Next Steps
Section titled “Next Steps”- Configuration reference: Configuration Reference
- Environment variables: Environment Variables
- FAQ: Frequently Asked Questions
