Discord Stream Alerts stopped working

PhantomBot Version: 3.0.0 (Revision: fcc08b51)
Operating System: Mac OS X
Java Version: 1.8.0_77-b03

Last time I saw discord stream start alert function when my stream went live was 3/4/19, so it’s been down for over 2 months.

I’ve not changed anything with the bot (settings, files, etc) that should impact that, so I’m curious what might be the cause.

The bot is connected to discoard, and responds to a !test command I setup. Bot is also able to respond to test command inside announcements channel, so it’s not a discord issue permissions.
(no setting have changed on discord in months either)

Stream Alerts setting is still turned on and none of its options have changed since it was last functional.

Bot has since also stopped posting discord announcements for new subs, twitter, etc.

Checking logs I do see some errors that may relate to this issue: /logs/error/

[05-27-2019 @ 19:39:18.603 PDT] [init.js:325] Error with Event Handler [twitchOnline] Script [./discord/handlers/streamHandler.js] Stacktrace [setStream()@misc.js:131 > streamHandler.js:206 > init.js:323 > init.js:853] Exception [JavaException: java.lang.NullPointerException: null]

[05-27-2019 @ 19:39:30.715 PDT] [init.js:325] Error with Event Handler [twitter] Script [./discord/handlers/twitterHandler.js] Stacktrace [twitterHandler.js:57 > init.js:323 > init.js:839] Exception [JavaException: java.lang.NullPointerException: null]

I also noticed that in /logs/core-error/ the following error is out of control making massive files:

[05-27-2019 @ 23:59:59.749 GMT] [handleError()@ExceptionHandler.java:26] Failed to dispatch event [public void tv.phantombot.console.ConsoleEventHandler.onConsoleInput(tv.phantombot.event.console.ConsoleInputEvent)] to [[email protected]] null

[05-27-2019 @ 23:59:59.749 GMT] java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at net.engio.mbassy.dispatch.ReflectiveHandlerInvocation.invoke(ReflectiveHandlerInvocation.java:29)
	at net.engio.mbassy.dispatch.MessageDispatcher.dispatch(MessageDispatcher.java:30)
	at net.engio.mbassy.dispatch.FilteredMessageDispatcher.dispatch(FilteredMessageDispatcher.java:42)
	at net.engio.mbassy.subscription.Subscription.publish(Subscription.java:72)
	at net.engio.mbassy.bus.MessagePublication.execute(MessagePublication.java:49)
	at net.engio.mbassy.bus.MBassador.publish(MBassador.java:66)
	at tv.phantombot.event.EventBus.post(EventBus.java:75)
	at tv.phantombot.console.ConsoleInputListener.run(ConsoleInputListener.java:32)
Caused by: java.lang.NullPointerException

it’s making a log file every day that is up to 1.82GB

Thanks in advance for any help!

The null error would be caused by running PhantomBot as a service/in the background with the wrong script. The console has empty messages written to it continuously.

Attempt to bounce the bot if you are not seeing messages post. It might need to reinitialize with APIs.

As a couple of folks are seeing the messages occasionally stop, I have written a debug version of the script that I am running on one of my production bots, collecting information. I have not seen that issue, I am hoping that I do and it captures some sort of information. If it doesn’t, I might ask someone else to run the debugging version of the script (it does create a lot of logs though).

To fix the onConsoleInput spam, please make sure your launchd script is using launch-service.sh and not launch.sh to launch the bot. If you have copied the java launch command directly from one of these scripts into your launchd script, make sure you do NOT have the -Dinteractive parameter present.

MacOS uses plist files, not launchd files. It isn’t really a script per se but a form of XML.

I’m just curious why it stopped working without any known changes on my end. I am running the bot via launch.sh, but that is how I’ve run the bot for years without issue. Is that a problem now, and if so, when did that change?

After a full system reboot some of the alerts (subs) work, but the stream live alert is still not working.

The log files in core-error are still eating around 1.5+ gig per day.

How do I get the bot to reinitialize with the APIs?

I’m happy to help test solutions or provide more info if needed.

Thanks again for the help!

The -Dinteractive command argument in launch.sh enables the Terminal input loop, which causes the onConsoleInput spam. If you are running as a service that doesn’t display a terminal window, this causes the Input stream to be invalid and throw an Exception

Double-check that botlogin.txt has a valid value for channel=

If you want to reinitialize with the API, try re-authing the streamer account at PhantomBot | Connect with Twitch then putting it in botlogin.txt for the apioauth= value

Hey there VexFx,

Recently a fix was pushed for this null pointer error you’re getting related to the alert system, however it seems to have been reverted, I will push my fix again and put it here for you to test (I’ve tested it before and it fixed this)

As for the console errors, I’ll see if I can make it stop spamming the useless errors for now.

Fixed here

Would the null pointer error be behind the bot not being able to post stream start notices to discord?

@gmt2001 that makes sense. I do have the bot running without a terminal when my computer boots, so that is understandable. I’d prefer if it did have a terminal when it was launched via the startup script I have running, but I set that up so long ago and would not know how to force it to launch with a console. My botlogin.txt has not been updated in many months, and channel is defined.

I’m happy to re-auth and put the new oauth key in my botlogin.txt but I would suspect an authorization issue would mean a 100% lack of connectivity, but the bot is still receiving subscriber events from twitch and posting those successfully to discord, so it seems to all be working. That said, without any change in the bot it also stopped posting subscriber events to discord for a long period of time, so it would seem something more serious is happening.

I’m not at the computer my bot is running on now, so I can’t run the apioauth command to update value that way, but I can put it in the botlogin.txt

I noticed the colon in the key appears to be escaped with a slash in my botlogin.txt right now

apioauth=oauth:XXXXXXXXXXXXXXXXX

And the value listed on https://phantombot.tv/oauth is not escaped. Is the slash required?

Thanks again!

The config manager in the bot does the escape automatically. Don’t worry about it.

Try Scania’s fix when the nightly build comes out first

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.