plan-player-analytics / Plan

Player Analytics plugin for Minecraft Server platforms - View player activity of your server with ease. :calendar:
https://www.spigotmc.org/resources/plan-player-analytics.32536/
GNU Lesser General Public License v3.0
869 stars 168 forks source link

Fail Safely with BuycraftX/Tebex Extension #1377

Closed austin4195 closed 4 years ago

austin4195 commented 4 years ago

Is your feature request related to a problem? Please describe.

Upon booting my server up after having removed the BuycraftX plugin from my server but already copied its server key into the Plan config, when the key was invalid the server spammed many errors until the server crashed. ### I would like to be able to..

Some way for if the BuycraftX key is invalid, It fails safely so that the server does not crash. I was able to fix it by removing the config but some may not know. By adding a fail safely, it can prompt the user in the console that the key is invalid and if the key is not longer active to remove it.

AuroraLS3 commented 4 years ago

Could you send the error so that I can properly catch it in the code

austin4195 commented 4 years ago

> [Plan] Encountered IllegalArgumentException with Buycraft Extension (failed safely) when updating value for 'server', the method was disabled temporarily (won't be called until next Plan reload), stack trace to follow (please report this):
> [12:37:17] [Craft Scheduler Thread - 7/WARN]: [Plan] Error was caught by com.djrapitops.plan.extension.ExtensionSvc
> java.lang.IllegalArgumentException: class com.djrapitops.extension.BuycraftExtension method purchaseTable could not be called: null
>   at com.djrapitops.plan.extension.implementation.providers.MethodWrapper.callMethod(MethodWrapper.java:51) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.gathering.TableProviderValueGatherer.lambda$null$3(TableProviderValueGatherer.java:82) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.gathering.TableProviderValueGatherer.getMethodResult(TableProviderValueGatherer.java:119) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.gathering.TableProviderValueGatherer.gatherTableDataOfProvider(TableProviderValueGatherer.java:103) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.gathering.TableProviderValueGatherer.gatherTableDataOfServer(TableProviderValueGatherer.java:86) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.gathering.ProviderValueGatherer.updateValues(ProviderValueGatherer.java:162) ~[?:?]
>   at com.djrapitops.plan.extension.ExtensionSvc.updateServerValues(ExtensionSvc.java:200) ~[?:?]
>   at com.djrapitops.plan.extension.ExtensionSvc.updateServerValues(ExtensionSvc.java:187) ~[?:?]
>   at com.djrapitops.plan.extension.ExtensionServerMethodCallerTask.run(ExtensionServerMethodCallerTask.java:41) ~[?:?]
>   at com.djrapitops.plugin.task.bukkit.BukkitRunnableFactory$1.run(BukkitRunnableFactory.java:55) ~[?:?]
>   at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84) ~[patched_1.15.2.jar:git-Paper-145]
>   at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.15.2.jar:git-Paper-145]
>   at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.15.2.jar:git-Paper-145]
>   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_212]
>   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_212]
>   at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
> Caused by: java.lang.reflect.InvocationTargetException
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
>   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212]
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
>   at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
>   at com.djrapitops.plan.extension.implementation.providers.Parameters$ServerParameters.usingOn(Parameters.java:63) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.MethodWrapper.callMethod(MethodWrapper.java:46) ~[?:?]
>   ... 15 more
> Caused by: java.lang.IllegalStateException: IOException occurred
>   at com.djrapitops.extension.ListPaymentRequest.makeRequest(ListPaymentRequest.java:82) ~[?:?]
>   at com.djrapitops.extension.BuycraftExtension.purchaseTable(BuycraftExtension.java:72) ~[?:?]
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
>   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212]
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
>   at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
>   at com.djrapitops.plan.extension.implementation.providers.Parameters$ServerParameters.usingOn(Parameters.java:63) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.MethodWrapper.callMethod(MethodWrapper.java:46) ~[?:?]
>   ... 15 more
> Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: https://plugin.tebex.io/payments
>   at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894) ~[?:1.8.0_212]
>   at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[?:1.8.0_212]
>   at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263) ~[?:1.8.0_212]
>   at com.djrapitops.extension.ListPaymentRequest.makeRequest(ListPaymentRequest.java:64) ~[?:?]
>   at com.djrapitops.extension.BuycraftExtension.purchaseTable(BuycraftExtension.java:72) ~[?:?]
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212]
>   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_212]
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
>   at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
>   at com.djrapitops.plan.extension.implementation.providers.Parameters$ServerParameters.usingOn(Parameters.java:63) ~[?:?]
>   at com.djrapitops.plan.extension.implementation.providers.MethodWrapper.callMethod(MethodWrapper.java:46) ~[?:?]
>   ... 15 more