그외 기록/트러블 슈팅

Connection lost: The server closed the connection 에러 해결

github.com/zlrloy 2026. 6. 3. 22:06

에러

API 호출시 500 에러가 났고 서버 로그는 The server closed the connection 메시지가 반복적으로 나타나고 있었다.

SequelizeConnectionError: Connection lost: The server closed the connection.

 

 

해당 에러에는 다양한 원인이 있을 수 있는데,

필자는 무료 체험판 크레딧이 모두 소진되면서 GCP Cloud SQL 인스턴스가 자동으로 정지되면서 DB 연결에 오류가 발생한 것이다.

failed to connect to instance:
fetch ephemeral cert failed:
googleapi: Error 409:
The instance or operation is not in an appropriate state to handle the request.
invalidState

 

 

 

 

 

 

 

해결

팀원에게 상황을 공유한 후 GCP 결제 계정을 업그레이드하고 Cloud SQL 인스턴스를 다시 활성화했다.

 

 

 

업그레이드 완료 후 Cloud SQL 인스턴스가 정상 상태로 복구되었고 모든 기능이 정상 동작했다.