boostcampwm-2024 / web09-DailyRoad

나만의 길을 따라 일상을 공유한다, 오늘의 길 🗺️
https://dailyroad.site
42 stars 2 forks source link

알수 없는 이유로 서버가 종료되는 버그를 해결한다. #169

Open koomchang opened 15 hours ago

koomchang commented 15 hours ago

🐞 Describe

추정 원인 : 타임아웃 으로 인해 주기적으로 서버가 죽는 버그를 해결한다.

에러 전파로 500 코드 응답 처리가 되지 않고 서버가 종료

📄 Logs

QueryFailedError: read ETIMEDOUT
    at Query.onResult (/app/node_modules/typeorm/driver/mysql/MysqlQueryRunner.js:165:37)
    at PoolConnection._notifyError (/app/node_modules/mysql2/lib/connection.js:228:21)
    at PoolConnection._handleFatalError (/app/node_modules/mysql2/lib/connection.js:183:10)
    at PoolConnection._handleNetworkError (/app/node_modules/mysql2/lib/connection.js:196:10)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  query: 'SELECT place.id AS place_id, place.created_at AS place_created_at, place.updated_at AS place_updated_at, place.deleted_at AS place_deleted_at, place.google_place_id AS place_google_place_id, place.name AS place_name, place.thumbnail_url AS place_thumbnail_url, place.rating AS place_rating, place.longitude AS place_longitude, place.latitude AS place_latitude, place.formatted_address AS place_formatted_address, place.category AS place_category, place.description AS place_description, place.detail_page_url AS place_detail_page_url FROM PLACE place INNER JOIN MAP_PLACE MapPlace ON  MapPlace.place_id = place.id AND MapPlace.deleted_at IS NULL WHERE ( MapPlace.id IN (?) ) AND ( place.deleted_at IS NULL )',
  parameters: [ 25 ],
  driverError: Error: read ETIMEDOUT
      at TCP.onStreamRead (node:internal/stream_base_commons:218:20)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    errno: -110,
    code: 'ETIMEDOUT',
    syscall: 'read',
    fatal: true
  },
  errno: -110,
  code: 'ETIMEDOUT',
  syscall: 'read',
  fatal: true
}
Node.js v20.18.0

🌏 Environment

OS: Ubuntu Linux + Docker

🕰️ Estimated Time of Completion

24

🙋🏻 More

No response

Miensoap commented 12 hours ago

추정 원인

node:internal/process/promises:391
    triggerUncaughtException(err, true /* fromPromise */);

image