개요
수집되는 채널이 4000개를 넘어가면서 크론에서 더 이상 단순한 방식으로의 호출이 불가능해졌다.
네이버로의 너무 많은 요청으로 인해 차단된 정황이 포착됐기 때문
Fetch Error: TypeError: fetch failed
at node:internal/deps/undici/undici:12618:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ChzzkChannelRepository.findById (/app/node_modules/chzzk-z/dist/lib/chzzk/apis/channel.repository.js:15:16)
at async ChzzkChannel.findById (/app/node_modules/chzzk-z/dist/lib/chzzk/channel.js:15:16)
at async ChzzkRepository.getChannelById (/app/dist/src/chzzk/chzzk.repository.js:22:25)
at async BatchService.trackingChannel (/app/dist/src/batch/batch.service.js:97:30)
at async BatchService.trackingChannels (/app/dist/src/batch/batch.service.js:78:17)
at async BatchService.value (/app/dist/src/common/decorators/batch-only.decorator.js:21:40)
at async CronJob.<anonymous> (/app/node_modules/@nestjs/schedule/dist/schedule.explorer.js:96:17) {
cause: ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (node:internal/deps/undici/undici:7760:28)
at node:internal/deps/undici/undici:7716:50
at Immediate._onImmediate (node:internal/deps/undici/undici:7748:13)
at process.processImmediate (node:internal/timers:478:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
}
}
Bash
복사
라고 생각했지만…
실제론 EKS Pod 외부로 나가는 아웃바운드 트래픽이 HTTP 차단정책에 막혀있었다.
외부허용을 해주니 아래와 같이 문제 없이 호출이 됨을 확인하였다.
처리과정 로그
[Nest] 69756 - 08/15/2025, 8:55:13 PM LOG [BatchService] [865/4253] 채널 처리 중: 4d93eaefb9387f2245e36634890d4c28 (마지막 업데이트: Fri Aug 15 2025 19:09:40 GMT+0900 (Korean Standard Time))
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [865/4253] 채널 처리 완료: 4d93eaefb9387f2245e36634890d4c28
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [866/4253] 채널 처리 중: df479a53d5faa2bf6cfe4af6d715a26c (마지막 업데이트: Fri Aug 15 2025 19:09:40 GMT+0900 (Korean Standard Time))
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [866/4253] 채널 처리 완료: df479a53d5faa2bf6cfe4af6d715a26c
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [867/4253] 채널 처리 중: 0386413ce359a9c7cd05329740eb6836 (마지막 업데이트: Fri Aug 15 2025 19:09:40 GMT+0900 (Korean Standard Time))
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [867/4253] 채널 처리 완료: 0386413ce359a9c7cd05329740eb6836
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [868/4253] 채널 처리 중: df9e94e7367e608c376562701e048e18 (마지막 업데이트: Fri Aug 15 2025 19:09:40 GMT+0900 (Korean Standard Time))
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] [868/4253] 채널 처리 완료: df9e94e7367e608c376562701e048e18
[Nest] 69756 - 08/15/2025, 8:55:14 PM LOG [BatchService] 배치 완료: 50개 채널 처리 완료. 오프셋 업데이트: 818 → 868 (전체: 4253)
Bash
복사
