Troubleshooting
This page covers the most common issues encountered when running PRX-WAF, along with their causes and solutions.
Database Connection Fails
Symptoms: PRX-WAF fails to start with "connection refused" or "authentication failed" errors.
Solutions:
- Verify PostgreSQL is running:
# Docker
docker compose ps postgres
# systemd
sudo systemctl status postgresql- Test connectivity:
psql "postgresql://prx_waf:[email protected]:5432/prx_waf"- Check the connection string in your TOML config:
[storage]
database_url = "postgresql://prx_waf:[email protected]:5432/prx_waf"- Run migrations if the database exists but tables are missing:
prx-waf -c configs/default.toml migrateRules Not Loading
Symptoms: PRX-WAF starts but no rules are active. Attacks are not being detected.
Solutions:
- Check rule statistics:
prx-waf rules statsIf the output shows 0 rules, the rules directory may be empty or misconfigured.
- Verify the rules directory path in your config:
[rules]
dir = "rules/"- Validate rule files:
python rules/tools/validate.py rules/- Check for YAML syntax errors -- a single malformed file can prevent all rules from loading:
# Validate one file at a time to find the problem
python rules/tools/validate.py rules/owasp-crs/sqli.yaml- Ensure built-in rules are enabled:
[rules]
enable_builtin_owasp = true
enable_builtin_bot = true
enable_builtin_scanner = trueHot-Reload Not Working
Symptoms: Rule files are modified but changes are not taking effect.
Solutions:
- Verify hot-reload is enabled:
[rules]
hot_reload = true
reload_debounce_ms = 500- Trigger a manual reload:
prx-waf rules reload- Send SIGHUP:
kill -HUP $(pgrep prx-waf)- Check filesystem watch limits (Linux):
cat /proc/sys/fs/inotify/max_user_watches
# If too low, increase:
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pFalse Positives
Symptoms: Legitimate requests are being blocked (403 Forbidden).
Solutions:
- Identify the blocking rule from the security events:
curl -H "Authorization: Bearer $TOKEN" http://localhost:9527/api/security-eventsLook for the rule_id field in the event.
- Disable the specific rule:
prx-waf rules disable CRS-942100- Lower the paranoia level. If you are running at paranoia 2+, try reducing to 1:
# In your rules config, only load paranoia level 1 rules- Switch the rule to log mode for monitoring instead of blocking:
Edit the rule file and change action: "block" to action: "log", then reload:
prx-waf rules reload- Add an IP allowlist for trusted sources:
curl -X POST http://localhost:9527/api/rules/ip \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"ip": "10.0.0.0/8", "action": "allow"}'TIP
When deploying new rules, start with action: log to monitor for false positives before switching to action: block.
SSL Certificate Issues
Symptoms: HTTPS connections fail, certificate errors, or Let's Encrypt renewal fails.
Solutions:
Check certificate status in the admin UI under SSL Certificates.
Verify port 80 is accessible from the internet for ACME HTTP-01 challenges.
Check the certificate paths if using manual certificates:
[http3]
cert_pem = "/etc/prx-waf/tls/cert.pem"
key_pem = "/etc/prx-waf/tls/key.pem"- Verify the certificate matches the domain:
openssl x509 -in /etc/prx-waf/tls/cert.pem -text -noout | grep -A1 "Subject Alternative Name"Cluster Nodes Not Connecting
Symptoms: Worker nodes cannot join the cluster. Status shows "disconnected" peers.
Solutions:
- Verify network connectivity on the cluster port (default: UDP 16851):
# From worker to main
nc -zuv node-a 16851- Check firewall rules -- cluster communication uses UDP:
sudo ufw allow 16851/udp- Verify certificates -- all nodes must use certificates signed by the same CA:
openssl verify -CAfile cluster-ca.pem node-b.pem- Check seed configuration on worker nodes:
[cluster]
seeds = ["node-a:16851"] # Must resolve to the main node- Review logs with debug verbosity:
prx-waf -c config.toml run 2>&1 | grep -i "cluster\|quic\|peer"High Memory Usage
Symptoms: PRX-WAF process consumes more memory than expected.
Solutions:
- Reduce response cache size:
[cache]
max_size_mb = 128 # Reduce from default 256- Reduce database connection pool:
[storage]
max_connections = 10 # Reduce from default 20- Reduce worker threads:
[proxy]
worker_threads = 2 # Reduce from CPU count- Monitor memory usage:
ps aux | grep prx-wafCrowdSec Connection Issues
Symptoms: CrowdSec integration shows "disconnected" or decisions are not loading.
Solutions:
- Test LAPI connectivity:
prx-waf crowdsec test- Verify the API key:
# On the CrowdSec machine
cscli bouncers list- Check the LAPI URL:
[crowdsec]
lapi_url = "http://127.0.0.1:8080"
api_key = "your-bouncer-key"- Set a safe fallback action for when LAPI is unreachable:
[crowdsec]
fallback_action = "log" # Don't block when LAPI is downPerformance Tuning
Slow Response Times
- Enable response caching:
[cache]
enabled = true
max_size_mb = 512- Increase worker threads:
[proxy]
worker_threads = 8- Increase database connections:
[storage]
max_connections = 50High CPU Usage
Reduce the number of active rules. Disable paranoia level 3-4 rules if not needed.
Disable unused detection phases. For example, if you do not use CrowdSec:
[crowdsec]
enabled = falseGetting Help
If none of the above solutions resolve your issue:
- Check existing issues: github.com/openprx/prx-waf/issues
- File a new issue with:
- PRX-WAF version
- Operating system and kernel version
- Configuration file (with passwords redacted)
- Relevant log output
- Steps to reproduce
Next Steps
- Configuration Reference -- Fine-tune all settings
- Rule Engine -- Understand how rules are evaluated
- Cluster Mode -- Cluster-specific troubleshooting