lmariscal / twitchirc

Twitch Bot Development made Easier | DEPRECATED
Other
39 stars 15 forks source link

HTTP response code: 504 #43

Open BluMasc opened 6 years ago

BluMasc commented 6 years ago

i tried to write an own twitch bot. Every time i start it, it works fine for a few minutes and then gives me an HTTP response code: 504 or 505 Error Here is an example:

java.io.IOException: Server returned HTTP response code: 504 for URL: http://tmi.twitch.tv/group/user/blumasc/chatters at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at com.cavariux.twitchirc.Chat.Channel.getMods(Channel.java:224) at com.cavariux.twitchirc.Chat.Channel.isMod(Channel.java:249) at com.cavariux.twitchirc.Chat.User.isMod(User.java:53) at BluBot.onMessage(BluBot.java:67) at com.cavariux.twitchirc.Core.TwitchBot.start(TwitchBot.java:308) at MyRunnable.run(MyRunnable.java:32) at java.lang.Thread.run(Unknown Source) Exception in thread "Thread-2" java.lang.NullPointerException at com.cavariux.twitchirc.Chat.Channel.isMod(Channel.java:249) at com.cavariux.twitchirc.Chat.User.isMod(User.java:53) at BluBot.onMessage(BluBot.java:67) at com.cavariux.twitchirc.Core.TwitchBot.start(TwitchBot.java:308) at MyRunnable.run(MyRunnable.java:32) at java.lang.Thread.run(Unknown Source)

am i doing something wrong or do i just have a bad internet conection?

mvarendorff commented 6 years ago

If you are behind a proxy, you might want to try to access that without it (if possible for you). You might also want to try to open the URL in your browser (which worked perfectly fine for me; I got the expected response).

Generally 504 means "Gateway Timeout" and is caused when a server (often a proxy or the API server) is not able to get a response from other servers (in case of a proxy the response from the actual server or in case of the API server for example the data from a database) and should NOT be caused by an issue with the library.

It could also be that that has been a temporary issue by the tmi-API-endpoint and it is resolved now.

AlternativeSquid commented 6 years ago

Let me know if it works, if not add me on discord and I'll see what I can do. My bot is connected ATM.

Discord: Squiddy#2324

BluMasc commented 6 years ago

i have now tested a bit. I just get this error sometimes. othertimes it works perfectly. I am not behind a proxy. @Murfity i will add you on discord. Thanks for the help.