Skip to content

Troubleshooting Guide

The failures people actually hit, what each one means, and the command that confirms it.

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.

Terminal window
# Check current version
rustc --version
# Update Rust
rustup update
# Set specific toolchain (if needed)
rustup override set 1.97.1

Symptom: Linker errors or missing system libraries.

error: linking with `cc` failed

Solution: Install required system dependencies.

Linux (Debian/Ubuntu):

Terminal window
sudo apt-get update
sudo apt-get install build-essential pkg-config libssl-dev

Linux (Fedora/RHEL):

Terminal window
sudo dnf install gcc pkg-config openssl-devel

macOS:

Terminal window
xcode-select --install
brew install openssl pkg-config

Symptom: cargo build appears stuck or takes excessive time.

Solution:

  1. Check cargo build jobs:
Terminal window
# Limit parallel jobs
cargo build --jobs 2
  1. Clean build cache:
Terminal window
cargo clean
cargo build --release
  1. Check disk space:
Terminal window
df -h
# Clean target directory if low
rm -rf target

Symptom: Build fails after pulling latest changes.

Solution: Clean and rebuild.

Terminal window
cargo clean
cargo update
cargo build --workspace --release

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:

Terminal window
export FELIX_QUIC_BIND="0.0.0.0:5001"
export FELIX_BROKER_METRICS_BIND="0.0.0.0:8081"
cargo run --release -p broker

Option 2 - Find and kill process:

Terminal window
# Linux/Mac - find process on port 5000
lsof -i :5000
sudo kill -9 <PID>
# Or use ss
ss -tulpn | grep 5000

Symptom: Client cannot connect to broker.

Error: Connection refused (os error 111)

Solutions:

  1. Verify broker is running:
Terminal window
ps aux | grep broker
lsof -i UDP:5000
  1. Check bind address:
Terminal window
# Broker logs should show:
# "QUIC listening on 0.0.0.0:5000"
# If binding to 127.0.0.1, external connections won't work
export FELIX_QUIC_BIND="0.0.0.0:5000"
  1. Check firewall (Linux):
Terminal window
# Allow UDP 5000
sudo ufw allow 5000/udp
# Or iptables
sudo iptables -A INPUT -p udp --dport 5000 -j ACCEPT
  1. Test connectivity:
Terminal window
# From client machine
nc -zvu <broker-ip> 5000

Symptom: Connection hangs during QUIC handshake.

Error: HandshakeTimeout

Solutions:

  1. Check network path: Ensure UDP traffic is not blocked.

  2. Verify MTU: QUIC sensitive to MTU issues.

Terminal window
# Test with ping
ping -M do -s 1472 <broker-ip>
# Reduce MTU if needed (client-side)
ip link set dev eth0 mtu 1400
  1. Check NAT/Load Balancer: Ensure UDP pass-through.

Symptom: Established connections drop unexpectedly.

Error: Connection reset by peer (os error 104)

Solutions:

  1. Check broker logs for crashes or panics.

  2. Increase flow-control windows:

Terminal window
export FELIX_CACHE_CONN_RECV_WINDOW="536870912"
export FELIX_EVENT_CONN_RECV_WINDOW="536870912"
  1. Check resource limits:
Terminal window
# Increase open file limit
ulimit -n 65536

Symptom: p99/p999 latency much higher than expected.

Solutions:

  1. Use release builds:
Terminal window
# Debug builds are 10-100x slower
cargo build --release
cargo run --release -p broker
  1. Disable timing collection:
Terminal window
export FELIX_DISABLE_TIMINGS="1"
  1. Reduce batch delay:
Terminal window
export FELIX_EVENT_BATCH_MAX_DELAY_US="50"
  1. Check system load:
Terminal window
top
htop
# Look for CPU saturation, memory pressure
  1. Profile with perf (Linux):
Terminal window
sudo perf record -g cargo run --release -p broker
sudo perf report

Symptom: Messages/second much lower than expected.

Solutions:

  1. Increase batch sizes:
Terminal window
export FELIX_EVENT_BATCH_MAX_EVENTS="256"
export FELIX_EVENT_BATCH_MAX_BYTES="1048576"
export FELIX_EVENT_BATCH_MAX_DELAY_US="1000"
  1. Increase connection pools:
Terminal window
export FELIX_EVENT_CONN_POOL="16"
export FELIX_CACHE_CONN_POOL="16"
  1. Check network bandwidth:
Terminal window
iperf3 -c <broker-ip> -u -b 1G
  1. Verify CPU affinity:
Terminal window
# Pin broker to specific cores
taskset -c 0-7 cargo run --release -p broker

Symptom: Broker consuming excessive memory.

OOM Killed

Solutions:

  1. Check actual memory usage:
Terminal window
ps aux | grep broker
pmap <pid>
  1. Reduce flow-control windows:
Terminal window
export FELIX_CACHE_CONN_RECV_WINDOW="134217728" # 128 MiB
export FELIX_CACHE_STREAM_RECV_WINDOW="33554432" # 32 MiB
export FELIX_EVENT_CONN_RECV_WINDOW="134217728"
  1. Reduce queue depths:
Terminal window
export FELIX_BROKER_PUB_QUEUE_DEPTH="512"
export FELIX_SUBSCRIBER_QUEUE_CAPACITY="64"
  1. Limit connection pools (client-side):
Terminal window
export FELIX_EVENT_CONN_POOL="4"
export FELIX_CACHE_CONN_POOL="4"
  1. Check for memory leaks:
Terminal window
# Use valgrind (debug build)
valgrind --leak-check=full ./target/debug/broker

Symptom: Broker at 100% CPU, high latency.

Solutions:

  1. Scale horizontally: Deploy multiple broker instances.

  2. Reduce fanout batch size:

Terminal window
export FELIX_FANOUT_BATCH="32"
  1. Disable telemetry:
Terminal window
export FELIX_DISABLE_TIMINGS="1"
# Or rebuild without telemetry feature
cargo build --release --no-default-features
  1. Profile hot paths:
Terminal window
cargo flamegraph -p broker

Symptom: Broker exits with panic message.

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value'

Solutions:

  1. Enable backtraces:
Terminal window
export RUST_BACKTRACE=1
cargo run --release -p broker
  1. Check logs for context before panic.

  2. Run with debug symbols:

Terminal window
cargo build --profile release-with-debug
./target/release-with-debug/broker
  1. Report issue with full backtrace and reproduction steps.

Symptom: Error opening connections or files.

Error: Too many open files (os error 24)

Solution: Increase file descriptor limit.

Terminal window
# Check current limit
ulimit -n
# Increase temporarily
ulimit -n 65536
# Increase permanently (Linux)
echo "* soft nofile 65536" | sudo tee -a /etc/security/limits.conf
echo "* hard nofile 65536" | sudo tee -a /etc/security/limits.conf
# Verify
ulimit -n

Symptom: Publish operations timing out.

Error: Publish queue full, timeout after 2000ms

Solutions:

  1. Increase queue depth:
Terminal window
export FELIX_BROKER_PUB_QUEUE_DEPTH="2048"
  1. Increase timeout:
Terminal window
export FELIX_PUBLISH_QUEUE_WAIT_MS="5000"
  1. Slow down publisher or scale broker capacity.

  2. Check subscriber health: Slow subscribers cause backpressure.

Symptom: Docker container exits immediately.

Terminal window
docker logs felix-broker
# Check for errors

Solutions:

  1. Check image build:
Terminal window
docker compose build --no-cache
  1. Run interactively:
Terminal window
docker run -it --rm felix/broker:latest /bin/sh
  1. Verify entrypoint:
Terminal window
docker inspect felix/broker:latest | grep -A 5 Entrypoint

Symptom: Container marked unhealthy.

Terminal window
docker compose ps
# STATUS: unhealthy

Solutions:

  1. Test health endpoint:
Terminal window
docker exec felix-broker wget -qO- http://localhost:8080/healthz
  1. Check metrics bind:
environment:
- FELIX_BROKER_METRICS_BIND=0.0.0.0:8080
  1. Increase start period:
healthcheck:
start_period: 30s

Symptom: Cannot write to mounted volume.

Permission denied

Solution: Fix volume permissions.

Terminal window
# Check user in container
docker exec felix-broker id
# Fix ownership
docker exec -u root felix-broker chown -R 10001:nogroup /data
# Or in Dockerfile
RUN chown -R 10001:nogroup /data

Symptom: Pod never schedules.

Terminal window
kubectl describe pod felix-broker-0 -n felix
# Events: FailedScheduling

Solutions:

  1. Check node resources:
Terminal window
kubectl describe nodes
kubectl top nodes
  1. Check PVC binding:
Terminal window
kubectl get pvc -n felix
# Look for Pending PVCs
  1. Check pod affinity:
Terminal window
kubectl get pods -n felix -o wide
# Verify anti-affinity not blocking

Symptom: Pod repeatedly crashes.

Terminal window
kubectl get pods -n felix
# STATUS: CrashLoopBackOff

Solutions:

  1. Check logs:
Terminal window
kubectl logs felix-broker-0 -n felix
kubectl logs felix-broker-0 -n felix --previous
  1. Check events:
Terminal window
kubectl describe pod felix-broker-0 -n felix
  1. Increase resources:
resources:
limits:
memory: "8Gi"

Symptom: Cannot connect to service.

Solutions:

  1. Test from within cluster:
Terminal window
kubectl run -it --rm debug --image=busybox -n felix -- sh
nc -zvu felix-broker-headless 5000
  1. Check service endpoints:
Terminal window
kubectl get endpoints -n felix
  1. Verify service selector:
Terminal window
kubectl get svc felix-broker -n felix -o yaml
kubectl get pods -n felix --show-labels

Symptom: Replicas not increasing.

Solutions:

  1. Check PVC provisioning:
Terminal window
kubectl get pvc -n felix
  1. Check storage class:
Terminal window
kubectl get storageclass
kubectl describe storageclass fast-ssd
  1. Check events:
Terminal window
kubectl get events -n felix --sort-by='.lastTimestamp'

Symptom: Client operations hang or timeout.

Solution: Increase pool sizes.

Terminal window
export FELIX_EVENT_CONN_POOL="16"
export FELIX_CACHE_CONN_POOL="16"
export FELIX_CACHE_STREAMS_PER_CONN="8"

Symptom: Stream operations fail unexpectedly.

Solutions:

  1. Check broker logs for corresponding errors.

  2. Verify stream exists:

Terminal window
# Use broker API or control plane
curl http://broker:8080/streams
  1. Increase timeouts (implementation-dependent).
Terminal window
# Debug all Felix crates
export RUST_LOG="felix=debug"
# Trace specific crate
export RUST_LOG="felix_broker=trace"
# Multiple filters
export RUST_LOG="felix_broker=debug,felix_wire=trace,felix_transport=debug"
Terminal window
# Capture QUIC traffic
sudo tcpdump -i any -w felix.pcap udp port 5000
# Analyze with Wireshark
wireshark felix.pcap

Linux perf:

Terminal window
sudo perf record -g --call-graph dwarf cargo run --release -p broker
sudo perf report

flamegraph:

Terminal window
cargo install flamegraph
cargo flamegraph -p broker -- --custom-args

Memory profiling:

Terminal window
cargo install --locked cargo-profdata
cargo profdata run -p broker
Terminal window
# Run broker
cargo run --release -p broker
# In another terminal, run latency demo
cargo run --release -p broker --bin latency-demo -- \
--binary \
--fanout 1 \
--batch 1 \
--payload 1024 \
--total 5000
Terminal window
# File descriptors
ulimit -n
# Max user processes
ulimit -u
# Memory locked
ulimit -l
# See all limits
ulimit -a

Issue: Client/broker window mismatch causes stalls.

Solution: Ensure consistent configuration.

Terminal window
# Broker
export FELIX_CACHE_CONN_RECV_WINDOW="268435456"
# Client (matching)
export FELIX_CACHE_SEND_WINDOW="268435456"

Issue: Client assumes JSON event frames.

Solution: Ensure clients decode binary EventBatch on subscription event streams.

Issue: Resource limits too low for workload.

Solution: Profile and adjust limits.

Terminal window
# Monitor resources
docker stats
kubectl top pods -n felix
# Adjust based on observations

If you’re still stuck:

  1. Check GitHub Issues: https://github.com/gabloe/felix/issues

  2. Search documentation: Use site search or grep docs directory

  3. Collect diagnostic info:

Terminal window
# Broker version
cargo run --release -p broker -- --version
# System info
uname -a
rustc --version
docker version
kubectl version
# Configuration
env | grep FELIX_
# Logs (last 100 lines)
journalctl -u felix-broker -n 100
  1. Create minimal reproduction: Simplify to smallest failing case

  2. Open an issue with:

    • Felix version
    • Operating system
    • Rust version
    • Configuration
    • Full error message
    • Steps to reproduce