Automated backup fails but manual works

After migrating my ERP instance to a new database, I have a very strange error.

There are two different sites on the same Frappe/ERPNext instance. Both backup to S3. Before migrating to the new database, everything was fine.

Now the strange part:

One site fails with its daily backups to S3. However, if I do it manually, every is fine. Even more strange: On the other site everything works as expected. But I did not change anything besides for migrating both sites the same way to a new database.

This is the error log I receive:


Backup Upload Failed!

Oops, your automated backup to Amazon S3 failed.

Error message: Traceback (most recent call last): File "apps/frappe/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py", line 88, in take_backups_s3 backup_to_s3() File "apps/frappe/frappe/integrations/doctype/s3_backup_settings/s3_backup_settings.py", line 126, in backup_to_s3 backup = new_backup( ^^^^^^^^^^^ File "apps/frappe/frappe/utils/backups.py", line 584, in new_backup odb.get_backup(older_than, ignore_files, force=force) File "apps/frappe/frappe/utils/backups.py", line 190, in get_backup self.take_dump() File "apps/frappe/frappe/utils/backups.py", line 460, in take_dump frappe.utils.execute_in_shell(command, low_priority=True, check_exit_code=True) File "apps/frappe/frappe/utils/__init__.py", line 488, in execute_in_shell raise Exception("Command failed") Exception: Command failed

Please contact your system manager for more information.