Skip to content

STAC-25087 restore: fail on missing StackPacks; drop S3 prefix on local-bucket download#31

Open
viliakov wants to merge 1 commit into
mainfrom
STAC-25087-restore-script-fixes
Open

STAC-25087 restore: fail on missing StackPacks; drop S3 prefix on local-bucket download#31
viliakov wants to merge 1 commit into
mainfrom
STAC-25087-restore-script-fixes

Conversation

@viliakov

Copy link
Copy Markdown
Contributor

Summary

Two fixes to the restore shell scripts under internal/scripts/scripts/ that ship inside the restore Job images.

restore-settings-backup.sh

  • Drop BACKUP_CONFIGURATION_S3_PREFIX from the local-bucket StackPacks download. The local (in-cluster) bucket does not use the configurable prefix at backup time, so the previous path included a prefix that was never written. That made the local-bucket lookup miss, the script silently fell through to the warning-and-skip branch, and the operator never saw a real failure. Prefix is still applied to the remote-bucket fallback, which is where it belongs.
  • Fail when the StackPacks backup is missing. Previously the script printed a WARNING and exit 0 when neither the local nor remote bucket had the StackPacks companion file. The settings restore had already succeeded, so the Job reported success and the missing StackPacks went unnoticed. Now it logs ERROR and exits non-zero so the Job fails and the operator decides how to proceed.

restore-stackgraph-backup.sh

  • Fail when the StackPacks backup is missing. Same pattern, different script: the ls probe's else branch silently warned and fell through, so the Job exited 0 even though StackPacks restore did not run. Inverted to fail fast with ERROR + exit 1.

Both scripts already have set -Eeuo pipefail, so the explicit exit 1 is what flips the previously-silent skip into a hard failure.

Locally verified by the reporter.

Test plan

  • Trigger a settings restore against a deployment configured with a local bucket, with the StackPacks companion present — restore completes successfully end to end.
  • Trigger a settings restore where the StackPacks companion file is intentionally missing — restore Job fails with the ERROR: StackPacks backup ... not found line.
  • Trigger a StackGraph restore where the StackPacks companion file is intentionally missing — restore Job fails with the ERROR: StackPacks backup ... not found in S3 line.

Jira: https://stackstate.atlassian.net/browse/STAC-25087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant