Skip to content

"CreateBucket operation: Access Denied..." when calling Session.default_bucket() #1935

Closed

Description

@kianho

Describe the bug
Calling default_bucket() on a sagemaker.session.Session object, when specifying a custom default_bucket, raises:

  • ClientError: An error occurred (AccessDenied) when calling the CreateBucket operation: Access Denied

when the default bucket already exists

possibly related to #1174

To reproduce

bucket = "bucket-that-exists"
boto_session = boto3.session.Session(region_name="ap-southeast-2")
sm_session = sagemaker.Session(boto_session, default_bucket=bucket)

sm_session.default_bucket()
  • I added a command to L387 of src/sagemaker/session.py to display the number of keys in the bucket to verify that the intended default bucket is accessed:

image

  • bucket.creation_date returns None even when the bucket exists
  • could be tricky to reproduce, the execution role has limited permissions (can only list, upload/download, to/from this bucket), for example aws s3 ls is denied, let me know if there is any more info you need

image

Expected behavior
sm_session.default_bucket() should return the same default bucket name specified when constructing the sagemaker session object.

Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.
image

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.12.0 (boto3 1.14.60)
  • Python version: Python 3.6.10 :: Anaconda, Inc.

Activity

  1. ajaykarpur commented on Oct 7, 2020

    @ajaykarpur
    Contributor

    Does your role have access to the bucket?

    It looks like #1174 was addressed in #1176.

  2. locked and limited conversation to collaborators on May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions