fix: publish_muse_release.sh failed against production on two counts
Discovered live while publishing muse 0.2.1rc4 to production:
1. Every aws ssm call had no --profile at all, so it silently ran under the ambient default credentials (musehub-infra, the Nonproduction account) regardless of $ENV. Production's instance lives in a separate AWS account with no static IAM user by design -- the resulting error, 'InvalidInstanceId ... not in a valid state for account', looks like a broken instance rather than a missing --profile. Fixed by resolving PROFILE_ARGS per environment (empty for staging, --profile musehub-production for production) and applying it to every aws ssm send-command/get-command-invocation call. S3 calls deliberately keep using the ambient default credentials in both cases -- the release bucket is a single shared, public-read bucket, not per-environment.
2. Once (1) was fixed and the SSM call reached the right account, the remote command's own `aws s3 cp` (authenticated via the production instance's IAM role) got '403 Forbidden' on HeadObject -- confirmed via direct diagnostics on the instance that an anonymous curl and `aws s3 cp --no-sign-request` both succeeded (200 OK) while the signed request using the instance role did not. An explicit IAM deny (an account-level guardrail) overrides the bucket's public Allow for authenticated principals; anonymous requests never touch IAM at all. Fixed by adding --no-sign-request to the remote download, matching how install.sh itself fetches releases over plain HTTPS with no credentials -- the bucket is deliberately public-read, so there was never a reason to authenticate for this GET in the first place.
Tests: tests/test_deployment.py::TestPublishMuseReleaseProfile -- five tests: PROFILE_ARGS resolves correctly per environment (extracted via the real case-statement source, executed in a subprocess), every aws ssm call site actually passes "${PROFILE_ARGS[@]}" (regex count match, guards against a new call site being added without it), S3 calls never use it, and the remote CMD's aws s3 cp includes --no-sign-request. Full tests/test_deployment.py sweep: 42 passed.
Verified for real, not just via tests: reran the actual publish against production after each fix -- first attempt failed with the account error, second with the 403, third (both fixes applied) succeeded end to end including all 20 smoke_muse.sh checks against https://musehub.ai. muse 0.2.1rc4 is now live on both staging and production.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
9 symbols
Files Changed
~2
1075 in snapshot
0 comments
muse hub commit comment sha256:4c406127fd42cddb7bd2282519704e86a5ed7129fe2682617e23821e2bddb259 --body "your comment"
No comments yet. Be the first to start the discussion.