Agent Troubleshooting
Diagnostic Command
Run the built-in diagnostic tool first:
jokowipe-agent doctor
# ✓ Binary: jokowipe-agent v1.2.0
# ✓ Config: /etc/jokowipe/agent.yaml (valid)
# ✓ Token: valid format
# ✓ API: https://api.jokowipe.id reachable (23ms)
# ✓ Authentication: OK (agent-a1b2c3)
# ✓ pg_dump: found (v16.1)
# ✗ mongodump: not found
# ✓ Storage (S3): accessible (bucket: my-backups)
# ✓ Temp disk space: 45 GB free
Common Issues
Agent Won't Connect
Symptom: ERROR: failed to connect to api.jokowipe.id
Checklist:
- Test network connectivity:
curl -v https://api.jokowipe.id/health - Check firewall rules — outbound 443/TCP must be allowed
- Check DNS resolution:
nslookup api.jokowipe.id - Check for proxy: set
HTTPS_PROXYif needed
# Test API reachability
curl -v https://api.jokowipe.id/health
# {"status":"ok","version":"1.5.0"}
With proxy:
agent:
server_url: "https://api.jokowipe.id"
proxy: "http://proxy.internal:8080"
Authentication Fails
Symptom: ERROR: 401 Unauthorized — invalid or expired token
Steps:
- Verify the token is correctly set:
echo $JOKOWIPE_AGENT_TOKEN | head -c 20 - Check the token hasn't been revoked in the dashboard (Settings → Agents)
- Generate a new token and update the config
Backup Tool Not Found
Symptom: ERROR: pg_dump: command not found
Install the missing tool:
# Ubuntu/Debian
sudo apt-get install postgresql-client-16
# Check that it's in PATH
which pg_dump
pg_dump --version
Alternatively, specify the full path in config:
database:
options:
pg_dump_path: "/usr/lib/postgresql/16/bin/pg_dump"
Database Connection Refused
Symptom: ERROR: could not connect to server: Connection refused
Checklist:
- Verify database is running:
pg_isready -h localhost -p 5432 - Verify the connection string is correct
- Check that the backup user exists and has correct permissions
- Check
pg_hba.confallows connections from the agent's IP
Storage Upload Fails
Symptom: ERROR: AccessDenied when calling PutObject
Checklist:
- Verify IAM permissions include
s3:PutObject - Check the bucket name and region are correct
- Verify credentials are not expired
- Test manually:
aws s3 ls s3://my-backups/
Backup Job Times Out
Symptom: ERROR: backup job exceeded timeout (6h)
For very large databases:
agent:
backup_timeout: 12h # Increase timeout
Also consider:
- Running backups during off-peak hours
- Excluding large non-critical tables
- Upgrading to a machine with faster disk/network
Disk Full During Backup
Symptom: ERROR: no space left on device
The agent writes the backup to a temp directory before uploading. Ensure /var/tmp has at least 2x the database size.
Change the temp directory:
agent:
temp_dir: /mnt/large-disk/jokowipe-tmp
Viewing Logs
# systemd logs (last 100 lines)
sudo journalctl -u jokowipe-agent -n 100
# Follow logs in real-time
sudo journalctl -u jokowipe-agent -f
# Logs for a specific time range
sudo journalctl -u jokowipe-agent --since "2024-01-15 02:00:00" --until "2024-01-15 03:00:00"
Enable Debug Logging
agent:
log_level: debug
Or via environment variable:
JOKOWIPE_LOG_LEVEL=debug jokowipe-agent start
Debug logs include full HTTP request/response details, which is helpful for diagnosing API connectivity issues.
Getting Support
If you can't resolve the issue:
- Run
jokowipe-agent support-bundleto collect diagnostic info - Open a support ticket at app.jokowipe.id/support
- Attach the support bundle (it contains no secrets)
jokowipe-agent support-bundle --output ./jokowipe-support.zip
# Creates jokowipe-support.zip with:
# - Agent version and config (credentials redacted)
# - Last 500 log lines
# - System info (OS, memory, disk)
# - Network connectivity test results