Задать вопрос
guerrrka
@guerrrka

Почему разрывается соеденинение imap?

Вторую ночь подряд падает Telegram бот, который по команде ищет письмо и выводит из него нужную информацию. Для работы с imap использую imap-simple.
Лог
2020-08-21T02:34:49: Error: This socket has been ended by the other party
2020-08-21T02:34:49:     at Socket.writeAfterFIN [as write] (net.js:452:14)
2020-08-21T02:34:49:     at JSStreamSocket.doWrite (internal/js_stream_socket.js:170:19)
2020-08-21T02:34:49:     at JSStream.onwrite (internal/js_stream_socket.js:28:57)
2020-08-21T02:34:49:     at TLSSocket.Socket._final (net.js:415:28)
2020-08-21T02:34:49:     at callFinal (_stream_writable.js:609:10)
2020-08-21T02:34:49:     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
2020-08-21T02:34:49:   code: 'EPIPE',
2020-08-21T02:34:49:   source: 'socket'
2020-08-21T02:34:49: }
2020-08-21T02:34:52: ConnectionTimeoutError: connection timed out. timeout = 2000 ms
2020-08-21T02:34:52:     at Connection.imapOnError (/home/asupportsdev/node_modules/imap-simple/lib/imapSimple.js:610:23)
2020-08-21T02:34:52:     at Object.onceWrapper (events.js:417:26)
2020-08-21T02:34:52:     at Connection.emit (events.js:310:20)
2020-08-21T02:34:52:     at Timeout._onTimeout (/home/asupportsdev/node_modules/imap/lib/Connection.js:141:12)
2020-08-21T02:34:52:     at listOnTimeout (internal/timers.js:549:17)
2020-08-21T02:34:52:     at processTimers (internal/timers.js:492:7)
2020-08-21T02:34:56: ConnectionTimeoutError: connection timed out. timeout = 2000 ms
2020-08-21T02:34:56:     at Connection.imapOnError (/home/asupportsdev/node_modules/imap-simple/lib/imapSimple.js:610:23)
2020-08-21T02:34:56:     at Object.onceWrapper (events.js:417:26)
2020-08-21T02:34:56:     at Connection.emit (events.js:310:20)
2020-08-21T02:34:56:     at Timeout._onTimeout (/home/asupportsdev/node_modules/imap/lib/Connection.js:141:12)
2020-08-21T02:34:56:     at listOnTimeout (internal/timers.js:549:17)
2020-08-21T02:34:56:     at processTimers (internal/timers.js:492:7)
2020-08-21T02:35:00: ConnectionTimeoutError: connection timed out. timeout = 2000 ms
2020-08-21T02:35:00:     at Connection.imapOnError (/home/asupportsdev/node_modules/imap-simple/lib/imapSimple.js:610:23)
2020-08-21T02:35:00:     at Object.onceWrapper (events.js:417:26)
2020-08-21T02:35:00:     at Connection.emit (events.js:310:20)
2020-08-21T02:35:00:     at Timeout._onTimeout (/home/asupportsdev/node_modules/imap/lib/Connection.js:141:12)
2020-08-21T02:35:00:     at listOnTimeout (internal/timers.js:549:17)
2020-08-21T02:35:00:     at processTimers (internal/timers.js:492:7)
2020-08-21T02:35:03: ConnectionTimeoutError: connection timed out. timeout = 2000 ms
2020-08-21T02:35:03:     at Connection.imapOnError (/home/asupportsdev/node_modules/imap-simple/lib/imapSimple.js:610:23)
2020-08-21T02:35:03:     at Object.onceWrapper (events.js:417:26)
2020-08-21T02:35:03:     at Connection.emit (events.js:310:20)
2020-08-21T02:35:03:     at Timeout._onTimeout (/home/asupportsdev/node_modules/imap/lib/Connection.js:141:12)
2020-08-21T02:35:03:     at listOnTimeout (internal/timers.js:549:17)
2020-08-21T02:35:03:     at processTimers (internal/timers.js:492:7)
2020-08-21T02:35:07: ConnectionTimeoutError: connection timed out. timeout = 2000 ms
2020-08-21T02:35:07:     at Connection.imapOnError (/home/asupportsdev/node_modules/imap-simple/lib/imapSimple.js:610:23)
2020-08-21T02:35:07:     at Object.onceWrapper (events.js:417:26)
2020-08-21T02:35:07:     at Connection.emit (events.js:310:20)
2020-08-21T02:35:07:     at Timeout._onTimeout (/home/asupportsdev/node_modules/imap/lib/Connection.js:141:12)
2020-08-21T02:35:07:     at listOnTimeout (internal/timers.js:549:17)
2020-08-21T02:35:07:     at processTimers (internal/timers.js:492:7)
2020-08-21T02:35:11: ConnectionTimeoutError: connection timed out. timeout = 2000 ms
2020-08-21T02:35:11:     at Connection.imapOnError (/home/asupportsdev/node_modules/imap-simple/lib/imapSimple.js:610:23)
2020-08-21T02:35:11:     at Object.onceWrapper (events.js:417:26)
2020-08-21T02:35:11:     at Connection.emit (events.js:310:20)
2020-08-21T02:35:11:     at Timeout._onTimeout (/home/asupportsdev/node_modules/imap/lib/Connection.js:141:12)
2020-08-21T02:35:11:     at listOnTimeout (internal/timers.js:549:17)
2020-08-21T02:35:11:     at processTimers (internal/timers.js:492:7)
2020-08-21T02:36:51: Error: This socket has been ended by the other party
2020-08-21T02:36:51:     at Socket.writeAfterFIN [as write] (net.js:452:14)
2020-08-21T02:36:51:     at JSStreamSocket.doWrite (internal/js_stream_socket.js:170:19)
2020-08-21T02:36:51:     at JSStream.onwrite (internal/js_stream_socket.js:28:57)
2020-08-21T02:36:51:     at TLSSocket.Socket._final (net.js:415:28)
2020-08-21T02:36:51:     at callFinal (_stream_writable.js:609:10)
2020-08-21T02:36:51:     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
2020-08-21T02:36:51:   code: 'EPIPE',
2020-08-21T02:36:51:   source: 'socket'
2020-08-21T02:36:51: }

Вчерашний лог идентичен, время приблизетельно такое же - 03:53:05. Смущает то, что данное явление происходит раз в сутки, и именно ночью, когда бот никем не используется. После каждой ошибки PM2 перезагрузил скрипт, но соеденение Imap не восстановилось до ручной перезагрузки.
  • Вопрос задан
  • 188 просмотров
Подписаться 2 Средний Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы