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

shell-bot keeps getting killed on its own if the output is large #43

Open
xd003 opened this issue Feb 1, 2021 · 3 comments
Open

shell-bot keeps getting killed on its own if the output is large #43

xd003 opened this issue Feb 1, 2021 · 3 comments

Comments

@xd003
Copy link

xd003 commented Feb 1, 2021

I have hosted shell-bot in my vps and i have kept it running on a tmux session. Everytime i am running my task from telegram , shell-bot process is getting killed . I have to again and again log into vps and run node server to start it again and again each time making it useless .Here's the log from the bottom of the tmux session just before it ends .

at Bot.callMethod (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:102:18)
    at ReplyQueue.action (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:104:14)
    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:65:12)
    at Bot.callAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:31:17)
    at Bot.nextAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:52:38)
    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:68:14)                                            at ReplyQueue.callback (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:106:14)
    at handleBody (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:157:25)
    at IncomingMessage.<anonymous> (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:146:33)
    at IncomingMessage.emit (events.js:203:15)
Emitted 'error' event at:
    at EditedMessage._whenEdited (/home/ubuntu/shell/lib/utils.js:99:17)
    at EditedMessage.<anonymous> (/home/ubuntu/shell/lib/utils.js:60:12)
    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:66:44)
    at ReplyQueue.callback (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:105:23)
    at handleBody (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:158:5)
    at IncomingMessage.<anonymous> (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:146:33)
    [... lines matching original stack trace ...]
    at process._tickCallback (internal/process/next_tick.js:63:19)

OS - Ubuntu 20

@andrewlytvyn
Copy link

I am using pm2

@andrewlytvyn
Copy link

andrewlytvyn commented Feb 1, 2021

npm install pm2 -g
pm2 start server.js
pm2 startup
pm2 save
and now pm2 make auto restart when severer.js is killed

https://pm2.keymetrics.io/docs/usage/quick-start/

I am using pm2

I am not really familiar with nodejs

Can you please tell me how do i use pm2 to control the shellbot . Not really sure if that would help to fix the shellbot getting killed issue but worth a try nevertheless

@xd003
Copy link
Author

xd003 commented Feb 2, 2021

@andrewlytvyn
Thanks for the pm2 guide , while it definitely does restart shell-bot once it's killed but the core issue still remains
Eg. You run something ( /run script.sh ) , sure pm2 will restart the shell-bot but the script you were running inside shell-bot will be stopped once shell-bot kills and restarts itself ,so there's no way to properly run the script fully without any interference

I got these errors as earlier in pm2 logs when shell-bot got killed and restarted itself

/home/ubuntu/.pm2/logs/server-error.log last 15 lines:
/home/ubuntu/.pm2/logs/server-out.log last 15 lines:
0|server   | Bot ready.
0|server   | Chat «;-; #Czwhynot»: running command «clone»

0|server  | { NetworkError: sendChatAction failed: Error: connect ETIMEDOUT 149.154.167.220:443
0|server  |     at new NetworkError (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:20:20)
0|server  |     at ClientRequest.handleResponse (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:133:24)
0|server  |     at ClientRequest.emit (events.js:198:13)
0|server  |     at TLSSocket.socketErrorListener (_http_client.js:401:9)
0|server  |     at TLSSocket.emit (events.js:198:13)
0|server  |     at emitErrorNT (internal/streams/destroy.js:91:8)
0|server  |     at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
0|server  |     at process._tickCallback (internal/process/next_tick.js:63:19)
0|server  | When calling method sendChatAction: { chat_id: 277334259, action: 'typing' }
0|server  |     at Bot.callMethod (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:102:18)
0|server  |     at ReplyQueue.action (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:104:14)
0|server  |     at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:65:12)
0|server  |     at Bot.callAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:31:17)
0|server  |     at Bot.nextAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:52:38)
0|server  |     at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:68:14)
0|server  |     at ReplyQueue.callback (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:106:14)
0|server  |     at handleBody (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:157:25)
0|server  |     at IncomingMessage.<anonymous> (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:146:33)
0|server  |     at IncomingMessage.emit (events.js:203:15)
0|server  |   name: 'NetworkError',
0|server  |   stack:
0|server  |    'NetworkError: sendChatAction failed: Error: connect ETIMEDOUT 149.154.167.220:443\n    at new NetworkError (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:20:20)\n    at ClientRequest.handleResponse (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:133:24)\n    at ClientRequest.emit (events.js:198:13)\n    at TLSSocket.socketErrorListener (_http_client.js:401:9)\n    at TLSSocket.emit (events.js:198:13)\n    at emitErrorNT (internal/streams/destroy.js:91:8)\n    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)\n    at process._tickCallback (internal/process/next_tick.js:63:19)\nWhen calling method sendChatAction: { chat_id: 277334259, action: \'typing\' }\n    at Bot.callMethod (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:102:18)\n    at ReplyQueue.action (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:104:14)\n    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:65:12)\n    at Bot.callAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:31:17)\n    at Bot.nextAction (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:52:38)\n    at Bot.enqueueError (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:68:14)\n    at ReplyQueue.callback (/home/ubuntu/shell/node_modules/botgram/lib/reply.js:106:14)\n    at handleBody (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:157:25)\n    at IncomingMessage.<anonymous> (/home/ubuntu/shell/node_modules/botgram/lib/bot.js:146:33)\n    at IncomingMessage.emit (events.js:203:15)',

Hopefully this might be something useful for @mildsunrise to look into

@xd003 xd003 mentioned this issue Feb 2, 2021
@xd003 xd003 changed the title shell-bot keeps getting killed on its own shell-bot keeps getting killed on its own if the output is large Feb 2, 2021
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