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_bucket fails on state: absent #49393

Closed
IPvSean opened this issue Nov 30, 2018 · 3 comments · Fixed by #49396
Closed

s3_bucket fails on state: absent #49393

IPvSean opened this issue Nov 30, 2018 · 3 comments · Fixed by #49396
Labels
affects_2.7 This issue/PR affects Ansible v2.7 aws bug This issue/PR relates to a bug. cloud has_pr This issue has an associated PR. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.

Comments

@IPvSean
Copy link
Contributor

IPvSean commented Nov 30, 2018

SUMMARY

this is very similar to issue #37419

this worked the first time and said OK... then later.... now it fails with traceback (see below). This makes no sense.... something is odd with this one s3 domain or something.... but I still feel like it shouldn't traceback

ISSUE TYPE
  • Bug Report
COMPONENT NAME

s3_bucket

ANSIBLE VERSION
➜  provisioner ansible --version
ansible 2.7.4
  config file = /Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg
  configured module search path = [u'/Users/sean/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Aug 17 2018, 17:41:52) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)]
CONFIGURATION
DEFAULT_CALLBACK_WHITELIST(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = [u'time']
DEFAULT_FORKS(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = 50
DEFAULT_HOST_LIST(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = [u'/Users/sean/Documents/GitHub/linklight/provisioner/hosts']
DEFAULT_NO_TARGET_SYSLOG(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = False
DEFAULT_SCP_IF_SSH(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = True
HOST_KEY_CHECKING(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = False
RETRY_FILES_ENABLED(/Users/sean/Documents/GitHub/linklight/provisioner/ansible.cfg) = False
OS / ENVIRONMENT

MacOS 10.14.1 Mojave

STEPS TO REPRODUCE

with extra vars we set state to s3_state absent....

- name: CREATE S3 BUCKET
  s3_bucket:
    name: "{{ec2_name_prefix|lower}}.{{workshop_dns_zone|lower}}"
    state: "{{ s3_state }}"
    region: "{{ec2_region}}"
    force: yes

the bucket doesn't exist... it is already deleted

EXPECTED RESULTS
TASK [aws_workshop_login_page : debug] ************************************************************************************************************************************************************
ok: [localhost] => {
    "s3_state": "absent"
}

TASK [aws_workshop_login_page : CREATE S3 BUCKET] *************************************************************************************************************************************************
ok: [localhost]
ACTUAL RESULTS
TASK [aws_workshop_login_page : CREATE S3 BUCKET] *************************************************************************************************************************************************
task path: /Users/sean/Documents/GitHub/linklight/provisioner/roles/aws_workshop_login_page/tasks/main.yml:10
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: sean
<localhost> EXEC /bin/sh -c 'echo ~sean && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430 `" && echo ansible-tmp-1543615690.04-64601628600430="` echo /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430 `" ) && sleep 0'
Using module file /Library/Python/2.7/site-packages/ansible/modules/cloud/amazon/s3_bucket.py
<localhost> PUT /Users/sean/.ansible/tmp/ansible-local-52224Yg4xCv/tmpr2_IW9 TO /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430/AnsiballZ_s3_bucket.py
<localhost> EXEC /bin/sh -c 'chmod u+x /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430/ /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430/AnsiballZ_s3_bucket.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430/AnsiballZ_s3_bucket.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /Users/sean/.ansible/tmp/ansible-tmp-1543615690.04-64601628600430/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/var/folders/mf/7qdcpv4s4kv50vq3v5xt4dd40000gn/T/ansible_s3_bucket_payload_5ALACc/__main__.py", line 445, in destroy_bucket
    for key_version_pairs in paginated_versions_list(s3_client, Bucket=name):
  File "/var/folders/mf/7qdcpv4s4kv50vq3v5xt4dd40000gn/T/ansible_s3_bucket_payload_5ALACc/__main__.py", line 423, in paginated_versions_list
    for page in pg.paginate(**pagination_params):
  File "/Library/Python/2.7/site-packages/botocore/paginate.py", line 255, in __iter__
    response = self._make_request(current_kwargs)
  File "/Library/Python/2.7/site-packages/botocore/paginate.py", line 332, in _make_request
    return self._method(**current_kwargs)
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 320, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Library/Python/2.7/site-packages/botocore/client.py", line 624, in _make_api_call
    raise error_class(parsed_response, operation_name)
NoSuchBucket: An error occurred (NoSuchBucket) when calling the ListObjectVersions operation: The specified bucket does not exist

fatal: [localhost]: FAILED! => {
    "boto3_version": "1.9.55",
    "botocore_version": "1.12.55",
    "changed": false,
    "error": {
        "bucket_name": "junostesting.rhdemo.io",
        "code": "NoSuchBucket",
        "message": "The specified bucket does not exist"
    },
    "invocation": {
        "module_args": {
            "aws_access_key": null,
            "aws_secret_key": null,
            "ceph": false,
            "ec2_url": null,
            "force": true,
            "name": "junostesting.rhdemo.io",
            "policy": null,
            "profile": null,
            "region": "ca-central-1",
            "requester_pays": false,
            "s3_url": null,
            "security_token": null,
            "state": "absent",
            "tags": null,
            "validate_certs": true,
            "versioning": null
        }
    },
    "msg": "Failed while deleting bucket: An error occurred (NoSuchBucket) when calling the ListObjectVersions operation: The specified bucket does not exist",
    "response_metadata": {
        "host_id": "JSVInIhC7Q+42JkWLtAVWP8o4V3YFRvQ2ANbjO8AyK7FzsQ2hcAIXre7ZjKRejWzO0DKkU9i3Dw=",
        "http_headers": {
            "content-type": "application/xml",
            "date": "Fri, 30 Nov 2018 22:08:10 GMT",
            "server": "AmazonS3",
            "transfer-encoding": "chunked",
            "x-amz-id-2": "JSVInIhC7Q+42JkWLtAVWP8o4V3YFRvQ2ANbjO8AyK7FzsQ2hcAIXre7ZjKRejWzO0DKkU9i3Dw=",
            "x-amz-request-id": "D442796E9B3B9C82"
        },
        "http_status_code": 404,
        "request_id": "D442796E9B3B9C82",
        "retry_attempts": 0
    }
}
@ansibot
Copy link
Contributor

ansibot commented Nov 30, 2018

Hi @IPvSean, thank you for submitting this issue!

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Nov 30, 2018

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

@ansibot
Copy link
Contributor

ansibot commented Nov 30, 2018

@IPvSean, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 aws bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback. labels Nov 30, 2018
@samdoran samdoran added P3 Priority 3 - Approved, No Time Limitation has_pr This issue has an associated PR. and removed needs_triage Needs a first human triage before being processed. labels Dec 4, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 aws bug This issue/PR relates to a bug. cloud has_pr This issue has an associated PR. module This issue/PR relates to a module. P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants