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

Certain operations not working with S3-compatible backend #4202

Closed
rkoo19 opened this issue Jul 14, 2024 · 4 comments
Closed

Certain operations not working with S3-compatible backend #4202

rkoo19 opened this issue Jul 14, 2024 · 4 comments
Assignees
Labels
bug This issue is a confirmed bug. p2 This is a standard priority issue response-requested Waiting on additional information or feedback. third-party

Comments

@rkoo19
Copy link

rkoo19 commented Jul 14, 2024

Describe the bug

Hi, new to using Boto3 and would appreciate any help I can get. I am using AIStore, an S3-compatible object store and using a botocore patch.

The error message suggests that the endpoint URL is not being correctly propagated for certain operations like download_file and get_object. Given that list_objects_v2 works correctly, I am unsure if the configuration is correct but might not be applied consistently.

Thanks in advance.

Expected Behavior

Expected client object to behave same way for list_objects_v2 and download_file in regards to handling S3 endpoint URL.

Current Behavior

download_file fails without being able to connect to endpoint URL.

Reproduction Steps

import boto3
import logging

# Following import intercepts S3 redirections from AIStore and patch them to: Respect HTTP 301, 302 or 307 redirects using the 'Location' header and fail after 3 redirects for a given operation (rather than just one).
from aistore.botocore_patch import botocore

logging.basicConfig(level=logging.DEBUG)

endpoint_url = 'http://localhost:8080/s3'

s3 = boto3.client(
    's3',
    endpoint_url=endpoint_url,  # AIStore endpoint
    aws_access_key_id='', 
    aws_secret_access_key=''
)

# This works
try:
    response = s3.list_objects_v2(Bucket="abc", Prefix="textfile")
    for obj in response.get('Contents', []):
        print(obj['Key'])
except Exception as e:
    logging.error(f"Error listing objects: {e}")

# This doesn't
s3.download_file(Bucket="abc", Key="textfile1", Filename="./textfile1download")

Possible Solution

No response

Additional Information/Context

No response

SDK version used

2.7.21

Environment details (OS name and version, etc.)

Ubuntu 22.04

@rkoo19 rkoo19 added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jul 14, 2024
@rkoo19 rkoo19 changed the title download_file not working with S3-compatible backend Certain operations not working with S3-compatible backend Jul 15, 2024
@tim-finnigan tim-finnigan self-assigned this Jul 16, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. Can you reproduce the issue using just Boto3/Botocore and not aistore? If so, please share your full debug logs by adding boto3.set_stream_logger('') to your script. Otherwise this may be an issue with aistore that would need to be addressed on their end. We cannot guarantee compatibility with third-party software in cases like this.

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. third-party p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jul 16, 2024
@rkoo19 rkoo19 closed this as completed Jul 17, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@rkoo19
Copy link
Author

rkoo19 commented Jul 17, 2024

Hi,

I am closing this issue because an outdated dependency caused a KeyError in the redirection logic. Updating the dependency resolved the issue.

Thank you!

@rkoo19 rkoo19 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. p2 This is a standard priority issue response-requested Waiting on additional information or feedback. third-party
Projects
None yet
Development

No branches or pull requests

2 participants