Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: backup via cron scheduling fails when s3 upload is not configured #38807

Open
1 task done
wyattwalter opened this issue Jan 22, 2025 · 0 comments
Open
1 task done
Assignees
Labels
Bug Something isn't working Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production

Comments

@wyattwalter
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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

  1. Deploy Appsmith business with environment variable APPSMITH_BACKUP_CRON_EXPRESSION="*/5 * * * *" (example to make it happen every 5 minutes)
  2. Do not configure S3
  3. Observe that backups are not being written to /appsmith-stacks/data/backup/ in the container

You'll also see errors in /appsmith-stacks/logs/appsmithctl/backup.log like:

2025-01-22T19:13:23.596Z [ INFO ] Finished taking a backup at /appsmith-stacks/data/backup/appsmith-backup-2025-01-22T19-13-18.240Z.tar.gz.enc
2025-01-22T19:15:00.308Z [ ERROR ] Error: Failed to upload archive: S3 credentials are not configured
    at uploadArchiveToS3Bucket (/opt/appsmith/src/ctl/aws.ts:81:11)
    at run (/opt/appsmith/src/ctl/backup/index.ts:52:17)
2025-01-22T19:20:00.296Z [ ERROR ] Error: Failed to upload archive: S3 credentials are not configured
    at uploadArchiveToS3Bucket (/opt/appsmith/src/ctl/aws.ts:81:11)
    at run (/opt/appsmith/src/ctl/backup/index.ts:52:17)
2025-01-22T19:25:00.305Z [ ERROR ] Error: Failed to upload archive: S3 credentials are not configured
    at uploadArchiveToS3Bucket (/opt/appsmith/src/ctl/aws.ts:81:11)
    at run (/opt/appsmith/src/ctl/backup/index.ts:52:17)
2025-01-22T19:30:00.309Z [ ERROR ] Error: Failed to upload archive: S3 credentials are not configured
    at uploadArchiveToS3Bucket (/opt/appsmith/src/ctl/aws.ts:81:11)
    at run (/opt/appsmith/src/ctl/backup/index.ts:52:17)

Public Sample App

No response

Environment

Production

Severity

Medium (Frustrating UX)

Issue video log

No response

Version

1.55

@wyattwalter wyattwalter added Bug Something isn't working Needs Triaging Needs attention from maintainers to triage labels Jan 22, 2025
@Nikhil-Nandagopal Nikhil-Nandagopal added Medium Issues that frustrate users due to poor UX Production labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Medium Issues that frustrate users due to poor UX Needs Triaging Needs attention from maintainers to triage Production
Projects
None yet
Development

No branches or pull requests

4 participants