[Chrome, Ubuntu] Websocketserver not available?

Hi!

So, after some random time the panel is no longer accessible.

In Chrome DevTools, i can see that the WebSocket server is no longer reachable.
reconnectingWS.min.js:30 WebSocket connection to 'ws://<for safety reasons not shown>:2053/' failed: WebSocket is closed before the connection is established

2053 due to the server being behind CloudFlare but this does not matter because the panel is also not available via direct ip-access.
2053 is availabe from my home PC (checked with nmap)

I am using Chrome 74.0.3729.169 (Official Build) (64-Bit) (cohort: Stable)
with Javascript V8 7.4.288.28 and
Windows 10 Build 17134.285

The server is running Ubuntu 14.04.6 LTS and Java (JRE) 1.8.0_191 with phantombot 3.0.0

The logs do not contain any useful info (at least for me). There have been some OutOfMemory-Exceptions but i increased the RAM from 1M to 1G which fixed this issue.

I tried via DevTools to create a new WebSocket variable and connect to it via the DevTools console:

>var ws = new WebSocket("ws://<again removed>:2053/"); ws.onopen = (data) => console.debug(data); ws.onmessage = (data) => console.log(data); ws.onerror = (data) => console.error(data);

Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
WebSocket connection to 'ws://<removed>:2053/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET

~The_Red_Freak

Hey The_Red_Freak,

Sometimes CloudFlare is known to cause issues with websockets, can you try disabling it to see if the issue goes away.

Thanks.

Hi!

I tried that already, i also tried to access it from the raw machine ip and port.
Both methods dont work.

~The_Red_Freak

May we see the errors you have please, just in case we find them relevant.

I’m especially interested in the stacktraces and core-error logs

I would also like to see the startup logs from PhantomBot, along with what GMT is requesting. That is from the top line of the start-up to when it connects to Twitch.

Thanks!

Dont use CloudFlare CDN

As of writing this post, the webinterface is reachable and fully working. (I dunno why, i dunno how long. I’ll keep a look)

Core-errors: Core-errors - Pastebin.com
Stacktrace: Stacktrace - Pastebin.com

Startup: Startup log - Pastebin.com

If you would have read the initial post, you would’ve noticed i actually used the CF and raw ip. :stuck_out_tongue_winking_eye:

// Sorry for my broken english, i’m austrian.
// Also sorry that i’m a bit late on responding. Hope you forgive :smiley:

It says that on 06/03 you increased the memory allocation to 1GB yet I still see out of memory errors.

// Everything past 06-03-2019 has the memory increased to 1GB from 1MB

[06-09-2019 @ 17:34:53.770 GMT] java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:717)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1097)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1395)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1379)

[06-09-2019 @ 19:35:59.792 GMT] java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:717)
    at tv.phantombot.twitch.irc.TwitchWSIRC.onMessage(TwitchWSIRC.java:192)
    at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java)
    at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java)
    at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java)
    at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java)
    at java.lang.Thread.run(Thread.java:748)

I also see thread creation errors and network errors with Twitch. Did you update the memory after 6/10 then and the errors have gone away or those errors still exist?

You might also try to shutdown the bot and remove the following files - although they are to be recreated every restart:

web/ytplayer/js/playerConfig.js
web/panel/js/utils/panelConfig.js

I increased memory on 06-03-2019, so everything after this date is meant with that comment. I made this change sometime in the late evening.

No, those errors are not thrown after this date,

I’lltry to do that tomorrow and let you know.

But as said, currently there are currently no errors what so ever. If I encounter more i’ll let you know :wink:

Hi,

I moved both files to a different folder, where they are inaccessible for the Bot.
Still works.
I’ll keep an eye on it, but thanks for trying to help. I really don’t know what was happening!

~The_Red_Freak

Do you have any idea how long the bot had been continuously running before the problems would start?

I believe 1+ Day(s) not sure but definitely +1 Days.

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