Uploading file on S3 - the same code, works in us-east-1 but does not work in sa-east-1

0

Hello,

I am trying to rum a simple code to upload a file: **it is a binary file **

importanto io para trabalhar com arquivos binarios

import io import sys

importando a biblioteca do sagemakwer common library que tem varios utilitarios

import sagemaker.amazon.common as smac

buffer = io.BytesIO()

utilizando o utilitario da common library para converter o formato numpy para dense_tensor que 'e utilzado na aws

smac.write_numpy_to_dense_tensor(buffer, x_treinamento, y_treinamento)

inicio da base

buffer.seek(0) file size 1688492

Uploading the file import os import sagemaker import boto3 from sagemaker import Session import io

the bucket and the folder was pre defined

key = 'houses-train-data' boto3.resource('s3').Bucket(bucket).Object(os.path.join(subpasta_dataset, 'train', key)).upload_fileobj(buffer)

It runs ok in us-east-1 but when I rum in sa-east-1 (sao Paulo) I receive the error bellow: SSLError: SSL validation failed for https://curso1962.s3.sa-east-1.amazonaws.com/datasets/house-prices/train/houses-train-data EOF occurred in violation of protocol (_ssl.c:2396)

Any suggestion to solve this issue ? May be multi-part problem ? obs using jupyter lab Data Science 3.0 with python 3 thank you

profile picture
Brown
asked 9 months ago259 views
2 Answers
0

Hi Brown.

Is your S3 bucket configured with Encryption using a KMS Key in the sa-east-1 region? If so, does your process has kms:Decrypt permissions for that KMS Key? If not, please grant the permission in the proper policy and try again. Doing so may not fix the issue entirely but should provide the necessary access to get the real error.

Please let me know if that helps.

profile pictureAWS
EXPERT
answered 9 months ago
0

Thank you Jose

The weird is, the bucket is global, the same job do the upload in a region (us-east-1) but not works in sa-east-1. I have granted the role using the policie bellow, but the issue persists. I need to follow with the job, I will run the load in one region and run the algorithm in another, because there is some diferences in the xgboost between the regions too. Thanks a lot for your attention. Later I will be back to analyse this issue with less stress { "Version": "2012-10-17", "Statement": [ { "Sid": "VolumeEncryption", "Effect": "Allow", "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:DescribeKey" ], "Resource": "*" } ] }

profile picture
Brown
answered 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions