mirror of
https://github.com/quintusl/rust-socksd.git
synced 2026-11-13 16:17:46 +00:00
3.2 KiB
3.2 KiB
Troubleshooting Guide
This guide helps resolve common issues encountered while deploying or running rust-socksd.
Common Issues
1. Permission Denied
- Symptoms: The server crashes on startup with a filesystem read or write error, or fails to load
users.ymlorconfig.yml. - Causes: The dedicated service user (e.g.,
rust-socksdor Docker'sappuser) does not have read permissions for the configuration files or write permissions for the log directories. - Solutions:
- Grant read permissions on configuration files to the running user:
sudo chown -R rust-socksd:rust-socksd /etc/rust-socksd sudo chmod 640 /etc/rust-socksd/config.yml - For Docker, ensure the mounted directory has the correct user ownership matching UID/GID
1001.
- Grant read permissions on configuration files to the running user:
2. Port Already in Use
- Symptoms: Startup failure with:
Address already in use(OS Error 98 or 48). - Causes: Another service (or an existing instance of
rust-socksd) is already bound to the requested port (SOCKS51080, HTTP8080, or Admin8081). - Solutions:
- Identify the process utilizing the port:
# Linux sudo ss -lntp | grep -E '1080|8080|8081' # macOS sudo lsof -i -P -n | grep -E '1080|8080|8081' - Change the ports in
config.ymlor supply port override flags (e.g.--socks5-port 1082).
- Identify the process utilizing the port:
3. Connection Refused
- Symptoms: Clients cannot connect to the proxy and report "Connection Refused".
- Causes:
- The proxy is configured to bind to
127.0.0.1and the client is attempting to connect from a different network interface. - A local firewall (like
ufw,iptables, or macOS Application Firewall) is blocking the ports.
- The proxy is configured to bind to
- Solutions:
- Set
server.bind_addressto0.0.0.0inconfig.ymlto listen on all interfaces. - Allow proxy ports through your firewall:
# UFW (Ubuntu/Debian) sudo ufw allow 1080/tcp sudo ufw allow 8080/tcp
- Set
4. Authentication Failures
- Symptoms: Client requests fail with
407 Proxy Authentication Required(HTTP) or connection close (SOCKS5). - Causes:
- Password hashes mismatch.
- Configuration file path for
user_config_fileis incorrect or unreadable. - External auth backends (LDAP, Database) are unreachable or search queries are invalid.
- Solutions:
- For the
simplebackend, check user lists:rust-socksd user --user-config users.yml list - For LDAP or DB backends, inspect the database logs or verify query logic against the schema (e.g., column names and parameter placeholders
?vs$1depending on db type).
- For the
Debugging
Enable verbose debug or trace logging to see detailed logs of connection processing:
Via Command Line
Pass the -v (debug) or -vv (trace) verbose flags:
rust-socksd --config config.yml -v
Via Configuration
Update the logging block in config.yml:
logging:
level: "debug" # or "trace"
console: true
Log Inspection
Systemd Service
For systemd daemon deployments, stream live service logs:
sudo journalctl -u rust-socksd -f
Log File
If file logging is configured, tail the log file:
tail -f /var/log/rust-socksd/rust-socksd.log