s3_bucket module: fix failed to get bucket tags (NoSuchTagSetError)#150
s3_bucket module: fix failed to get bucket tags (NoSuchTagSetError)#150tremble merged 3 commits intoansible-collections:mainfrom
Conversation
According to Amazon's documentation [1] the error code returned
when no tag set can be found is NoSuchTagSetError rather than
NoSuchTagSet.
Associated error:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (NoSuchTagSetError) when calling the GetBucketTagging operation: Unknown
fatal: [abc]: FAILED! => changed=false
boto3_version: 1.14.49
botocore_version: 1.17.49
error:
bucket_name: abc
code: NoSuchTagSetError
msg: 'Failed to get bucket tags: An error occurred (NoSuchTagSetError) when calling the GetBucketTagging operation: Unknown'
response_metadata:
host_id: ''
http_headers:
accept-ranges: bytes
content-length: '229'
content-type: application/xml
date: Thu, 27 Aug 2020 07:11:11 GMT
strict-transport-security: max-age=31536000; includeSubDomains
x-amz-request-id: tx0000000000000003aaad6-005f475c8f-36fd35b6f-rma1
http_status_code: 404
request_id: tx0000000000000003aaad6-005f475c8f-36fd35b6f-rma1
retry_attempts: 0
[1]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html
tremble
left a comment
There was a problem hiding this comment.
Hi @pgerber,
many thanks for taking the time to submit this Pull Request, it's very much appreciated.
As well as the use of is_boto3_error_code there are two other things it would be helpful if you could add to your PR:
- Please add a changelog fragment https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to
- We have a set of integration tests for this module (tests/integration/targets/s3_bucket) while they're not perfect (we didn't catch this) it would be good if you could update them to include testing of the bug fixed by this PR. This would also help avoid a future regression of the issue.
|
Well, that's interesting: It would appear that a test case was in place for this, This change resulted in the following errors from our integration tests: Do you have the rest of the output from the error you triggered? Mark |
|
There is one thing I should probably have mentioned. I'm using an S3-compatible API provided by Ceph rather than Amazon's implementation. I guess there could be some minor differences but I assumed the fix to be correct as Amazon in fact states Verison: Verbose output: |
|
That would make sense. Amazon's error codes are unfortunately a little inconsistent. I suspect that this is actually a documentation bug which has then propagated into Ceph as behaviour that differs between Ceph and AWS. Where practical we do try to ensure that the S3 modules cooperate with both the AWS implementations and non-AWS equivalents (for all the pain that generates with testing and bugs). What I'd suggest then is
Once that's in place we should be able to get this tested and merged. |
tremble
left a comment
There was a problem hiding this comment.
Looks good. Thank you for your contribution.
This is what the error code used by the AWS implementation. The Documentation indeed calls it NoSuchTagSetError, like Ceph, but I believe it to be more sensible to actually follow the implementation. See also ansible-collections/amazon.aws#150
This is what the error code used by the AWS implementation. The Amazon's documentation indeed calls it NoSuchTagSetError, just like Ceph, but I believe it to be more sensible to actually follow the implementation. See also ansible-collections/amazon.aws#150
This is what the error code used by the AWS implementation. Amazon's documentation indeed calls it NoSuchTagSetError, just like Ceph, but I believe it to be more sensible to actually follow the implementation. See also ansible-collections/amazon.aws#150
This is the error code used by the AWS implementation. Amazon's documentation indeed calls it NoSuchTagSetError, just like Ceph, but I believe it to be more sensible to actually follow the implementation. See also ansible-collections/amazon.aws#150
ses: fix clearing notification topic SUMMARY Fixes ansible-collections#150. As per the docs, the SnsTopic parameter has to be omitted from the request in order to clear the notification setting. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ses_identity Reviewed-by: Alina Buzachis Reviewed-by: Mark Chappell Reviewed-by: Kamil Turek <kamil.turek@hotmail.com>
ses: fix clearing notification topic SUMMARY Fixes ansible-collections#150. As per the docs, the SnsTopic parameter has to be omitted from the request in order to clear the notification setting. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ses_identity Reviewed-by: Alina Buzachis Reviewed-by: Mark Chappell Reviewed-by: Kamil Turek <kamil.turek@hotmail.com>
ses: fix clearing notification topic SUMMARY Fixes ansible-collections#150. As per the docs, the SnsTopic parameter has to be omitted from the request in order to clear the notification setting. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ses_identity Reviewed-by: Alina Buzachis Reviewed-by: Mark Chappell Reviewed-by: Kamil Turek <kamil.turek@hotmail.com>
SUMMARY
Correctly handle the absence of tag sets.
ISSUE TYPE
COMPONENT NAME
s3_bucket module
ADDITIONAL INFORMATION
According to Amazon's documentation 1 the error code returned
when no tag set can be found is
NoSuchTagSetErrorrather thanNoSuchTagSet.Associated error: