[Bug]: backup via cron scheduling fails when s3 upload is not configured #38807
Labels
Bug
Something isn't working
Medium
Issues that frustrate users due to poor UX
Needs Triaging
Needs attention from maintainers to triage
Production
Is there an existing issue for this?
Description
When automated backups are configured by specifying a cron schedule in the environment variable (https://docs.appsmith.com/getting-started/setup/environment-variables#automatic-backups), the scheduled task assumes that uploading to S3 (https://docs.appsmith.com/getting-started/setup/instance-management/backup-and-restore/sync-backup-to-s3) should be done. But if the user, for any reason, decides to not setup S3 uploads, the backup fails and is removed from the filesystem.
This happens because the upload to S3 fails, that error is (rightfully) treated as a failure and the error is attempted to be sent to admins and the files are deleted: https://github.com/appsmithorg/appsmith/blob/release/app/client/packages/rts/src/ctl/backup/index.ts#L72-L77
The cleanup logic was added here: https://github.com/appsmithorg/appsmith/pull/37715/files
Steps To Reproduce
APPSMITH_BACKUP_CRON_EXPRESSION="*/5 * * * *"
(example to make it happen every 5 minutes)/appsmith-stacks/data/backup/
in the containerYou'll also see errors in
/appsmith-stacks/logs/appsmithctl/backup.log
like:Public Sample App
No response
Environment
Production
Severity
Medium (Frustrating UX)
Issue video log
No response
Version
1.55
The text was updated successfully, but these errors were encountered: