Restore Issues
Issue: Database restore fails with permission denied
Symptoms:
psql: error: /tmp/tmp.XXXXXXX: Permission deniedCause: Temporary file permissions issue with PostgreSQL user.
Resolution:The restore script should handle this automatically by using the correct database user (triage-www).
If the issue persists:
- Verify database user exists:
id triage-www - Check PostgreSQL service:
systemctl status postgresql
Issue: ht_token validation fails
Symptoms:
[2025-12-09 14:05:00] ERROR: ht_token value in backup is empty or invalidCause: Backup archive contains invalid or missing ht_token.
Resolution: This indicates a corrupted backup. Use a different backup archive.
Issue: Restore validation fails - missing directories
Symptoms:
[2025-12-09 14:02:00] ERROR: Missing required directory: config/triage
[2025-12-09 14:02:00] ERROR: Backup validation failedCause: Corrupted or incomplete backup archive.
Resolution:
- Verify backup archive integrity:
tar -tzf amdp_mgr_backup_*.tar.gz | head -20 - Try re-transferring backup from source location.
- Create new backup from original 20.04 system if still available.
Issue: Configuration files not restored
Symptoms:
cp: cannot stat '/root/.../config/triage/*.yaml': No such file or directoryCause: Backup extraction issue or missing files in backup.
Resolution:
- Manually extract and inspect backup:
cd /tmp tar -xzf /root/amdp_mgr_backup_*.tar.gz ls -laR amdp_mgr_backup_*/ - Verify backup contains expected files.
- If files missing, create new backup from source system.
Issue: rsync fails during data restore
Symptoms:
rsync: failed to set permissions on ...: Operation not permittedCause: File ownership or permission issues.
Resolution:
- Ensure running as root:
whoami # Should show: root - Check target directory permissions:
ls -la /var/lib/triage/ - Fix ownership if needed:
chown -R triage:triage /var/lib/triage/