-
Notifications
You must be signed in to change notification settings - Fork 357
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
Bucket Policy upload fails due to GetBucketRequestPayment not being implemented (Ceph) #2447
Comments
As I can see, the necessary code is just being reworked by @tremble . 0030805 I ran into a similar issue when trying with Hetzner Object storage. The service returns HTTP Code 501 Not Implemented. But the library does not parse this as expected. @tremble Can you add Code "501" to the list of Errors that are detected as
In plugins/module_utils/_s3/common.py I also asked Hetzner to change their response to follow the AWS S3 error specification |
I can. Would you be able to test it afterwards? Mark |
@tremble I just tested it by installing the collection from git and editing the This works now: - name: Set S3 bucket policy
delegate_to: localhost
amazon.aws.s3_bucket:
name: "{{ s3_bucket_name }}"
endpoint_url: "{{ s3_endpoint }}"
aws_access_key: "{{ s3_access_key }}"
aws_secret_key: "{{ s3_secret_key }}"
policy: "{{ lookup('template', s3_policy_file) }}"
state: present
region: nbg1
ansible-playbook output (redacted): TASK [s3_backup : Set S3 bucket policy] *********************************************
task path: /Users/philipp/git/example/example-ansible/roles/s3_backup/tasks/bucket_policy.yml:8
[WARNING]: Failed to get bucket request payment settings (not supported by cloud)
[WARNING]: Failed to get bucket tags (not supported by cloud)
[WARNING]: Failed to get bucket ownership settings (not supported by cloud)
[WARNING]: Failed to get bucket encryption settings (not supported by cloud)
[WARNING]: Failed to get bucket inventory settings (not supported by cloud)
changed: [backup3.example.com -> localhost] => changed=true
accelerate_enabled: null
acl: private
acl_grants:
- grantee:
display_name: p1234
id: p1234
type: CanonicalUser
permission: FULL_CONTROL
bucket_inventory: null
encryption: null
invocation:
module_args:
accelerate_enabled: null
access_key: KEY
acl: null
aws_access_key: FOO
aws_ca_bundle: null
aws_config: null
aws_secret_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
bucket_key_enabled: null
ceph: false
debug_botocore_endpoint_logs: false
delete_object_ownership: false
delete_public_access: false
dualstack: false
encryption: null
encryption_key_id: null
endpoint_url: https://nbg1.your-objectstorage.com
force: false
inventory: null
name: example-testbucket3
object_lock_default_retention: null
object_lock_enabled: null
object_ownership: null
policy: '{"Version": "2012-10-17", "Statement": [{"Effect": "Allow", "Principal": {"AWS": "arn:aws:iam:::user/p123412:ASDFASDFASDF"}, "Action": ["s3:GetObject", "s3:GetObjectVersion", "s3:ListBucket", "s3:GetBucketLocation"], "Resource": ["arn:aws:s3:::example-testbucket3", "arn:aws:s3:::example-testbucket3/*"]}]}'
profile: null
public_access: null
purge_tags: true
region: nbg1
requester_pays: null
secret_key: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
session_token: null
state: present
tags: null
validate_bucket_name: true
validate_certs: true
versioning: null
name: example-testbucket3
object_lock_default_retention: {}
object_lock_enabled: false
object_ownership: null
policy:
Statement:
- Action:
- s3:GetObject
- s3:GetObjectVersion
- s3:ListBucket
- s3:GetBucketLocation
Effect: Allow
Principal:
AWS: arn:aws:iam:::user/p123412:ASDFASDFASDF
Resource:
- arn:aws:s3:::example-testbucket3
- arn:aws:s3:::example-testbucket3/*
Version: '2012-10-17'
public_access_block:
BlockPublicAcls: false
BlockPublicPolicy: false
IgnorePublicAcls: false
PublicAccessBlockConfiguration:
BlockPublicAcls: false
BlockPublicPolicy: false
IgnorePublicAcls: false
RestrictPublicBuckets: false
RestrictPublicBuckets: false
block_public_acls: false
block_public_policy: false
ignore_public_acls: false
restrict_public_buckets: false
tags: {}
requester_pays: null
tags: null
versioning:
MFADelete: Disabled
MfaDelete: Disabled
Status: Disabled
Versioning: Disabled
response_metadata:
host_id: ''
http_headers:
content-length: '137'
content-type: application/xml
date: Tue, 04 Feb 2025 01:00:17 GMT
strict-transport-security: max-age=63072000
x-amz-request-id: tx000007e7f74afc98f94df-0067a166a1-11de7b9-nbg1-prod1-ceph3
x-debug-backend: nbg1-prod1-ceph3
x-debug-bucket: example-testbucket3
http_status_code: 200
request_id: tx000007e7f74afc98f94df-0067a166a1-11de7b9-nbg1-prod1-ceph3
retry_attempts: 0
tags: {} |
This issue has been fixed by #2478. This should be available at the latest when we release 10.0.0 (early May). I'm currently delaying the backport until I've also updated the other S3 modules to use the new error handling, so it likely won't make 9.2.0 but might make 9.3.0 |
… error codes (#2508) SUMMARY As per #2447 "Hetzner Object storage" throws a 501 (HTTP Error - Not Implemented) rather than the standard NotImplemented error. ISSUE TYPE Feature Pull Request COMPONENT NAME module_utlis.s3 ADDITIONAL INFORMATION Reviewed-by: GomathiselviS <[email protected]>
This particular issue was fixed by #2508 |
Summary
When I try to upload a bucket policy to Hetzner Object Storage (Ceph), it fails due to
GetBucketRequestPayment
not being implemented. The module documentation states it should not fail whenrequester_pays
is set tofalse
, but this also doesn't seem to work for me. Am I missing something?Issue Type
Bug Report
Component Name
s3_bucket
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
MacOS 15.2 (arm64)
Steps to Reproduce
Expected Results
The playbook should be applied successfully
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: