티스토리 뷰

Environment

- python 3.7

 

Error

- An error occurred (404) when calling the HeadObject operation

 

Situation

- boto3을 사용해 s3에서 파일을 다운로드할 때 해당 에러가 발생한다

import boto3

FILE_PATH = 'image/atv_rider0001.jpg'
BUCKET_NAME = 'flxr_yolo'
KEY = 'image/atv_rider0001.jpg'

client = boto3.client('s3')
client.download_file(BUCKET_NAME, KEY, FILE_PATH)

 

Solution

- Bucket의 이름이 잘못 표기되어 있었다..

- 정확한 이름 : flxr-yolo로 변경하니 제대로 작동한다.

- 다른 자료들을 찾아보니 대부분 경로 설정이나 오타와 같은 단순한 문제였다

 

Ref

1. https://stackoverflow.com/questions/45109533/aws-cli-s3-copying-file-locally-using-the-terminal-fatal-error-an-error-occu

2. https://stackoverflow.com/questions/46635895/aws-boto3-s3-python-an-error-occurred-404-when-calling-the-head object-operat?rq=1

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함