Ardakilic / alerthub

AlertHub is a simple tool written with NodeJS to get alerted from new GitHub and GitLab repository events.
MIT License
200 stars 12 forks source link

Docker container crashes if Github is not available #51

Closed reconman closed 2 years ago

reconman commented 2 years ago

Github was not available for a short time and the Alerthub Docker container repeatedly crashed with this exception:

Node.js v18.0.0
Application booted at Thu, 05 May 2022 08:22:55 GMT
node:events:505
      throw er; // Unhandled 'error' event
      ^

fetch_url_error: Cannot connect to https://www.github.com/gematik/api-ePA/commits/master.atom
    at Request.<anonymous> (/usr/src/app/node_modules/rss-feed-emitter/src/Feed.js:192:26)
    at Request.emit (node:events:539:35)
    at Request.onRequestError (/usr/src/app/node_modules/request/request.js:877:8)
    at ClientRequest.emit (node:events:527:28)
    at TLSSocket.socketErrorListener (node:_http_client:454:9)
    at TLSSocket.emit (node:events:527:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on FeedEmitter instance at:
    at FeedManager.onError (/usr/src/app/node_modules/rss-feed-emitter/src/FeedManager.js:99:19)
    at Feed.handleError (/usr/src/app/node_modules/rss-feed-emitter/src/Feed.js:205:20)
    at Request.<anonymous> (/usr/src/app/node_modules/rss-feed-emitter/src/Feed.js:192:14)
    at Request.emit (node:events:539:35)
    [... lines matching original stack trace ...]
    at emitErrorCloseNT (node:internal/streams/destroy:116:3) {
  feed: 'https://www.github.com/gematik/api-ePA/commits/master.atom'
}

Instead, the application should log the error and continue running.

Ardakilic commented 2 years ago

Hello, apologies for the late reply. Totally missed this out. I was changing jobs by that time.

Just released a new version, it addresses the issue and should be fixed.

Cheers!