I’m trying to list objects in my Spaces bucket:
session = boto3.session.Session()
s3_client = session.client('s3',
region_name='blr1',
endpoint_url=my_endpoint_url,
)
response = client.list_objects_v2(Bucket=my_spaces_name)
I keep getting the error: Error: An error occurred (NotImplemented) when calling the ListObjectsV2 operation: Server does not support one or more requested headers.
When I check the documentation it says v2 is supported. Even dropping the v2 doesn’t change the nature of the error. Any help welcome.
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.
Hi,
It looks like you’re using
client
instead ofs3_client
when calling thelist_objects_v2
method. Update your code to use the correct variable name:Also, make sure your
endpoint_url
is correctly set to something likehttps://blr1.digitaloceanspaces.com
.- Bobby
Heya,
something like the following should work for you
As said you need to use
s3_client
.Heya, @qumata
You can use
s3cmd
as an alternative to list objects in your Spaces bucket.s3cmd
Or via pip:
s3cmd
for DigitalOcean SpacesSet these values:
blr1
https://blr1.digitaloceanspaces.com
s3v4
Hope that this helps!