LOOHP / InteractiveChat-DiscordSRV-Addon

Add InteractiveChat functionalities to DiscordSRV as an addon
https://www.spigotmc.org/resources/83917/
GNU General Public License v3.0
36 stars 16 forks source link

Unable to fetch assets from "api.loohpjames.com" #38

Open KillerOfPie opened 10 months ago

KillerOfPie commented 10 months ago

Got this error multiple times between 16:02 and 16:27.

Don't think a stack trace is necessary here. Also, if this is thrown could you make it check if a connection can be made to another server like google or Mojang auth to validate if it is a Server Internet issue or API site issue and provide an appropriate warning?

[InteractiveChatDiscordSRVAddon] Plugin InteractiveChatDiscordSrvAddon v4.2.8.0 generated an exception while executing task 158
java.lang.RuntimeException: Unable to fetch assets from "api.loohpjames.com". This could be an internet issue or "api.loohpjames.com" is down. If the plugin functions correctly after this, this error can be ignored.
        at com.loohp.interactivechatdiscordsrvaddon.resources.ResourceDownloadManager.ensureData(ResourceDownloadManager.java:93) ~[InteractiveChatDiscordSrvAddon-4.2.8.0.jar:?]
        at com.loohp.interactivechatdiscordsrvaddon.resources.ResourceDownloadManager.downloadExtras(ResourceDownloadManager.java:233) ~[InteractiveChatDiscordSrvAddon-4.2.8.0.jar:?]
        at com.loohp.interactivechatdiscordsrvaddon.AssetsDownloader.loadExtras(AssetsDownloader.java:168) ~[InteractiveChatDiscordSrvAddon-4.2.8.0.jar:?]
        at com.loohp.interactivechatdiscordsrvaddon.InteractiveChatDiscordSrvAddon.lambda$onEnable$3(InteractiveChatDiscordSrvAddon.java:387) ~[InteractiveChatDiscordSrvAddon-4.2.8.0.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.2.jar:git-Paper-280]
        at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.2.jar:git-Paper-280]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:840) ~[?:?]
Unix-User commented 3 months ago

this is happening here to:


java.lang.RuntimeException: Unable to fetch assets from "api.loohpjames.com". This could be an internet issue or "api.loohpjames.com" is down. If the plugin functions correctly after this, this error can be ignored.
    at InteractiveChatDiscordSrvAddon-4.2.10.1.jar//com.loohp.interactivechatdiscordsrvaddon.resources.ResourceDownloadManager.ensureData(ResourceDownloadManager.java:93)
    at InteractiveChatDiscordSrvAddon-4.2.10.1.jar//com.loohp.interactivechatdiscordsrvaddon.resources.ResourceDownloadManager.downloadExtras(ResourceDownloadManager.java:233)
    at InteractiveChatDiscordSrvAddon-4.2.10.1.jar//com.loohp.interactivechatdiscordsrvaddon.AssetsDownloader.loadExtras(AssetsDownloader.java:168)
    at InteractiveChatDiscordSrvAddon-4.2.10.1.jar//com.loohp.interactivechatdiscordsrvaddon.InteractiveChatDiscordSrvAddon.lambda$onEnable$3(InteractiveChatDiscordSrvAddon.java:387)
    at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101)
    at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1623)```
mist8kengas commented 2 months ago

The issue seems to be a timeout error caused by the API responding after at least ~40 seconds. This results in Cloudflare returning a 522 Connection Timed Out error response.

#
# route that returns all the latest versions of LOOHP's plugins
$ time curl -s https://api.loohpjames.com/spigot/data
error code: 522
real    0m40.286s
user    0m0.000s
sys     0m0.047s

$ time curl -s https://api.loohpjames.com/spigot/data
error code: 522
real    0m39.326s
user    0m0.015s
sys     0m0.015s

$ time curl -s https://api.loohpjames.com/spigot/data
error code: 524
real    3m29.504s
user    0m0.000s
sys     0m0.046s

#
# base route
$ time curl -s https://api.loohpjames.com
{"Status":"OK","Runtime-Mode":"productionMode","Application-Author":"LOOHP","Soulmate-Count":1,"Application-Description":"LOOHP's Public API.","API-Version":"v1","Application-Owner":"LOOHP","Given-Name":"AppLEshakE","Splash":"Distance is measured with love. \uD83C\uDF20"}
real    1m2.286s
user    0m0.000s
sys     0m0.062s

$ time curl -s https://api.loohpjames.com
error code: 525
real    1m18.614s
user    0m0.000s
sys     0m0.031s

$ time curl -s https://api.loohpjames.com
{"Status":"OK","Runtime-Mode":"productionMode","Application-Author":"LOOHP","Soulmate-Count":1,"Application-Description":"LOOHP's Public API.","API-Version":"v1","Application-Owner":"LOOHP","Given-Name":"AppLEshakE","Splash":"Dream, Imagine, Stay Wild."}
real    1m35.499s
user    0m0.015s
sys     0m0.031s
Espressocodes commented 2 months ago

Getting the same issue as well since latest dev build. Attempted rollback but it's all the same api so it's the same problem. It doesn't seem to mess with the server function, but to be consistent here's the report:

It goes up and down so I'm guessing the connection is just having issues.


java.lang.RuntimeException: Unable to fetch assets from "api.loohpjames.com". This could be an internet issue or "api.loohpjames.com" is down. If the plugin functions correctly after this, this error can be ignored.
    at InteractiveChatDiscordSrvAddon-4.2.11.0.jar/com.loohp.interactivechatdiscordsrvaddon.resources.ResourceDownloadManager.ensureData(ResourceDownloadManager.java:93) ~[InteractiveChatDiscordSrvAddon-4.2.11.0.jar:?]
    at InteractiveChatDiscordSrvAddon-4.2.11.0.jar/com.loohp.interactivechatdiscordsrvaddon.resources.ResourceDownloadManager.downloadExtras(ResourceDownloadManager.java:233) ~[InteractiveChatDiscordSrvAddon-4.2.11.0.jar:?]
    at InteractiveChatDiscordSrvAddon-4.2.11.0.jar/com.loohp.interactivechatdiscordsrvaddon.AssetsDownloader.loadExtras(AssetsDownloader.java:168) ~[InteractiveChatDiscordSrvAddon-4.2.11.0.jar:?]
    at InteractiveChatDiscordSrvAddon-4.2.11.0.jar/com.loohp.interactivechatdiscordsrvaddon.InteractiveChatDiscordSrvAddon.lambda$onEnable$3(InteractiveChatDiscordSrvAddon.java:388) ~[InteractiveChatDiscordSrvAddon-4.2.11.0.jar:?]
    at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:86) ~[paper-1.21.jar:1.21-123-0a1be9a]
    at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.21.jar:1.21-123-0a1be9a]
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.21.jar:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
LOOHP commented 2 months ago

Yes there's been some connection issues to the server lately. If only I can afford a better one haha. Well, in the meantime if it continues to work correctly then you can ignore these connection errors.

mist8kengas commented 2 months ago

Yes there's been some connection issues to the server lately. If only I can afford a better one haha. Well, in the meantime if it continues to work correctly then you can ignore these connection errors.

How much load does your current server handle? I might be able to donate some of my servers' computing power if needed :)

Espressocodes commented 2 months ago

Seconding the last comment. If you need some I would happily donate some server for the api as a fallback. I can't do an immense amount of traffic but I can do some.

LOOHP commented 1 month ago

Well currently the software running the API isn't written with the ability to distribute to different servers. Thanks for your kindness to help tho.

mauvehed commented 2 weeks ago

@LOOHP what is api.loohpjames.com and what calls/data are sent there?

LOOHP commented 2 weeks ago

Here is a copy of the pinned message outline network requests the plugin makes.


InteractiveChatDiscordSrvAddon requires communication to these sites in order to function, please do not block them.

https://api.loohpjames.com (My API, for looking up whether new assets need to be downloaded) https://resources.loohpjames.com/ (Where my resources are hosted) http://resources.download.minecraft.net/ (Mojang assets) https://launchermeta.mojang.com/ (Mojang API) https://piston-meta.mojang.com/ (Mojang API and assets) https://repo1.maven.org/ (Maven repository to download required libraries)

Please do not block my API thinking that it is only used to notify you about plugin updates. It is much more than that. Without the API, you would have to download Mojang assets and my assets and merge them together yourself every time something is updated. (Ever notice sometimes your Minecraft launcher redownloads assets when you boot the game?)