Bot keeps becoming unresponsive

PhantomBot Version: 3.0.0 (Revision: fcc08b51)
OS Version: Linux - Ubuntu 16.04
Java Version: 1.8.0_222-8u222-b10-1ubuntu1~16.04.1-b10
Stock PhantomBot: Yes

After some time of being active in Twitch chat, the bot stops responding to commands or posting into twitch chat. It’s still connected to the Twitch chat and shows up in the user list in the Twitch chat and as online on Discord. The Dashboard is also accessible too.

Nothing was posted to the logs around the time of disconnect, only shortly after when it was restarted.

This was the final messages before the problem occured in this instance (I think the loss icons was just the standard Twitch chat visual bug, it wasn’t removed as moderator or anything): https://media.discordapp.net/attachments/587053815124066314/667214168327323648/unknown.png

This was in /logs/error 4 hours earlier:

[01-16-2020 @ 15:34:27.115 PST] [init.js:325] Error with Event Handler [ircChannelLeave] Script [./core/permissions.js] Stacktrace [permissions.js:725 > init.js:323 > init.js:643] Exception [TypeError: Cannot read property “0” from undefined]

And this is from after restarting the bot:

[01-16-2020 @ 03:54:37.989 GMT] java.lang.ArrayIndexOutOfBoundsException: 1
at tv.phantombot.twitch.irc.TwitchWSIRCParser.parseLine(TwitchWSIRCParser.java:270)
at tv.phantombot.twitch.irc.TwitchWSIRCParser.parseData(TwitchWSIRCParser.java:150)
at tv.phantombot.twitch.irc.TwitchWSIRC$1.run(TwitchWSIRC.java:190)
at java.lang.Thread.run(Thread.java:748)

[01-16-2020 @ 03:54:54.227 GMT] java.io.FileNotFoundException: PhantomBot.plinkybot.pid (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at tv.phantombot.PhantomBot.(PhantomBot.java:629)
at tv.phantombot.PhantomBot.main(PhantomBot.java:1352)

[01-16-2020 @ 03:55:20.299 GMT] java.io.FileNotFoundException: PhantomBot.plinkybot.pid (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at tv.phantombot.PhantomBot.(PhantomBot.java:629)
at tv.phantombot.PhantomBot.main(PhantomBot.java:1352)

Weirdly enough, the restart command doesn’t work either. You have to run stop and then start instead.

I was wondering if updating to the nightly build will fix but concerned about other issues that might come with it.

Thank you for help in advance!

I have been experiencing this as well and also happened when the Twitch chat badges disappear. In my case, it does get removed from moderators from permissions and re-adding it as a caster fixes the issue.

I was able to also locally reproduce the behaviour by re-creating the old test faketwitchmsg and running something like:

faketwitchmsg @badge-info=;badges=premium/1;color=#1E90FF;display-name=BotName;emote-sets=0,300206312;mod=0;subscriber=0;user-type= :tmi.twitch.tv USERSTATE #emptym

multiple times and then the bot later stops responding. I had to run it ~3 times to get the behaviour. I’m not sure if this is what happens when the badges are missing but it might be.

I also tried hardcoding the bot name in this if statement:

https://github.com/PhantomBot/PhantomBot/blob/43c5fa315bf8300f1eaf3528355c173cb35a8364/source/tv/phantombot/twitch/irc/TwitchWSIRCParser.java#L568

and the bot was no longer going unresponsive so it really seems like the issue. These error messages seem to be console logs so we don’t really see these in the errors logs.

I was also hoping if there can be a long term fix for this

1 Like

Any input on this from the devs?

Bump?