Skip to content

Fix "x-amz-server-side-encryption header is not supported for this operation" errors - #181

Merged
paulineribeyre merged 4 commits into
masterfrom
fix-x-amz-server-side-encryption
Aug 10, 2026
Merged

Fix "x-amz-server-side-encryption header is not supported for this operation" errors#181
paulineribeyre merged 4 commits into
masterfrom
fix-x-amz-server-side-encryption

Conversation

@paulineribeyre

@paulineribeyre paulineribeyre commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Adressing this error (Slack thread):

"level='error' msg='upload failed' error='genericS3: putting nested object s3://XYZ: x-amz-server-side-encryption header is not supported for this operation.' url='s3://XYZ'"

This seems to happen during multipart uploads.
The incoming file upload request from the Funnel worker already includes the x-amz-server-side-encryption header - it's not added by gen3-workflow
Removing the KMS Key from Funnel’s GenericS3 config (set by the Funnel plugin) fixes the issue: KMS encryption is now managed automatically by this policy.

This means we can remove the KMS key ARN from the /storage/setup endpoint response. Doing this was a TODO anyway.

Depends on uc-cdis/funnel-gen3-plugin#15 and may fail integration tests until it's merged

Link to JIRA ticket if there is one:

New Features

Breaking Changes

Bug Fixes

  • Fix x-amz-server-side-encryption header is not supported for this operation errors during some multipart uploads

Improvements

Dependency updates

Deployment changes

@github-actions

Copy link
Copy Markdown

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

# The deny in this policy fires when the headers are present but wrong (e.g. trying not to use
# KMS encryption, or trying to use a different KMS key). If the headers are absent, the request
# is accepted and AWS falls back on the bucket's default encryption (set above).
# TODO: stop specifying the KMS key in the funnel config

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ doing this TODO fixed the issue

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

async def _create_user_bucket(user_id: str) -> Tuple[str, str]:
async def _create_user_bucket(user_id: str) -> str:
"""
Create an S3 bucket for the specified user and return information about the bucket.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe update the docstring to show that only bucket_name is returned.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 31427948910

Coverage decreased (-0.2%) to 84.655%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 55 coverage regressions across 3 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

55 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
routes/s3.py 29 76.59%
aws/bucket.py 22 79.12%
routes/storage.py 4 88.33%

Coverage Stats

Coverage Status
Relevant Lines: 1160
Covered Lines: 982
Line Coverage: 84.66%
Coverage Strength: 0.85 hits per line

💛 - Coveralls

@george42-ctds george42-ctds left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 27 1 1 29
TOTAL 27 1 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@paulineribeyre
paulineribeyre merged commit 667478f into master Aug 10, 2026
12 checks passed
@paulineribeyre
paulineribeyre deleted the fix-x-amz-server-side-encryption branch August 10, 2026 20:54
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.

3 participants