[Error]this.client.send is not a function(node와 s3관련 오류 모음)

2024. 6. 4. 09:34·Error
목차
  1. 1. this.client.send is not a function
  2. 2. SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
  3. 3. The bucket does not allow ACLs
728x90
반응형

node와 s3를 연결하면서 나는 오류들을 정리하였다.

1. this.client.send is not a function

this.client.send is not a function
this.client.send is not a function

→ 구글링했을 때 이와 같이 오류난 사람들이 많았다.

https://github.com/anacronw/multer-s3/issues/169

 

this.client.send is not a function · Issue #169 · anacronw/multer-s3

I've been trying to get around this error for a while but it keeps popping up, and S3 keeps billing me the requests even if no files are being uploaded. This is my code: require("dotenv").config();...

github.com

 

github에서 이러한 오류에 대해서 토론한 것이 있어서 이를 참조하여 문제를 해결하였다.

1) 문제 발생 원인 : multer-s3와 aws-sdk는 아마존의 s3와 node를 연결하기 위해서 깔아야 하는 모듈이다. 근데 이 둘의 버전이 아래와 같이 일치해야 한다. 내 경우는 일치하지 않아 나는 오류였다.

2) 문제 해결 : 그래서 multer-s3는 3.x으므로 이를 다운 그레이드를 하여 2.x로 설정하였다. 이렇게 하여 aws-sdk가 2.x이였기에 이와 버전을 맞추어 주었다.

Multer S3 2.x는 AWS SDK 2.x와 호환되고 Multer S3 3.x는 AWS SDK 3.x와 호환됩니다.

2. SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.

Check your key and signing method.
Check your key and signing method.

이는 생각보다 쉬운 문제였다. s3를 연결하려면 accessKeyId와 secretAccessKey가 필요하다. 그런데 이에 대한 오타가 나서 나는 문제였다. 그래서 그것을 확인하여 오류를 정정하였다.

3. The bucket does not allow ACLs

The bucket does not allow ACLs
The bucket does not allow ACLs

  1. 문제 발생 원인 : The bucket does not allow ACLs에 대한 오류는 s3업로드시 옵션 acl에 대해서 지정이 안되어 있는 경우 많이 생기는 오류이다. .
  2. 문제 해결 방안 :

1) Amazon에 들어가서 버킷에 대한 권한을 들어간다.

권한탭
권한탭

2) 권한 메뉴에 들어가 보면 객체 소유권이라는 것이 있는데 이를 편집 기능을 눌러 편집한다.

객체 소유권
객체 소유권

3) acl을 활성화하고 아래에 acl이 복원된다는 것을 확인합니다 버튼을 클릭하여 활성화시켜준다.

객체 소유권 편집
객체 소유권 편집

4) 그러고 나서 코드로 돌아가서 코드를 돌려주면 오류없이 잘 돌아간다.

728x90
반응형
저작자표시 비영리 변경금지 (새창열림)
  1. 1. this.client.send is not a function
  2. 2. SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
  3. 3. The bucket does not allow ACLs
'Error' 카테고리의 다른 글
  • [Error] react Hooks must be called in a React function component or a custom React Hook function + 다른 오류(기초)
  • [Error] creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException
  • [Error] Cannot set headers after they are sent to the client 오류
  • [Error] Vue와 express 통신시 백엔드에서 나타나는 오류 해결하기
Uheeking
Uheeking
안녕하세요. react, flutter, node.js에 관련해서 글을 쓰는 블로그입니다.
Uheeking의 it로그안녕하세요. react, flutter, node.js에 관련해서 글을 쓰는 블로그입니다.
Uheeking
Uheeking의 it로그
Uheeking
전체
오늘
어제

공지사항

  • 분류 전체보기 (254)
    • React (48)
    • Node.js (32)
    • Next.js (22)
    • Vue.js (15)
    • javascript (3)
    • Django (19)
    • etc (23)
    • Flutter (30)
    • Error (16)
    • AWS (11)
    • docker & Kubernetes (32)
    • git (2)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
250x250

인기 글

태그

  • node.js
  • 리액트
  • Create
  • Vue.js
  • firebase
  • 쿠버네티스
  • sequelize
  • next.js
  • 티스토리챌린지
  • 도커
  • MySQL
  • 노드
  • 장고
  • Kubernetes
  • AWS
  • Express
  • NEXT
  • SSR
  • 넥스트
  • flutter
  • Props
  • mosquitto
  • React
  • docker
  • Django
  • 플러터
  • 오블완
  • supabase
  • error
  • useEffect

최근 댓글

최근 글

250x250
hELLO· Designed By정상우.v4.5.2
Uheeking
[Error]this.client.send is not a function(node와 s3관련 오류 모음)

개인정보

  • 티스토리 홈
  • 포럼
  • 로그인
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.