I’ve seen a lot of people have problems with this online and now I’ve run into the issue myself. I’m trying to use boto3 to list_buckets in a DigitalOcean Spaces. It returns a 200 status code, however there are no buckets listed inside. Strangely enough, I can create a bucket through code, but I can’t list it.
People have reported having success when they use different endpoint URLs. I’ve used the following:
https://<space_name>.nyc3.digitaloceanspaces.com
https://nyc3.digitaloceanspaces.com
No luck with either of them.
import boto3
s3 = boto3.client('s3', region_name=region, endpoint_url=endpoint, aws_access_key_id=access_id, aws_secret_access_key=secret_key)
s3.list_buckets()
list_buckets returns the following response.
{'ResponseMetadata': {'RequestId': 'tx00000000000010c9ce0be-0061b571d4-1800930a-nyc3c', 'HostId': '', 'HTTPStatusCode': 200, 'HTTPHeaders': {'transfer-encoding': 'chunked', 'x-amz-request-id': 'tx00000000000010c9ce0be-0061b571d4-1800930a-nyc3c', 'content-type': 'application/xml', 'date': 'Sun, 12 Dec 2021 03:51:48 GMT', 'strict-transport-security': 'max-age=15552000; includeSubDomains; preload'}, 'RetryAttempts': 0}}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Hello, @jaskiemr
I’ve not used boto3’s python library but it seems that the response should be different according to Boto 3 Docs:
Response syntax should be:
Usually, for an upload, you will use the short name - nyc3.digitaloceanspaces.com:
So I’ll recommend sticking to that format. Something like:
Hope that this helps! Regards, Alex