내용으로 건너뛰기

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

질문됨 2년 전502회 조회
2개 답변
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.

AWS
전문가
답변함 2년 전
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": "*" } ] }

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠