I deployed my backend and frontend separately on Render, and every 5 minutes, in the ‘events’ tab of the dashboard, I see the messages shown in the image ‘events.jpg’. In the ‘logs’ tab, I can observe the following errors when the ‘server unhealthy’ event occurs:
node:events:491
throw er; // Unhandled ‘error’ event
^
Error: Connection lost: The server closed the connection.
Socket. (/opt/render/project/src/backend/node_modules/mysql2/lib/connection.js:117:31)
Socket.emit (node:events:513:28)
TCP. (node:net:320:12)
Emitted ‘error’ event on Connection instance at:
Connection._notifyError (/opt/render/project/src/backend/node_modules/mysql2/lib/connection.js:252:12)
Socket. (/opt/render/project/src/backend/node_modules/mysql2/lib/connection.js:123:12)
Socket.emit (node:events:513:28)
TCP. (node:net:320:12) {
fatal: true,
code: ‘PROTOCOL_CONNECTION_LOST’
}
My database is hosted on Clever Cloud, and now I’m unsure if the error I’m experiencing is due to Render, Clever Cloud, or if there’s an error in my code. Has anyone experienced this before? Does anyone know how to solve it?