# URL //s3-bucket/prefix/file.jpeg 위치에 있는 스토어에서 파일을 찾을 수 없음

**URL:** <https://meta.discourse.org/t/could-not-find-file-in-the-store-located-at-url-s3-bucket-prefix-file-jpeg/268084>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [6월 12, 2023, 7:51오후 UTC](https://meta.discourse.org/t/could-not-find-file-in-the-store-located-at-url-s3-bucket-prefix-file-jpeg/268084 "2023-06-12T19:51:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![nodomain](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nodomain/32/303402_2.png) [@nodomain](https://meta.discourse.org/u/nodomain)\
**Post date:** [6월 15, 2023, 12:36오전 UTC](https://meta.discourse.org/t/could-not-find-file-in-the-store-located-at-url-s3-bucket-prefix-file-jpeg/268084/5 "2023-06-15T00:36:28Z")

</div>

근본 원인을 찾았습니다. Discourse AI 플러그인 설정 과정에서 다양한 서비스를 VPC 내부에서 사용할 수 있도록 VPC에 프라이빗 존을 추가했기 때문입니다.

EC2 인스턴스에서 Docker 컨테이너로 Discourse를 실행할 경우, 컨테이너에는 `12-34-56-78-app`과 같은 호스트 이름이 부여됩니다. 그러나 ECS 태스크로 실행할 때는 `awsvpc` 모드에서는 호스트 이름을 설정할 수 없으며, DNS 검색 도메인도 구성할 수 없습니다. 이로 인해 ECS에서는 DNS 해석이 달라지며, 제 경우에는 xxxx.internal과 같은 검색 도메인이 추가되었습니다.

여러 방법을 시도한 끝에 `tcpdump`를 사용하여 확인해 본 결과, Discourse가 SSRF 검사 과정에서 자신의 FQDN을 해석하려고 시도하고 있음을 발견했습니다. 이 해석에 실패하면 검사도 실패합니다. 그 결과, S3 호출이 위에서 언급된 잘못된 오류 메시지와 함께 실패하게 됩니다.

제 경우의 해결 방법은 CloudFront 배포에 대한 별칭인 FQDN 레코드를 프라이빗 DNS 존에 추가하는 것이었습니다.

---

_[View the full topic](https://meta.discourse.org/t/could-not-find-file-in-the-store-located-at-url-s3-bucket-prefix-file-jpeg/268084)._
