# Snapshot Tool Issues
This section covers common problems and solutions when using the PanelAlpha Snapshot Tool to create, manage, and restore backups.
# Installation & Setup Issues
# Permission Denied When Running Snapshot Commands
Problem: You receive a "Permission denied" error when running snapshot commands.
Solution: Always run the snapshot tool with sudo:
sudo ./panelalpha-snapshot.sh --snapshot
The tool requires root access to:
- Access Docker containers and volumes
- Read/write system configuration files
- Create database dumps
- Manage file permissions
# Setup Wizard Fails with "Docker Not Found" Error
Problem: The setup wizard fails because Docker is not found.
Solution: Ensure Docker is installed and running:
# Check if Docker is installed
docker --version
# Start Docker service if not running
sudo systemctl start docker
sudo systemctl enable docker
# Verify Docker is working
sudo docker ps
System Requirements:
- Docker version 20.10 or higher
- At least 3 GB free disk space
# Setup Fails with "Repository Initialization Error"
Problem: The setup fails with a repository initialization error.
Solution:
- Check storage credentials in your configuration:
sudo nano /opt/panelalpha/app/.env-backup - Test the repository connection:
sudo ./panelalpha-snapshot.sh --test-connection - Verify credentials for your storage type:
- S3: Verify Access Key ID and Secret Access Key
- SFTP: Check hostname, username, and SSH key permissions
- Local: Ensure the target directory exists and has write permissions
# Backup Creation Issues
# Snapshot Creation Fails with "Database Connection Error"
Problem: Snapshot creation fails with a database connection error.
Solution:
- Verify PanelAlpha is running:
cd /opt/panelalpha/app docker compose ps - Check database credentials in PanelAlpha's environment file:
sudo cat /opt/panelalpha/app/.env | grep DB_ - Review snapshot logs for specific errors:
sudo tail -f /var/log/panelalpha-snapshot.log
# "Insufficient Disk Space" Error During Backup
Problem: Backup fails due to insufficient disk space.
Solution:
- Check available space:
df -h /var/tmp df -h /opt/panelalpha - Clean up old snapshots to free space:
# List all snapshots sudo ./panelalpha-snapshot.sh --list-snapshots # Delete specific old snapshots sudo ./panelalpha-snapshot.sh --delete-snapshots <snapshot-id> - Configure cleanup in
.env-backup:BACKUP_RETENTION_DAYS=30
# Backup Upload to S3/SFTP Fails
Problem: Backup upload to remote storage fails.
Solution:
- Test network connectivity:
sudo ./panelalpha-snapshot.sh --test-connection - Check credentials and permissions:
- S3: Verify the bucket exists and the IAM user has write permissions
- SFTP: Ensure the SSH key has correct permissions (
600) and the user can write to the target directory
- Review connection settings:
sudo nano /opt/panelalpha/app/.env-backup
# Restoration Issues
# Restore Fails with "Snapshot Not Found"
Problem: The restore process cannot find the specified snapshot.
Solution:
- Verify the snapshot exists:
sudo ./panelalpha-snapshot.sh --list-snapshots - Check the repository connection:
sudo ./panelalpha-snapshot.sh --test-connection - Use the correct snapshot ID format:
# Correct format (use actual ID from list-snapshots) sudo ./panelalpha-snapshot.sh --restore a1b2c3d4 # Or restore latest sudo ./panelalpha-snapshot.sh --restore latest
# After Restoration, PanelAlpha Does Not Start Correctly
Problem: PanelAlpha does not start correctly after a restore.
Solution:
- Check Docker container status:
cd /opt/panelalpha/app docker compose ps docker compose logs - Verify database connectivity:
docker compose exec database mysql -u root -p - Restart all services:
cd /opt/panelalpha/app docker compose down docker compose up -d - Check file permissions:
sudo chown -R 1000:1000 /opt/panelalpha/app/storage
# Restored Instance Shows Wrong Domain/IP Addresses
Problem: The restored instance shows incorrect domain or IP addresses.
Solution: The restore process should automatically update IP addresses. If needed:
- Update trusted hosts in PanelAlpha admin:
- Go to Admin Area → Configuration → General
- Update Trusted Hosts with the new server IP or domain
- Clear the application cache:
cd /opt/panelalpha/app docker compose exec api php artisan cache:clear docker compose exec api php artisan config:clear
# Automation Issues
# Automatic Backups Are Not Running
Problem: Scheduled automatic backups are not running.
Solution:
- Check cron job status:
sudo ./panelalpha-snapshot.sh --cron status - Verify the cron service is running:
sudo systemctl status cron - Check cron logs:
sudo journalctl -u cron -f sudo tail -f /var/log/panelalpha-snapshot.log - Reinstall automation if needed:
sudo ./panelalpha-snapshot.sh --cron remove sudo ./panelalpha-snapshot.sh --cron install
# Automated Backups Fail but Manual Backups Work
Problem: Automated backups fail while manual backups succeed.
Solution:
- Check environment variables in the cron context:
sudo crontab -l - Verify log file permissions:
sudo ls -la /var/log/panelalpha-snapshot.log sudo chmod 644 /var/log/panelalpha-snapshot.log - Test with full paths in the cron job:
sudo crontab -e
# Configuration Issues
# How to Change Backup Storage Location After Setup
Problem: You need to change the backup storage location after initial setup.
Solution:
- Run the setup wizard again:
sudo ./panelalpha-snapshot.sh --setup - Or manually edit the configuration:
sudo nano /opt/panelalpha/app/.env-backup - Test the new configuration:
sudo ./panelalpha-snapshot.sh --test-connection
# How to Change Backup Schedule
Problem: You need to change the backup schedule.
Solution:
- Edit the backup hour setting:
sudo nano /opt/panelalpha/app/.env-backup # Modify: BACKUP_HOUR=2 (for 2 AM) - Reinstall the cron job to apply changes:
sudo ./panelalpha-snapshot.sh --cron remove sudo ./panelalpha-snapshot.sh --cron install
# Security & Access Issues
# "Access Denied" Errors When Accessing S3 Storage
Problem: You receive "Access denied" errors when accessing S3 storage.
Solution:
- Verify IAM permissions for your S3 user:
s3:ListBucketon the buckets3:GetObjectands3:PutObjecton bucket contentss3:DeleteObjectfor cleanup operations
- Check AWS credentials:
sudo nano /opt/panelalpha/app/.env-backup # Verify AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY - Test with AWS CLI (if available):
aws s3 ls s3://your-bucket-name/ --region your-region
# SFTP Authentication Fails
Problem: SFTP authentication fails during backup operations.
Solution:
- Check SSH key permissions:
sudo chmod 600 /path/to/ssh/key sudo chown root:root /path/to/ssh/key - Test the SSH connection manually:
ssh -i /path/to/ssh/key user@hostname - Verify the user has write permissions on the target directory.
# Performance Issues
# Backups Take Too Long to Complete
Problem: Backups take an excessive amount of time to complete.
Solution:
- Check available resources:
htop df -h iostat -x 1 - Use incremental backups for large installations:
- Modify the backup strategy in configuration
- Keep fewer full backups and more incrementals
- Optimize the storage location:
- Use local storage for faster initial backups
- Consider a faster network connection for remote storage
# System Becomes Slow During Backup Operations
Problem: The system slows down significantly during backups.
Solution:
- Schedule backups during low-usage hours:
# Edit backup hour in configuration sudo nano /opt/panelalpha/app/.env-backup BACKUP_HOUR=3 # 3 AM - Monitor system resources during backup:
sudo iotop sudo nethogs - Consider I/O limits if running on shared infrastructure.
# Monitoring & Maintenance
# How to Monitor Backup Success or Failure
Problem: You need to monitor whether backups succeed or fail.
Solution:
- Check recent backup logs:
sudo tail -f /var/log/panelalpha-snapshot.log - Set up log monitoring with your preferred tool.
- Create notification scripts that parse log output.
- Run regular health checks:
sudo ./panelalpha-snapshot.sh --cron status sudo ./panelalpha-snapshot.sh --list-snapshots
# Getting Additional Help
If none of these solutions resolve your issue:
- Collect comprehensive logs:
sudo tar -czf snapshot-logs.tar.gz /var/log/panelalpha-snapshot.log /opt/panelalpha/app/.env-backup - Document the issue:
- Exact error messages
- Steps to reproduce
- System information (
uname -a,docker --version)
- Contact support with detailed information for faster resolution.
Prevention is better than cure: Regularly test your backup and restoration process in a staging environment to ensure everything works before you need it in production.