7 KiB
Troubleshooting Guide
This guide covers common issues and their solutions when using ComposeSync.
Service Issues
Service Won't Start
Problem: The ComposeSync service fails to start.
Solutions:
-
Check service status:
sudo systemctl status composesync -
Check logs for errors:
sudo journalctl -u composesync -n 50 -
Verify user permissions:
# Ensure the service user is in the docker group groups YOUR_USERNAME -
Check file permissions:
# Ensure the service user owns the ComposeSync directory ls -la /opt/composesync/ sudo chown -R YOUR_USERNAME:docker /opt/composesync/
Service Crashes or Stops Unexpectedly
Problem: The service runs but crashes or stops unexpectedly.
Solutions:
-
Check for configuration errors:
sudo journalctl -u composesync -f -
Verify your
.envfile syntax:# Check for syntax errors source /opt/composesync/.env -
Test with dry-run mode:
DRY_RUN=true
Download Issues
Failed Downloads
Problem: ComposeSync fails to download compose files.
Solutions:
-
Check network connectivity:
# Test if the URL is accessible wget -q --spider https://your-url.com/docker-compose.yml echo $? -
Verify URLs in your configuration:
# Check your .env file grep STACK_.*_URL /opt/composesync/.env -
Check for authentication requirements:
- Some URLs may require authentication
- Consider using Git repositories instead
Git Repository Issues
Problem: Git operations fail.
Solutions:
-
Verify repository access:
# Test git clone manually git clone --quiet https://github.com/user/repo.git /tmp/test -
Check Git subpath configuration:
# Ensure the subpath exists in the repository git ls-tree -r --name-only HEAD | grep docker-compose.yml -
Verify branch/tag exists:
# List available branches/tags git ls-remote --heads https://github.com/user/repo.git git ls-remote --tags https://github.com/user/repo.git
Docker Compose Issues
Update Failures
Problem: Docker Compose updates fail and trigger rollback.
Solutions:
-
Check Docker Compose syntax:
# Validate compose file manually docker compose -f /path/to/docker-compose.yml config -
Check for port conflicts:
# Check what's using the ports netstat -tulpn | grep :80 -
Verify override file syntax:
# Test with override file docker compose -f docker-compose.yml -f docker-compose.override.yml config
Rollback Failures
Problem: Both the update and rollback fail.
Solutions:
-
Check backup files:
# Verify backups exist ls -la /opt/composesync/stacks/*/backups/ -
Manual rollback:
# Manually restore from backup cp /opt/composesync/stacks/stackname/backups/backup-*/docker-compose.yml /opt/composesync/stacks/stackname/ -
Check Docker daemon:
# Ensure Docker is running sudo systemctl status docker
Configuration Issues
Missing Environment Variables
Problem: Required configuration is missing.
Solutions:
-
Check your
.envfile:# Verify all required variables are set grep -E "STACK_.*_(NAME|URL|PATH|TOOL)" /opt/composesync/.env -
Check variable syntax:
# Look for syntax errors cat -n /opt/composesync/.env
Invalid Paths
Problem: Stack paths don't exist or are inaccessible.
Solutions:
-
Create missing directories:
# Create stack directories sudo mkdir -p /opt/composesync/stacks/stackname sudo chown YOUR_USERNAME:docker /opt/composesync/stacks/stackname -
Check permissions:
# Verify directory permissions ls -la /opt/composesync/stacks/
Webhook Issues
Webhook Notifications Not Sent
Problem: Webhook notifications aren't being sent.
Solutions:
-
Check webhook URL:
# Verify URL is set grep NOTIFICATION_WEBHOOK_URL /opt/composesync/.env -
Test webhook manually:
# Test webhook endpoint curl -X POST -H "Content-Type: application/json" \ -d '{"test": "message"}' \ https://your-webhook-url.com/endpoint -
Check network connectivity:
# Test if webhook URL is accessible wget -q --spider https://your-webhook-url.com/endpoint
Performance Issues
High Resource Usage
Problem: ComposeSync uses too much CPU or memory.
Solutions:
-
Increase update intervals:
UPDATE_INTERVAL_SECONDS=7200 # Check every 2 hours instead of 1 -
Reduce version history:
KEEP_VERSIONS=5 # Keep fewer versions -
Use dry-run mode for testing:
DRY_RUN=true
Slow Downloads
Problem: Downloads are taking too long.
Solutions:
-
Check network connectivity:
# Test download speed wget -O /dev/null https://your-url.com/docker-compose.yml -
Consider using Git instead of wget:
STACK_1_TOOL=git
Lock File Issues
Stale Lock Files
Problem: Lock files prevent updates.
Solutions:
-
Check for stale locks:
# Look for lock files find /opt/composesync/stacks/ -name ".lock" -type d -
Remove stale locks manually:
# Remove lock file (be careful!) rm -rf /opt/composesync/stacks/stackname/.lock -
Restart the service:
sudo systemctl restart composesync
Debugging Tips
Enable Verbose Logging
For detailed debugging, you can temporarily modify the log function:
# Edit the update-agent.sh file
sudo nano /opt/composesync/update-agent.sh
# Add more verbose logging
log() {
local prefix=""
if [ "$DRY_RUN" = "true" ]; then
prefix="[DRY-RUN] "
fi
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ${prefix}$1" | tee -a /tmp/composesync-debug.log
}
Test Individual Components
-
Test download function:
# Test wget download wget -q -O /tmp/test.yml https://your-url.com/docker-compose.yml -
Test Docker Compose:
# Test compose file manually docker compose -f /path/to/docker-compose.yml config -
Test webhook:
# Test webhook manually curl -X POST -H "Content-Type: application/json" \ -d '{"event": "test"}' \ $NOTIFICATION_WEBHOOK_URL
Getting Help
If you're still experiencing issues:
-
Check the logs:
sudo journalctl -u composesync -f -
Enable dry-run mode to test without making changes:
DRY_RUN=true -
Verify your configuration step by step
-
Check the documentation for your specific use case
-
Submit an issue with:
- Your configuration (with sensitive data removed)
- Relevant log output
- Steps to reproduce the issue
- Expected vs actual behavior