Сервер узла Heroku закрывает соединение с cleardb - PullRequest
0 голосов
/ 19 марта 2020

У меня есть приложение heroku, написанное на node js, которое подключается к базе данных cleardb. Когда я запускаю его, иногда это работает, иногда он отображает ошибку приложения. Ниже приведен журнал:

  : events.js:288
2020-03-18T21:17:16.338605+00:00 app[web.1]: throw er; // Unhandled 'error' event
2020-03-18T21:17:16.338605+00:00 app[web.1]: ^
2020-03-18T21:17:16.338606+00:00 app[web.1]:
2020-03-18T21:17:16.338607+00:00 app[web.1]: Error: Connection lost: The server closed the connection.
2020-03-18T21:17:16.338607+00:00 app[web.1]: at Protocol.end (/app/node_modules/mysql/lib/protocol/Protocol.js:112:13)
2020-03-18T21:17:16.338608+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:94:28)
2020-03-18T21:17:16.338608+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:526:10)
2020-03-18T21:17:16.338608+00:00 app[web.1]: at Socket.emit (events.js:323:22)
2020-03-18T21:17:16.338609+00:00 app[web.1]: at endReadableNT (_stream_readable.js:1204:12)
2020-03-18T21:17:16.338609+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:84:21)
2020-03-18T21:17:16.338610+00:00 app[web.1]: Emitted 'error' event on Connection instance at:
2020-03-18T21:17:16.338610+00:00 app[web.1]: at Connection._handleProtocolError (/app/node_modules/mysql/lib/Connection.js:423:8)
2020-03-18T21:17:16.338610+00:00 app[web.1]: at Protocol.emit (events.js:311:20)
2020-03-18T21:17:16.338611+00:00 app[web.1]: at Protocol._delegateError (/app/node_modules/mysql/lib/protocol/Protocol.js:398:10)
2020-03-18T21:17:16.338611+00:00 app[web.1]: at Protocol.end (/app/node_modules/mysql/lib/protocol/Protocol.js:116:8)
2020-03-18T21:17:16.338611+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:94:28)
2020-03-18T21:17:16.338612+00:00 app[web.1]: [... lines matching original stack trace ...]
2020-03-18T21:17:16.338612+00:00 app[web.1]: at processTicksAndRejections (internal/process/task_queues.js:84:21) {
2020-03-18T21:17:16.338612+00:00 app[web.1]: fatal: true,
2020-03-18T21:17:16.338612+00:00 app[web.1]: code: 'PROTOCOL_CONNECTION_LOST'
2020-03-18T21:17:16.338613+00:00 app[web.1]: }
2020-03-18T21:17:16.413682+00:00 heroku[web.1]: State changed from up to crashed
2020-03-18T21:17:16.392460+00:00 heroku[web.1]: Process exited with status 1
...