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

awswrangler s3 Failing with SSL Verification #1157

Closed
rachakonda03 opened this issue Feb 4, 2022 · 5 comments
Closed

awswrangler s3 Failing with SSL Verification #1157

rachakonda03 opened this issue Feb 4, 2022 · 5 comments
Labels
question Further information is requested

Comments

@rachakonda03
Copy link

Describe the bug

Hi .

I am trying to read parquet files from an S3 bucket , my download is failing because of SSL Verification. I do not se an option to pass argument to specify the cert path, Can you please Help!!!

Thanks
Srikanth

How to Reproduce

*P.S. Please do not attach files as it's considered a security risk. Add code snippets directly in the message body as much as possible.*

`
boto3.setup_default_session(aws_access_key_id='xxxxxxxx', aws_secret_access_key='xxxxxxxxxxx', aws_session_token='xxxxx')

dirs = wr.s3.list_directories('bucket')
for path in range(len(dirs)):
dfs = wr.s3.read_parquet(path=dirs[path], dataset=True)

  • [ ]

  • [ ]

`

Expected behavior

No response

Your project

No response

Screenshots

No response

Environment

Provide your `pip list` output, particularly the version of the AWS Data Wrangler library you used. Providing this information may significantly improve resolution times.

OS

Win

Python version

3.7

AWS DataWrangler version

2.14.0

Additional context

No response

@rachakonda03 rachakonda03 added the bug Something isn't working label Feb 4, 2022
@malachi-constant
Copy link
Contributor

Hi @rachakonda03,

Are you able to interface with the bucket with the boto3 library directly or are you having SSL verification issues there as well?

client = boto3.client('s3')
bucket = "yourbucketname"
response = client.list_objects(
    Bucket=bucket,
)

@malachi-constant malachi-constant added question Further information is requested and removed bug Something isn't working labels Feb 8, 2022
@rachakonda03
Copy link
Author

rachakonda03 commented Feb 8, 2022

Yes , followed one of other issues added monkey patch client to pass verify with awsrangler , it is working locally with boto3 and also awswrnagler with patched client but when running in aws lambda erroring out with SSL issuse


@apply_configs
def patched_client(
        service_name: str, session: Optional[boto3.Session] = None,
        botocore_config: Optional[botocore.config.Config] = None
) -> boto3.client:
    """Create a valid boto3.client."""
    endpoint_url: Optional[str] = _get_endpoint_url(service_name=service_name)
    return ensure_session(session=session).client(
        service_name=service_name,
        endpoint_url=endpoint_url,
        use_ssl=True,
        verify=ca_cert,
        config=default_botocore_config() if botocore_config is None else botocore_config,
    )

def ctr_pull(event, context):
    try:
        wr._utils.client = patched_client
        dirs = wr.s3.list_directories(ctr_path)
        logger.info(dirs)
   

@rachakonda03
Copy link
Author

rachakonda03 commented Feb 9, 2022

Hi @rachakonda03,

Are you able to interface with the bucket with the boto3 library directly or are you having SSL verification issues there as well?

client = boto3.client('s3')
bucket = "yourbucketname"
response = client.list_objects(
    Bucket=bucket,
)

I am having issues , had to veirify with cert path

@rachakonda03
Copy link
Author

Nevermind it is something to do wiht my local setup. Appreciate your help for looking into it,

@daichigb
Copy link

@rachakonda03 Can you elaborate on what was the local setup issue?
I'm seeing a similar issue.

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

No branches or pull requests

3 participants