Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stops working after an extended period of time #594

Open
misyltoad opened this issue Jun 7, 2021 · 3 comments
Open

Stops working after an extended period of time #594

misyltoad opened this issue Jun 7, 2021 · 3 comments

Comments

@misyltoad
Copy link

misyltoad commented Jun 7, 2021

Hello!

I am using the docker build of this repo with the following docker-compose:

  irc-bridge:
    image: discordirc/discord-irc
    hostname: discordirc.froggi.es
    networks:
      - internal
      - web
    volumes:
      - ./irc-bridge/config.json:/config/config.json
    container_name: irc-bridge
    restart: unless-stopped

which is:

[joshua@pond ~]$ sudo docker images | grep irc
discordirc/discord-irc                latest         6c2387a7f3a7   6 months ago    199MB

and config:

[
  {
    "nickname": "VKx",
    "server": "irc.libera.chat",
    "discordToken": "[redacted]",
    "channelMapping": {
      "#frogbridge": "#frogbridge",
      "#winehackers": "#winehackers"
    },
    "ircOptions": {
      "floodProtection": false,
      "port": "6697",
      "secure": true,
      "sasl": true,
      "username": "VKx",
      "password": "[redacted]"
    },
    "format": {
      "commandPrelude": "Command sent by {$nickname}",
      "ircText": "<{$displayUsername}> {$text}",
      "urlAttachment": "<{$displayUsername}> {$attachmentURL}",
      "discord": "**<{$author}>** {$withMentions}",
      "webhookAvatarURL": "https://robohash.org/{$nickname}?set=set4"
    },
    "parallelPingFix": true,
    "ircStatusNotices": false,
    "webhooks": {
      "#frogbridge": "[redacted]",
      "#winehackers": "[redacted]"
    }
  }
]

and after a while of running, the irc-bridge, it will just stop working, my docker setup should make it restart if it crashes.

[joshua@pond ~]$ sudo docker logs irc-bridge

> discord-irc@2.9.0 start /bot
> node dist/index.js "--config" "/config/config.json"

2021-06-01T21:01:11.950Z info: Connected to IRC
2021-06-01T21:01:12.038Z info: Connected to Discord
(node:25) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at RequestHandler.execute (/bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:25) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:25) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at RequestHandler.execute (/bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:25) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at RequestHandler.execute (/bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:25) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at RequestHandler.execute (/bot/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

> discord-irc@2.9.0 start /bot
> node dist/index.js "--config" "/config/config.json"

2021-06-01T21:49:26.297Z info: Connected to Discord
2021-06-01T21:49:26.439Z info: Connected to IRC

> discord-irc@2.9.0 start /bot
> node dist/index.js "--config" "/config/config.json"

2021-06-02T12:00:05.905Z info: Connected to Discord
2021-06-02T12:00:06.415Z info: Connected to IRC

> discord-irc@2.9.0 start /bot
> node dist/index.js "--config" "/config/config.json"

2021-06-04T18:40:15.214Z info: Connected to Discord
2021-06-04T18:40:15.841Z info: Connected to IRC
2021-06-04T19:35:07.797Z error: request to [redacted]?wait=true failed, reason: read ETIMEDOUT
2021-06-04T19:35:33.853Z info: Connected to IRC
2021-06-04T20:05:31.924Z info: Connected to IRC
2021-06-04T21:15:38.922Z info: Connected to IRC
2021-06-04T22:32:50.754Z info: Connected to IRC
2021-06-05T00:44:27.746Z info: Connected to IRC

> discord-irc@2.9.0 start /bot
> node dist/index.js "--config" "/config/config.json"

2021-06-06T04:01:45.229Z info: Connected to Discord
2021-06-06T04:01:45.402Z info: Connected to IRC

This log spam always seems to occur, then it will stop working at all. It will no longer be present on the IRC server also.

Sorry for the lack of specific info... I don't super know what you would need to help me debug or diagnose this problem.

The missing permission stuff is weird, but I don't see why it'd work for a day or two then just suddenly start having random missing permissions stop it from working...

Thanks for your time!

@misyltoad
Copy link
Author

This seems to happen whenever my internet goes down and then it never tries to reconnect or restart.

@misyltoad
Copy link
Author

The solution was to set "retryCount": null in my config.

This defaulting to 10 and then not working forever again is pretty silly. Can this be changed? It also isn't documented anywhere.

@misyltoad
Copy link
Author

Nevermind, that still doesn't fix it, it just randomly dies after some point and never reconnnects even with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant