question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid xml received when creating a bucket

See original GitHub issue

Describe the bug Our test suite started failing yesterday. We use ansible to create a bucket in minio and it looks like minio is returning some invalid xml (see below). I believe this commit is somehow responsible:

https://github.com/minio/minio/commit/bd032d13ffe014b0a6f072ce87693a0df9037b86

Steps to reproduce Create a bucket in minio using ansible (might also be reproducible using just botocore):

- name: "Create Bucket"
    s3_bucket:
        s3_url: "http://minio:9000"
        region: eu-central-1
        name: test
        state: present

Expected behavior No invalid xml.

Debug logs Here is the output from ansible:

    Traceback (most recent call last):
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 452, in _parse_xml_string_to_dom
        parser.feed(xml_string)
    xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 38
  
    During handling of the above exception, another exception occurred:
  
    Traceback (most recent call last):
      File "/home/travis/.ansible/tmp/ansible-tmp-1590767894.6118252-82050180509011/AnsiballZ_s3_bucket.py", line 102, in <module>
        _ansiballz_main()
      File "/home/travis/.ansible/tmp/ansible-tmp-1590767894.6118252-82050180509011/AnsiballZ_s3_bucket.py", line 94, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/travis/.ansible/tmp/ansible-tmp-1590767894.6118252-82050180509011/AnsiballZ_s3_bucket.py", line 40, in invoke_module
        runpy.run_module(mod_name='ansible.modules.cloud.amazon.s3_bucket', init_globals=None, run_name='__main__', alter_sys=True)
      File "/opt/python/3.7.6/lib/python3.7/runpy.py", line 205, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/opt/python/3.7.6/lib/python3.7/runpy.py", line 96, in _run_module_code
        mod_name, mod_spec, pkg_name, script_name)
      File "/opt/python/3.7.6/lib/python3.7/runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_s3_bucket_payload_7bei9nfw/ansible_s3_bucket_payload.zip/ansible/modules/cloud/amazon/s3_bucket.py", line 713, in <module>
      File "/tmp/ansible_s3_bucket_payload_7bei9nfw/ansible_s3_bucket_payload.zip/ansible/modules/cloud/amazon/s3_bucket.py", line 707, in main
      File "/tmp/ansible_s3_bucket_payload_7bei9nfw/ansible_s3_bucket_payload.zip/ansible/modules/cloud/amazon/s3_bucket.py", line 218, in create_or_update_bucket
      File "/tmp/ansible_s3_bucket_payload_7bei9nfw/ansible_s3_bucket_payload.zip/ansible/module_utils/cloud.py", line 153, in retry_func
      File "/tmp/ansible_s3_bucket_payload_7bei9nfw/ansible_s3_bucket_payload.zip/ansible/module_utils/cloud.py", line 140, in retry_func
      File "/tmp/ansible_s3_bucket_payload_7bei9nfw/ansible_s3_bucket_payload.zip/ansible/modules/cloud/amazon/s3_bucket.py", line 405, in get_bucket_request_payment
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/client.py", line 316, in _api_call
        return self._make_api_call(operation_name, kwargs)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/client.py", line 622, in _make_api_call
        operation_model, request_dict, request_context)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/client.py", line 641, in _make_request
        return self._endpoint.make_request(operation_model, request_dict)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
        return self._send_request(request_dict, operation_model)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
        request, operation_model, context)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
        request, operation_model)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
        response_dict, operation_model.output_shape)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 246, in parse
        parsed = self._do_parse(response, shape)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 810, in _do_parse
        self._add_modeled_parse(response, shape, final_parsed)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 819, in _add_modeled_parse
        self._parse_payload(response, shape, member_shapes, final_parsed)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 859, in _parse_payload
        original_parsed = self._initial_body_parse(response['body'])
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 945, in _initial_body_parse
        return self._parse_xml_string_to_dom(xml_string)
      File "/home/travis/virtualenv/python3.7.6/lib/python3.7/site-packages/botocore/parsers.py", line 458, in _parse_xml_string_to_dom
        (e, xml_string))
    botocore.parsers.ResponseParserError: Unable to parse response (not well-formed (invalid token): line 1, column 38), invalid XML received. Further retries may succeed:
    b'<?xml version="1.0" encoding="UTF-8"?>\\n<RequestPaymentConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Payer>BucketOwner</Payer></RequestPaymentConfiguration>'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nateprewittcommented, May 29, 2020

Ah, missed the minio piece. Thanks @daviddavis 😃

0reactions
daviddaviscommented, May 29, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid XML in Amazon S3 output caused by object file names
The invalid XML is generated as a result of the command aws s3 cp s3://usbucket s3://eubucket --recursive . An example of the returned...
Read more >
S3 create bucket should not do response in json - rgw - Ceph
rgw: S3 create bucket should not do response in json ... Unable to parse response (not well-formed (invalid token): line 1, column 0),...
Read more >
Cloudformation deploy failing to create S3 bucket - Bitbucket
Cloudformation deploy failing to create S3 bucket. Create issue ... response (syntax error: line 1, column 54), invalid XML received: <!
Read more >
localstack/Platform - Gitter
I want to create simple local s3 bucket via localstack using Terraform v0.12.18. I run localstack in docker. docker run -d -p 8088:8088...
Read more >
ListObjectVersionsCommand - AWS SDK for JavaScript v3
Returns metadata about all versions of the objects in a bucket. ... A 200 OK response can contain valid or invalid XML. Make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found