Skip to content
This repository has been archived by the owner on Sep 26, 2018. It is now read-only.

HTTP response code: 504 #43

Open
BluMasc opened this issue Apr 28, 2018 · 3 comments
Open

HTTP response code: 504 #43

BluMasc opened this issue Apr 28, 2018 · 3 comments

Comments

@BluMasc
Copy link

BluMasc commented Apr 28, 2018

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?

@geisterfurz007
Copy link
Collaborator

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
Copy link

AlternativeSquid commented Apr 29, 2018

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
Copy link
Author

BluMasc commented Apr 30, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants