Closed hungnvk54 closed 3 years ago
` self._client = Minio( endpoint=config.endpoint, access_key=config.access_key, secret_key=config.secret_key, secure=config.secure, region='ap-southeast-1' )
self._client.make_bucket("test-bucket", location='ap-southeast-1') `
Enable self._client.trace_on(os.Stdout)
and run the code again
Here is the log when enable trace_on stdout
`HEAD / HTTP/1.1 Host: rk-ekyc-image.s3.ap-southeast-1.amazonaws.com User-Agent: MinIO (Linux; x86_64) minio-py/7.0.0 X-Amz-Content-Sha256: UNSIGNED-PAYLOAD X-Amz-Date: 20210723T012401Z Authorization: AWS4-HMAC-SHA256 Credential=REDACTED/20210723/ap-southeast-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=REDACTED
HTTP/1.1 404 x-amz-request-id: ZD39JD3M92MMHB6D x-amz-id-2: vgiAXipFDoFpcfVMVJ15pJEEB8Ps6+FEZCXWg+vBN8KNVugl1CVAPu9zSyeJ+AsotxxWDeaf6vk= Content-Type: application/xml Date: Fri, 23 Jul 2021 01:24:01 GMT Server: AmazonS3 ----------END-HTTP---------- ---------START-HTTP--------- HEAD / HTTP/1.1 Host: rk-ekyc-image.s3.ap-southeast-1.amazonaws.com User-Agent: MinIO (Linux; x86_64) minio-py/7.0.0 X-Amz-Content-Sha256: UNSIGNED-PAYLOAD X-Amz-Date: 20210723T012402Z Authorization: AWS4-HMAC-SHA256 Credential=REDACTED/20210723/ap-southeast-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=REDACTED
HTTP/1.1 404 x-amz-request-id: ZD37CG91RBYAFHWJ x-amz-id-2: JCScFmFNnCQ404NGAhUnlNShou6KCkR7RV+hjq2vZ5vAqMaoi0Ibd1XKP3AYWNr9fU8VasNXy3k= Content-Type: application/xml Date: Fri, 23 Jul 2021 01:24:01 GMT Server: AmazonS3 ----------END-HTTP----------
2021-07-23 08:27:17,285 - logger.logger - ERROR - MinIOServer.create_bucket():38 - 'xml.etree.ElementTree.Element' object has no attribute 'toxml' Traceback (most recent call last): File "/tmp/pycharm_project_ekyc_server/helper/MinIOServer.py", line 33, in create_bucket self._client.make_bucket(bucket_name, location=self._config.region) File "/media/2T_SSD1/hungnv4/02-Enviroment/virenv/lib/python3.6/site-packages/minio/api.py", line 618, in make_bucket body = marshal(element) File "/media/2T_SSD1/hungnv4/02-Enviroment/virenv/lib/python3.6/site-packages/minio/xml.py", line 99, in marshal return getbytes(obj.toxml(None)) AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml'`
An other info: When change both the region when create the MinIO Client and make_bucket to us-east-1
then every thing work fine.
2021-07-23 08:27:17,285 - logger.logger - ERROR - MinIOServer.create_bucket():38 - 'xml.etree.ElementTree.Element' object has no attribute 'toxml' Traceback (most recent call last): File "/tmp/pycharm_project_ekyc_server/helper/MinIOServer.py", line 33, in create_bucket self._client.make_bucket(bucket_name, location=self._config.region) File "/media/2T_SSD1/hungnv4/02-Enviroment/virenv/lib/python3.6/site-packages/minio/api.py", line 618, in make_bucket body = marshal(element) File "/media/2T_SSD1/hungnv4/02-Enviroment/virenv/lib/python3.6/site-packages/minio/xml.py", line 99, in marshal return getbytes(obj.toxml(None)) AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml'`
This bug was fixed in 014651b2
~ git tag --contains 014651b2
7.0.2
7.0.3
7.0.4
7.1.0
Available in following releases, please upgrade.
Hi all, There is an errors while using the minio python sdk when we create bucket
` self._client = Minio( endpoint=config.endpoint, access_key=config.access_key, secret_key=config.secret_key, secure=config.secure, region='ap-southeast-1' )
self._client.make_bucket("test-bucket", location='ap-southeast-1') `
Exeption:
File "/tmp/pycharm_project_ekyc_server/helper/MinIOServer.py", line 30, in create_bucket self._client.make_bucket(bucket_name, location=self._config.region) File "/media/2T_SSD1/hungnv4/02-Enviroment/virenv/lib/python3.6/site-packages/minio/api.py", line 618, in make_bucket body = marshal(element) File "/media/2T_SSD1/hungnv4/02-Enviroment/virenv/lib/python3.6/site-packages/minio/xml.py", line 99, in marshal return getbytes(obj.toxml(None)) AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'toxml'
Evironment:
Python: 3.6.9
Minio: minio==7.0.0
As description on this errors. I had inspected the code from https://github.com/python/cpython/blob/3.7/Lib/xml/etree/ElementTree.py and there are no toxml function.
Are these any mistake here?