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

[docker] client dies after a while #196

Open
fwenzel opened this issue May 6, 2019 · 11 comments
Open

[docker] client dies after a while #196

fwenzel opened this issue May 6, 2019 · 11 comments

Comments

@fwenzel
Copy link
Contributor

fwenzel commented May 6, 2019

Seems like the service dies on occasion and needs to be restarted.

The end of docker logs:

jeopardybot_1  | JeopardyBot connected to Slack instance.
jeopardybot_1  | Attempting to generate a new board from episode link http://www.j-archive.com/showgame.php?game_id=4834
jeopardybot_1  | Attempting to generate a new board from episode link http://www.j-archive.com/showgame.php?game_id=1718
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 2)
jeopardybot_1  | (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate theNode.js process with a non-zero exit code.
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 4)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 6)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 8)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 10)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 12)
jeopardybot_1  | JeopardyBot connected to Slack instance.
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 14)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 16)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 18)
jeopardybot_1  | (node:1) UnhandledPromiseRejectionWarning: Error: An API error occurred: message_not_found
jeopardybot_1  |     at platformErrorFromResult (/app/node_modules/@slack/client/dist/WebClient.js:747:42)
jeopardybot_1  |     at __await.makeRequest.then (/app/node_modules/@slack/client/dist/WebClient.js:464:39)
jeopardybot_1  |     at process._tickCallback (internal/process/next_tick.js:68:7)
jeopardybot_1  | (node:1) 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(). (rejection id: 20)
@fwenzel
Copy link
Contributor Author

fwenzel commented May 6, 2019

Then I do a docker-compose restart and new game works again:

jeopardybot_1  | Store state successfully persisted!
jeopardybot_1  | HTTP server started.
jeopardybot_1  | JeopardyBot connected to Slack instance.
jeopardybot_1  | Attempting to generate a new board from episode link http://www.j-archive.com/showgame.php?game_id=4182

@kesne
Copy link
Owner

kesne commented May 7, 2019

Looks like it’s an issue with the storage system. I’m guessing that the loop-hole I used was patched up. I’ll try to find a workaround.

@fwenzel
Copy link
Contributor Author

fwenzel commented May 8, 2019

ooo storage to save state on slack itself? Can the bot send a message to itself and edit that message as needed?

@kesne
Copy link
Owner

kesne commented May 8, 2019

Lol this is exactly what it does: https://github.com/kesne/jeopardy-bot/blob/master/src/CleverPersistence.ts

@kesne
Copy link
Owner

kesne commented May 12, 2019

@fwenzel I updated some of the error handling and added logging around persistence. Can you try the latest code or container and see if it resolves the issue? I also just booted a long-running container to see if I can reproduce it.

@fwenzel
Copy link
Contributor Author

fwenzel commented May 13, 2019

ah good call; I'll update the container (what's the docker-compose command for that 🤔) and see.

It just died again, oddly, one of the people in the room says it works if you add it to a new channel. So maybe the new client code also helps.

@kesne
Copy link
Owner

kesne commented May 13, 2019

I'm not sure about the command, maybe re-pull the image or something? Compose might want you to run rebuild too. The image is a lot smaller now, as an added benefit.

@fwenzel
Copy link
Contributor Author

fwenzel commented May 15, 2019

ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Failed at deleting old history messages.
ESC[36mjeopardybot_1  |ESC[0m { Error: An API error occurred: message_not_found
ESC[36mjeopardybot_1  |ESC[0m     at Object.platformErrorFromResult (/app/node_modules/@slack/web-api/dist/errors.js:50:33)
ESC[36mjeopardybot_1  |ESC[0m     at WebClient.apiCall (/app/node_modules/@slack/web-api/dist/WebClient.js:374:28)
ESC[36mjeopardybot_1  |ESC[0m     at process._tickCallback (internal/process/next_tick.js:68:7)
ESC[36mjeopardybot_1  |ESC[0m   code: 'slack_webapi_platform_error',
ESC[36mjeopardybot_1  |ESC[0m   data:
ESC[36mjeopardybot_1  |ESC[0m    { ok: false,
ESC[36mjeopardybot_1  |ESC[0m      error: 'message_not_found',
ESC[36mjeopardybot_1  |ESC[0m      response_metadata: { scopes: [Array], acceptedScopes: [Array] } } }
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...

@fwenzel
Copy link
Contributor Author

fwenzel commented May 15, 2019

persistence and restore after restart seems to work mostly?

@fwenzel
Copy link
Contributor Author

fwenzel commented May 15, 2019

Okay a little more info when this happens, the bot is not dead nor disconnected. In the channel, someone says "new game" and the logs show:
Attempting to generate a new board from episode link http://www.j-archive.com/showgame.php?game_id=4417

but nothing further happens, no more logs and no output in the channel.

The logs then continue periodically as expected:

ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...
ESC[36mjeopardybot_1  |ESC[0m Persisting Jeopardy state...

@fwenzel
Copy link
Contributor Author

fwenzel commented May 23, 2019

dumping more context here (for my reference or anyone who wants to fix it). Channel behavior when this happens:

image

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

2 participants