ArcanePlugins / Treasury

🏦 A powerful multi-platform library for next-level plugin integrations.
https://hangar.papermc.io/ArcanePlugins/Treasury
Other
56 stars 13 forks source link

generated an exception while executing task 12 (with placeholder) #208

Closed Enrique20K closed 1 year ago

Enrique20K commented 1 year ago

Expected behavior

I expected not to have problems with placeholder in betterEconomy, it is strange that treasury complains with the following error.

Observed behavior

When starting the server (with paper, pufferfish) with placeholder, it throws an error, then it works normally (apparently), I haven't found problems using the plugin with this error (so far), but there are small delays, as if some task will occupy the processor thread, especially at the beginning if you can notice the delay.

This error only appears with placeholder installed, I have tried the plugin with all the plugins in my folder and no other has caused the error. The error occurs when starting treasury with BetterEconomy and placeholder. Treasury with betterconomy does not throw any error. The error appears at the start of the server, and also in its operation, it complains every X time.

Reproduction steps

Install Server (paper or pufferfish) Install Treasury and BetterEconomy Install placeholder api Start the server and see the error

Stack trace or error log

[18:59:46 INFO]: Server permissions file permissions.yml is empty, ignoring it
[18:59:48 WARN]: [Treasury] Plugin Treasury v1.2.0-3fccc13-RELEASE generated an exception while executing task 4
ction.Function.apply(Object)" is null
[19:00:48 WARN]: [Treasury] Plugin Treasury v1.2.0-3fccc13-RELEASE generated an exception while executing task 4
ction.Function.apply(Object)" is null
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) ~[?:?]
        at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[?:?]
        at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147) ~[?:?]
        at me.lokka30.treasury.api.common.response.Subscriber$1.succeed(Subscriber.java:93) ~[treasury-bukkit-1.2.0-3fccc13-RELEASE.jar:?]
        at me.lokka30.treasury.api.economy.response.EconomySubscriber$1.succeed(EconomySubscriber.java:130) ~[treasury-bukkit-1.2.0-3fccc13-RELEASE.jar:?]
        at me.hsgamer.bettereconomy.hook.treasury.TreasuryEconomyHook.lambda$hasPlayerAccount$0(TreasuryEconomyHook.java:39) ~[BetterEconomy-2.6.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.2.jar:git-Paper-177]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.2.jar:git-Paper-177]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.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:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.CompletionStage.toCompletableFuture()" because the return value of "java.util.function.Function.apply(Object)" is null
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
        ... 11 more

Treasury information

> treasury info
[19:02:27 INFO]: About Treasury
[19:02:27 INFO]:  -> Running Treasury v1.2.0-3fccc13-RELEASE
[19:02:27 INFO]:  -> Description: Treasury is a modern multi-platform library facilitating the integration between service providing/consuming plugins on Minecraft servers. 
[19:02:27 INFO]:  -> Made possible by: See https://github.com/lokka30/Treasury/wiki/Credits
[19:02:27 INFO]:  -> Learn more at: https://github.com/lokka30/Treasury/
[19:02:27 INFO]:  
[19:02:27 INFO]: Miscellaneous Info:
[19:02:27 INFO]:  -> For a list of commands, run '/treasury help'.

Additional information

image image

lokka30 commented 1 year ago

Thanks a lot for reporting this issue. I am unsure whether this is on Treasury's end or BetterEconomy's end, since the stack trace doesn't describe things enough for me to narrow down a cause.

I'm unsure what's calling the Subscriber->CompletableFuture conversion.

lokka30 commented 1 year ago

So this error only happens when BetterEconomy and Treasury are installed alongside PlaceholderAPI? When PlaceholderAPI is removed, the error doesn't appear?

Enrique20K commented 1 year ago

yes, the error only appears with bettereconomy and placeholder installed. I'll try if the error appears combined with other plugins.

Enrique20K commented 1 year ago

Thanks a lot for reporting this issue. I am unsure whether this is on Treasury's end or BetterEconomy's end, since the stack trace doesn't describe things enough for me to narrow down a cause.

I'm unsure what's calling the Subscriber->CompletableFuture conversion.

I have the same thought, in the first instance Treasury complains and that's why I report the error here. By the way, a good complement, I think it has a future. Sorry for my English, a machine called Google translate helps me.

MrIvanPlays commented 1 year ago

can you test with https://ci.mrivanplays.com/job/Treasury/92/

MrIvanPlays commented 1 year ago

we've just released 1.2.1 with these changes in build 92 so please check it out and send us some input on whether the issue is fixed or not. thanks in advance

MrIvanPlays commented 1 year ago

I tried this myself and couldn't make it reproduce for both 1.2.1 and 1.2.0

lokka30 commented 1 year ago

If there is no activity after 2 weeks since your request to test (which you posted 8 days ago) then we can close the issue and re-open it if the user finds the issue is still unsolved.

MrIvanPlays commented 1 year ago

Resolution: cannot reproduce Status: stale (no response from the author whatsoever)