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

Error on the new update 5.0.0 #614

Closed
3 tasks done
ABODFTW opened this issue May 4, 2021 · 3 comments · Fixed by #618
Closed
3 tasks done

Error on the new update 5.0.0 #614

ABODFTW opened this issue May 4, 2021 · 3 comments · Fixed by #618

Comments

@ABODFTW
Copy link

ABODFTW commented May 4, 2021

Problem description

I had a code snippet on my code base that used smart_open to upload a file to S3 Bucket, but suddenly after I reinitiated the venv, it started failing and is giving me this error:
CreateMultipartUpload operation: The AWS Access Key Id you provided does not exist in our records.'))
Though the Access Key ID is correct, and after a couple of hours of debugging, I found that the only thing that changed is smart_open version, and after downgrading to 4.2.0 it just worked with the same credentials.

session = boto3.Session(
        aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
        aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
        region_name=settings.AWS_S3_REGION_NAME,
    )
bucket = settings.AWS_STORAGE_BUCKET_NAME
endpoint_url = settings.AWS_S3_ENDPOINT_URL
filename = uuid.uuid4().hex
path = f"{bucket}/outputs/{filename}.csv"
with smart_open.open(
    f"s3://{path}",
    "w",
    transport_params={
        "session": session,
        "multipart_upload_kwargs": {"ACL": "public-read"},
        "resource_kwargs": {
            "endpoint_url": endpoint_url,
        },
    },
) as f:
    df.to_csv(f)

Versions

Please provide the output of:

Working version:

>>> import platform, sys, smart_open
>>> print(platform.platform())
Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29
>>> print("Python", sys.version)
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0]
>>> print("smart_open", smart_open.__version__)
smart_open 4.2.0

Probolmatic version:

>>> import platform, sys, smart_open
>>> print(platform.platform())
Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29
>>> print("Python", sys.version)
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0]
>>> print("smart_open", smart_open.__version__)
smart_open 5.0.0
>>>

Checklist

Before you create the issue, please make sure you have:

  • Described the problem clearly
  • Provided a minimal reproducible example, including any required data
  • Provided the version numbers of the relevant software
@mpenkov mpenkov closed this as completed May 4, 2021
@piskvorky
Copy link
Owner

piskvorky commented May 4, 2021

@mpenkov any way we can catch the "old" use, and issue a warning?

Because this seems to come up a lot, tripping up users.

@ABODFTW
Copy link
Author

ABODFTW commented May 5, 2021

Thanks for the info @mpenkov, and as @piskvorky said, it would be optimal if there was some type of warning.

Even adding a small note on the repo readme denoting that there is some changes to the new version, and then linking to the link @mpenkov mentiond would help.

Thank you guys for the awesome work, it's such a pleasure using this tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants