Troubleshooting Guide
Troubleshooting Guide
Section titled “Troubleshooting Guide”This guide helps diagnose and resolve common issues with Bifrost.
Quick Diagnostics
Section titled “Quick Diagnostics”Check Service Status
Section titled “Check Service Status”# Server healthcurl http://localhost:7082/api/v1/health
# Server statuscurl http://localhost:7082/api/v1/status
# Backend statuscurl http://localhost:7082/api/v1/backendsEnable Debug Logging
Section titled “Enable Debug Logging”Set the log level to debug in your configuration:
logging: level: debug format: text # Use 'text' for human-readable outputOr via CLI:
bifrost-server -c config.yaml --log-level debugConnection Issues
Section titled “Connection Issues””Connection Refused”
Section titled “”Connection Refused””Symptoms: Clients cannot connect to the proxy.
Causes and Solutions:
-
Service not running
Terminal window # Check if process is runningps aux | grep bifrost# Check service statussystemctl status bifrost-server -
Wrong bind address
# Wrong: only localhost can connectserver:http:listen: "127.0.0.1:7080"# Correct: all interfacesserver:http:listen: ":7080" -
Firewall blocking
Terminal window # Linux: Check iptablessudo iptables -L -n | grep 8080# Allow portsudo ufw allow 8080/tcp
”Connection Timeout”
Section titled “”Connection Timeout””Symptoms: Connections hang and eventually timeout.
Causes and Solutions:
-
Backend unreachable
Terminal window # Test backend connectivitycurl -x http://localhost:7080 https://example.com# Check backend healthcurl http://localhost:7082/api/v1/backends -
DNS resolution issues
Terminal window # Test DNSnslookup example.com# For WireGuard, check DNS config -
Timeout too short
server:http:read_timeout: "60s" # Increase if neededwrite_timeout: "60s"
”Proxy Authentication Required” (407)
Section titled “”Proxy Authentication Required” (407)”Symptoms: Browser shows authentication prompt.
Solutions:
-
Check credentials
Terminal window # Test with curlcurl -x http://user:password@localhost:7080 https://example.com -
Verify auth configuration
auth:mode: nativenative:users:- username: myuserpassword_hash: "$2a$12$..." # bcrypt hash -
Generate correct password hash
Terminal window # Using htpasswdhtpasswd -nbBC 12 "" "mypassword" | cut -d: -f2
Backend Issues
Section titled “Backend Issues”WireGuard Tunnel Not Working
Section titled “WireGuard Tunnel Not Working”Symptoms: Traffic through WireGuard backend fails.
Diagnostics:
# Check WireGuard interfacesudo wg show
# Check routingip route show
# Test connectivity through tunnelping 10.0.0.1 # Peer IPCommon Issues:
-
Missing kernel module (for kernel mode)
Terminal window sudo modprobe wireguard -
Permission denied
Terminal window # Run with sufficient privileges or use userspace modesudo setcap cap_net_admin+ep /usr/local/bin/bifrost-server -
Key mismatch
- Verify public/private key pairs match between peers
- Check for typos in configuration
-
Firewall blocking UDP
Terminal window sudo ufw allow 51820/udp
OpenVPN Tunnel Not Working
Section titled “OpenVPN Tunnel Not Working”Symptoms: OpenVPN backend shows unhealthy status.
Diagnostics:
# Check OpenVPN processps aux | grep openvpn
# View OpenVPN logstail -f /var/log/openvpn.logCommon Issues:
-
Config file not found
backends:- name: vpntype: openvpnconfig:config_file: "/etc/openvpn/client.ovpn" # Must be absolute path -
Authentication failed
# Use inline credentialsconfig:config_content: |clientdev tun...username: "myuser"password: "mypassword" -
OpenVPN binary not found
Terminal window # Install OpenVPNsudo apt install openvpn# Or specify pathconfig:binary: "/usr/sbin/openvpn"
HTTP/SOCKS5 Upstream Proxy Issues
Section titled “HTTP/SOCKS5 Upstream Proxy Issues”Diagnostics:
# Test upstream proxy directlycurl -x http://upstream-proxy:7380 https://example.com
# Check connectivitync -zv upstream-proxy 3128Performance Issues
Section titled “Performance Issues”High Latency
Section titled “High Latency”Diagnostics:
# Measure request timetime curl -x http://localhost:7080 https://example.com -o /dev/null
# Check active connectionscurl http://localhost:7082/api/v1/statsSolutions:
-
Enable connection keep-alive
server:http:idle_timeout: "120s" -
Increase file descriptor limit
Terminal window # Check current limitulimit -n# Increase (in systemd service file)LimitNOFILE=65536 -
Use load balancing
routes:- domains: ["*"]backends:- backend1- backend2load_balance: least_conn
High Memory Usage
Section titled “High Memory Usage”Diagnostics:
# Check memory usageps aux | grep bifrost | awk '{print $6/1024 " MB"}'
# Monitor over timewatch -n 5 'ps aux | grep bifrost'Solutions:
-
Limit request log size
api:request_log_size: 500 # Reduce from default 1000 -
Disable request logging if not needed
api:enable_request_log: false
Configuration Issues
Section titled “Configuration Issues””Invalid Configuration” Error
Section titled “”Invalid Configuration” Error”Diagnostics:
# Validate configurationbifrost-server validate -c config.yamlCommon Issues:
-
Missing required fields
# Backend needs name and typebackends:- name: mybackend # Requiredtype: direct # Required -
Invalid YAML syntax
- Check indentation (use spaces, not tabs)
- Quote strings with special characters
-
Unknown backend type
- Valid types:
direct,wireguard,openvpn,http_proxy,socks5_proxy
- Valid types:
Configuration Hot-Reload Not Working
Section titled “Configuration Hot-Reload Not Working”Symptoms: Changes not applied after reload.
Check:
-
Verify reload signal received
Terminal window # Send SIGHUPkill -HUP $(pgrep bifrost-server)# Or via APIcurl -X POST http://localhost:7082/api/v1/config/reload -
Check logs for reload errors
Terminal window journalctl -u bifrost-server -f -
Some changes require restart
- Listener addresses
- TLS configuration
- Authentication mode
Authentication Issues
Section titled “Authentication Issues”Windows System Authentication Not Working
Section titled “Windows System Authentication Not Working”Symptoms: Server fails to start with error about system authentication not being supported on Windows.
Cause: System authentication (auth.mode: system) uses OS-level authentication (PAM on Linux, Directory Services on macOS). Windows is not currently supported.
Error Message:
authentication method not supported: system authentication is not supported on Windows - use native, ldap, or oauth insteadSolution:
Use a different authentication mode on Windows:
-
Native Authentication (recommended for simple setups):
auth:mode: nativenative:users:- username: adminpassword_hash: "$2a$12$..." # bcrypt hash -
LDAP Authentication (for Active Directory):
auth:mode: ldapldap:url: "ldap://your-dc.domain.com:389"base_dn: "dc=domain,dc=com"user_filter: "(sAMAccountName=%s)" -
OAuth/OIDC (for SSO):
auth:mode: oauthoauth:issuer_url: "https://auth.example.com"client_id: "..."
See the Authentication Guide for more details.
LDAP Authentication Failing
Section titled “LDAP Authentication Failing”Diagnostics:
# Test LDAP connectionldapsearch -x -H ldap://ldap.example.com -D "cn=admin,dc=example,dc=com" -W -b "dc=example,dc=com"Common Issues:
- Wrong bind DN or password
- User filter not matching
ldap:user_filter: "(uid=%s)" # For Unix-styleuser_filter: "(sAMAccountName=%s)" # For Active Directory
- TLS certificate issues
ldap:tls: trueinsecure_skip_verify: true # Only for testing!
OAuth/OIDC Issues
Section titled “OAuth/OIDC Issues”Diagnostics:
- Check redirect URL matches exactly
- Verify client ID and secret
- Check issuer URL is reachable
Logging and Debugging
Section titled “Logging and Debugging”View Logs
Section titled “View Logs”# Systemdjournalctl -u bifrost-server -f
# Dockerdocker logs -f bifrost-server
# File-basedtail -f /var/log/bifrost/server.logStructured JSON Logs
Section titled “Structured JSON Logs”logging: level: info format: json output: /var/log/bifrost/server.logParse with jq:
cat server.log | jq 'select(.level == "error")'Request Debugging
Section titled “Request Debugging”Enable request logging to see individual requests:
api: enable_request_log: true request_log_size: 1000View via API:
curl http://localhost:7082/api/v1/requests | jqGetting Help
Section titled “Getting Help”If you’re still stuck:
- Check the logs - Most issues are explained in log messages
- Enable debug logging - More verbose output helps identify issues
- Search existing issues - GitHub Issues
- Open a new issue - Include:
- Bifrost version (
bifrost-server version) - OS and version
- Configuration (sanitized)
- Relevant log output
- Steps to reproduce
- Bifrost version (