NamelessMC / Nameless-Plugin

Official NamelessMC server plugin
https://spigotmc.org/resources/nameless-plugin-for-v2.59032/
GNU General Public License v3.0
42 stars 26 forks source link

Website API #364

Closed DLmass closed 9 months ago

DLmass commented 9 months ago

I'm having some weird issues with the plugin and the website when trying to call the API. The Discord bot works without problems and it's using the same API.

[19:04:31 ERROR]: [NamelessMC] Unexpected error: Website returned a redirect. Please ensure your URL is correct, paying attention to whether it should use HTTP or HTTPS, or whether it should or should not contain 'www.'.
[19:04:31 ERROR]: [NamelessMC] com.namelessmc.plugin.lib.nameless-api.exception.NamelessException: Website returned a redirect. Please ensure your URL is correct, paying attention to whether it should use HTTP or HTTPS, or whether it should or should not contain 'www.'.
    at Nameless-Plugin-Paper-3.4.0.jar//com.namelessmc.plugin.lib.nameless-api.RequestHandler.makeConnection(RequestHandler.java:179)
    at Nameless-Plugin-Paper-3.4.0.jar//com.namelessmc.plugin.lib.nameless-api.RequestHandler.get(RequestHandler.java:86)
    at Nameless-Plugin-Paper-3.4.0.jar//com.namelessmc.plugin.lib.nameless-api.NamelessAPI.website(NamelessAPI.java:120)
    at Nameless-Plugin-Paper-3.4.0.jar//com.namelessmc.plugin.common.ApiProvider.api(ApiProvider.java:118)
    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:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:833)
Derkades commented 9 months ago

Did you try doing what the error message says in the first line?

DLmass commented 9 months ago

Did you try doing what the error message says in the first line?

Absolutely! Tried everything.

Derkades commented 9 months ago

What is the API URL in your config file?

DLmass commented 9 months ago

https / non-www one. I can access it by my browser and the discord bot can access it too. So I don't see any issues.

Derkades commented 9 months ago

The discord bot uses the exact same underlying API client so the URL must be different. Your browser follows redirects, which means it will work even if the URL is "wrong"

DLmass commented 9 months ago

Had to use a different host. You can mark this as resolved due to it being configuration issues.