Skip to content
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

S3_object does a bucket check even if ignore_nonexistent_bucket is set to True #1346

Closed
1 task done
martialf opened this issue Jan 24, 2023 · 4 comments
Closed
1 task done
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type) python3 traceback

Comments

@martialf
Copy link

martialf commented Jan 24, 2023

Summary

A bucket_check is done event as the option ignore_nonexistent_bucket is set to true.

That cause the error An error occurred (403) when calling the HeadBucket operation: Forbidden if the permission s3:ListBucket is missing.

The problem is located here : line 1093

Issue Type

Bug Report

Component Name

s3_object

Ansible Version

$ ansible --version
ansible [core 2.14.1]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Collection Versions

$ ansible-galaxy collection list
# /root/.ansible/collections/ansible_collections
Collection Version
---------- -------
amazon.aws 5.2.0  

# /usr/local/lib/python3.10/dist-packages/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    5.1.0  

AWS SDK versions

$ pip show boto boto3 botocore
    amazon-ebs.ubuntu:         "Collecting boto",
    amazon-ebs.ubuntu:         "  Downloading boto-2.49.0-py2.py3-none-any.whl (1.4 MB)",
    amazon-ebs.ubuntu:         "     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 4.5 MB/s eta 0:00:00",
    amazon-ebs.ubuntu:         "Collecting boto3",
    amazon-ebs.ubuntu:         "  Downloading boto3-1.26.55-py3-none-any.whl (132 kB)",
    amazon-ebs.ubuntu:         "     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 132.7/132.7 KB 25.3 MB/s eta 0:00:00",
    amazon-ebs.ubuntu:         "Collecting botocore",
    amazon-ebs.ubuntu:         "  Downloading botocore-1.29.55-py3-none-any.whl (10.3 MB)",
    amazon-ebs.ubuntu:         "     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.3/10.3 MB 18.3 MB/s eta 0:00:00",

Configuration

$ ansible-config dump --only-changed

OS / Environment

No response

Steps to Reproduce

Expected Results

No error if the permission s3:ListBucket is missing

Actual Results

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.ClientError: An error occurred (403) when calling the HeadBucket operation: Forbidden
    amazon-ebs.ubuntu: fatal: [default]: FAILED! => {"boto3_version": "1.26.56", "botocore_version": "1.29.56", "changed": false, "error": {"code": "403", "message": "Forbidden"}, "msg": "Failed while looking up bucket (during bucket_check) namp-storage-dev.: An error occurred (403) when calling the HeadBucket operation: Forbidden", "response_metadata": {"host_id": "DKmiX+Vt5VTUqn2+uE1k9t9yh9xuPd6ntJ7Y54cfgyqc5u1T8xPmHDXR8Bau/9lpHE2BCoiTmiI=", "http_headers": {"content-type": "application/xml", "date": "Tue, 24 Jan 2023 20:44:29 GMT", "server": "AmazonS3", "x-amz-bucket-region": "eu-west-3", "x-amz-id-2": "DKmiX+Vt5VTUqn2+uE1k9t9yh9xuPd6ntJ7Y54cfgyqc5u1T8xPmHDXR8Bau/9lpHE2BCoiTmiI=", "x-amz-request-id": "667SNH95TPGBTC8C"}, "http_status_code": 403, "request_id": "667SNH95TPGBTC8C", "retry_attempts": 0}}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3 traceback labels Jan 24, 2023
@alinabuzachis
Copy link
Collaborator

@martialf Thank you for reporting this issue. Would you be willing to open a pull request to fix this issue?

@alinabuzachis alinabuzachis added waiting_on_contributor Needs help. Feel free to engage to get things unblocked and removed needs_triage labels Jan 27, 2023
@abikouo abikouo added WIP Work in progress and removed waiting_on_contributor Needs help. Feel free to engage to get things unblocked labels Jun 13, 2023
@abikouo abikouo assigned abikouo and unassigned abikouo Jun 13, 2023
@abikouo abikouo added waiting_on_contributor Needs help. Feel free to engage to get things unblocked and removed WIP Work in progress labels Jun 13, 2023
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
@abikouo abikouo removed the waiting_on_contributor Needs help. Feel free to engage to get things unblocked label Mar 18, 2024
@abikouo
Copy link
Contributor

abikouo commented Mar 18, 2024

Hi @martialf, This is issue has been fixed in the latest release 7.4.0, you can switch to this release to avoid the issue

@abikouo abikouo closed this as completed Mar 18, 2024
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 11, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 16, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 24, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
alinabuzachis pushed a commit to alinabuzachis/amazon.aws that referenced this issue Oct 24, 2024
…nsible-collections#1346)

ec2_vpc_peer - Fix idempotency when accepter/requester is reversed

SUMMARY
fixes: ansible-collections#580
Fixes a bug where a new peering request would be created when the accepter/requester is reversed
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/modules/ec2_vpc_peer.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@1c3ad28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type) python3 traceback
Projects
None yet
Development

No branches or pull requests

4 participants