You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backups can be ran using sde_collections/management/commands/database_backup.py. There are instructions for using it in different environments at the top of the file.
However, although it works seamlessly on local, it is encountering a permission error on server environments, such as Staging and Production.
Here is the error for reference
[ec2-user@STAGING sde-indexing-helper]$ docker-compose -f production.yml run --rm django python manage.py database_backup
WARN[0000] volume "sde-indexing-helper_production_postgres_data" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume
WARN[0000] volume "sde-indexing-helper_production_postgres_data_backups" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume
WARN[0000] volume "sde-indexing-helper_production_traefik" already exists but was not created by Docker Compose. Use `external: true` to use an existing volume
WARN[0000] Found orphan containers ([sde_indexing_helper_local_redis]) forthis project. If you removed or renamed this servicein your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 1/0
⠿ Container sde-indexing-helper-postgres-1 Running 0.0s
PostgreSQL is available
pg_dump: error: could not open output file "/app/backups/staging_backup_20250225.sql": Permission denied
Backup failed: Command '['pg_dump', '-h', 'sde-indexing-helper-staging-db.c3cr2yyh5zt0.us-east-1.rds.amazonaws.com', '-U', 'postgres', '-d', 'sde_staging', '--no-owner', '--no-privileges', '-f', '/app/backups/staging_backup_20250225.sql']' returned non-zero exit status 1.
Implementation Considerations
may need to be able to log onto the server in order to actually test the command
Deliverable
The backup code should be updated such that it no longer produces a permission error on severs.
Dependencies
depends on
The text was updated successfully, but these errors were encountered:
Modify the get_backup_filename() function to set appropriate directory permissions.
backup_dir="/app/backups"os.makedirs(backup_dir, exist_ok=True)
#Set permissions: Owner and group can read/write, others have no accessos.chmod(backup_dir, 0o770)
Description
Backups can be ran using sde_collections/management/commands/database_backup.py. There are instructions for using it in different environments at the top of the file.
However, although it works seamlessly on local, it is encountering a permission error on server environments, such as Staging and Production.
Here is the error for reference
Implementation Considerations
Deliverable
The backup code should be updated such that it no longer produces a permission error on severs.
Dependencies
depends on
The text was updated successfully, but these errors were encountered: