[All Platforms] UnsupportedOperationException: JsonNull on commands with no package ID
bobhenl opened this issue · comments
Please include the following information with your report
- Server type and version (ex. Spigot 1.18.2) 1.20.1
- Tebex plugin version (ex. 2.0.1) 2.0.2
- Description of the issue with any error messages, stack traces, or relevant logs.
Hi, for some reason, players on my server receive this error:
[00:30:42 WARN]: [Tebex] Failed to get online commands for XX: java.lang.UnsupportedOperationException: JsonNull
[00:30:42 WARN]: java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException: JsonNull
[00:30:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
[00:30:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
[00:30:42 WARN]: at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
[00:30:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
[00:30:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
[00:30:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.sdk.request.TebexRequest$1.onResponse(TebexRequest.java:141)
[00:30:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.plugin.libs.okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[00:30:42 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[00:30:42 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[00:30:42 WARN]: at java.base/java.lang.Thread.run(Thread.java:840)
[00:30:42 WARN]: Caused by: java.lang.UnsupportedOperationException: JsonNull
[00:30:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.plugin.libs.gson.JsonElement.getAsInt(JsonElement.java:239)
[00:30:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.sdk.SDK.lambda$getOnlineCommands$3(SDK.java:217)
[00:30:42 WARN]: at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
[00:30:42 WARN]: ... 7 more
Can you enable debug mode via the plugin as well, use /tebex debug true and paste your logs after the next command check runs. We should see [debug] log entries alongside errors similar to the ones you're showing here.
Should have been fixed by d7304b3, but this is the same error. I believe the package ID is not provided by the Tebex API. Debug logs will show this.
[19:37:42 INFO]: [Tebex] [DEBUG] Checking for due players..
[19:37:42 INFO]: [Tebex] [DEBUG] -> GET https://plugin.tebex.io/queue | No body
[19:37:42 INFO]: [Tebex] [DEBUG] 200 <- GET https://plugin.tebex.io/queue
[19:37:42 INFO]: [Tebex] [DEBUG] | {"meta":{"execute_offline":false,"next_check":60,"more":false},"players":[{"id":3438209,"name":"PLAYERNAME","uuid":null}]}
[19:37:42 INFO]: [Tebex] [DEBUG] Found 1 player with pending commands.
[19:37:42 INFO]: [Tebex] [DEBUG] Processing online commands for player 'PLAYERNAME'...
[19:37:42 INFO]: [Tebex] [DEBUG] -> GET https://plugin.tebex.io/queue/online-commands/3438209 | No body
[19:37:42 INFO]: [Tebex] [DEBUG] 200 <- GET https://plugin.tebex.io/queue/online-commands/3438209
[19:37:42 INFO]: [Tebex] [DEBUG] | {"player":{"id":"00000000000000000000001748CE5F99","username":"PLAYERNAME","meta":null},"commands":[{"id":560580190,"command":"rawmsg {username} true <n>&6\ud83d\udc4b &fHey &4{username}&f, you left something behind!<n>&6\ud83d\uded2 &fDon't miss out &6\ud83e\udc46 &fcomplete your order now:<n>&6https:\/\/SERVERWEB\/recover\/Cqcht3518718177140kUOu4P \ud83c\udf1f<n>","payment":null,"package":null,"conditions":{"delay":0,"slots":0}},{"id":560580191,"command":"playsound minecraft:block.large_amethyst_bud.break player {username} ~ ~ ~ 1 2","payment":null,"package":null,"conditions":{"delay":0,"slots":0}},{"id":560602086,"command":"rawmsg {username} true <n>&6\ud83d\udc4b &fHey &4{username}&f, you left something behind!<n>&6\ud83d\uded2 &fDon't miss out &6\ud83e\udc46 &fcomplete your order now:<n>&6https:\/\/SERVERWEB\/recover\/i41VTc925718198568LkaEKY \ud83c\udf1f<n>","payment":null,"package":null,"conditions":{"delay":0,"slots":0}},{"id":560602087,"command":"playsound minecraft:block.large_amethyst_bud.break player {username} ~ ~ ~ 1 2","payment":null,"package":null,"conditions":{"delay":0,"slots":0}},{"id":560602684,"command":"rawmsg {username} true <n>&6\ud83d\udc4b &fHey &4{username}&f, you left something behind!<n>&6\ud83d\uded2 &fDon't miss out &6\ud83e\udc46 &fcomplete your order now:<n>&6https:\/\/SERVERWEB\/recover\/HKVyPe690718198866RrrpdY \ud83c\udf1f<n>","payment":null,"package":null,"conditions":{"delay":0,"slots":0}},{"id":560602685,"command":"playsound minecraft:block.large_amethyst_bud.break player {username} ~ ~ ~ 1 2","payment":null,"package":null,"conditions":{"delay":0,"slots":0}}]}
[19:37:42 WARN]: [Tebex] Failed to get online commands for PLAYERNAME: java.lang.UnsupportedOperationException: JsonNull
[19:37:42 WARN]: java.util.concurrent.CompletionException: java.lang.UnsupportedOperationException: JsonNull
[19:37:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
[19:37:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
[19:37:42 WARN]: at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
[19:37:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
[19:37:42 WARN]: at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
[19:37:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.sdk.request.TebexRequest$1.onResponse(TebexRequest.java:138)
[19:37:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.plugin.libs.okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
[19:37:42 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[19:37:42 WARN]: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[19:37:42 WARN]: at java.base/java.lang.Thread.run(Thread.java:840)
[19:37:42 WARN]: Caused by: java.lang.UnsupportedOperationException: JsonNull
[19:37:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.plugin.libs.gson.JsonElement.getAsInt(JsonElement.java:239)
[19:37:42 WARN]: at tebex-bukkit-2.0.2.jar//io.tebex.sdk.SDK.lambda$getOnlineCommands$3(SDK.java:217)
[19:37:42 WARN]: at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
[19:37:42 WARN]: ... 7 more
[19:37:42 INFO]: [Tebex] [DEBUG] -> GET https://plugin.tebex.io/information | No body
[19:37:42 INFO]: [NPCReplay] Loading actions from: recording_7.json
[19:37:43 INFO]: [Tebex] [DEBUG] 200 <- GET https://plugin.tebex.io/information
[19:37:43 INFO]: [Tebex] [DEBUG] | {"account":{"id":1367141,"domain":"https:\/\/SERVERWEB","name":"SERVERNAME","currency":{"iso_4217":"USD","symbol":"$"},"online_mode":true,"game_type":"Minecraft (Offline\/Geyser)","log_events":true},"server":{"id":1758852,"name":"SERVERNAME"},"analytics":{"internal":{"project":"","key":""}}}
[19:37:43 INFO]: [Tebex] [DEBUG] -> POST https://plugin-logs.tebex.io/ | {"game_id":"Purpur","framework_id":"Purpur 1.20.1 17.0.10","plugin_version":"2.0.2","server_ip":"0.0.0.0","error_message":"java.lang.UnsupportedOperationException: JsonNull","store_name":"SERVERNAME","store_url":"https://SERVERWEB"}
Btw I believe I have offline mode, not sure why it shows online
@WildBamaBoy debug log
also, is someone checking tebex analysis plugin issues? https://github.com/track/plugin/issues
Perfect, thanks.
{"id":560580190,"command":"...","payment":null,"package":null,"conditions":{"delay":0,"slots":0}}
Likely due to payment and package being null, which is expected response from our API that's not properly handled by the plugin.
Should have been fixed in d7304b3 but clearly it still can't be parsed correctly.
I believe this will resolve the issue, however we have some additional testing to do to make sure all command types are properly handled especially for Geyser stores.
Here's a prerelease build with the fix included, feel free to give this a try and let us know if it works/doesn't work for your setup:
tebex-bukkit-2.0.3-prerelease.jar.zip
but wait, why is this error even happening? I've previously created test payments, but now, in payments, I have 0 payments, so why does something like this appear? How should I stop it then?
Or is it only the plugin issue and nothing wrong in my store?
And yeah, the new version seems working, no errors there.
Glad to hear the fix works. I didn't mean that there was a problem with your store - this is still an issue within the plugin that it should be handling.