Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Failed to read BlockState due to asynchronous access #17

Open
antoinech2 opened this issue Jun 26, 2019 · 6 comments
Open

[Bug] Failed to read BlockState due to asynchronous access #17

antoinech2 opened this issue Jun 26, 2019 · 6 comments
Labels

Comments

@antoinech2
Copy link

antoinech2 commented Jun 26, 2019

Hello again, I've found an other bug with skript-db

When I right click on a enchantment table, this error pop in the console.
I know skript-bd has nothing to do with the enchantments tables, but when I remove the plugin the error disappears.
I noticed there is a link to the fact that the thread is asynchronous (I think)
(Tell me if you want the error in a pastebin or something like that)

[11:16:00] [pool-40-thread-8/WARN]: java.util.concurrent.CompletionException: java.lang.RuntimeException: Failed to read BlockState at: world: world location: (579, 63, -149) [11:16:00] [pool-40-thread-8/WARN]: at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273) [11:16:00] [pool-40-thread-8/WARN]: at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280) [11:16:00] [pool-40-thread-8/WARN]: at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592) [11:16:00] [pool-40-thread-8/WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [11:16:00] [pool-40-thread-8/WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [11:16:00] [pool-40-thread-8/WARN]: at java.lang.Thread.run(Thread.java:748) [11:16:00] [pool-40-thread-8/WARN]: Caused by: java.lang.RuntimeException: Failed to read BlockState at: world: world location: (579, 63, -149) [11:16:00] [pool-40-thread-8/WARN]: at org.bukkit.craftbukkit.v1_14_R1.block.CraftBlockEntityState.<init>(CraftBlockEntityState.java:49) [11:16:00] [pool-40-thread-8/WARN]: at org.bukkit.craftbukkit.v1_14_R1.block.CraftEnchantingTable.<init>(CraftEnchantingTable.java:12) [11:16:00] [pool-40-thread-8/WARN]: at org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock.getState0(CraftBlock.java:437) [11:16:00] [pool-40-thread-8/WARN]: at org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock.getState(CraftBlock.java:322) [11:16:00] [pool-40-thread-8/WARN]: at org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock.getState(CraftBlock.java:316) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.aliases.ItemType.<init>(ItemType.java:222) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.aliases.ItemType.toString(ItemType.java:1008) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.classes.data.BukkitClasses$2.toString(BukkitClasses.java:193) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.classes.data.BukkitClasses$2.toString(BukkitClasses.java:1) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.registrations.Classes.toString(Classes.java:601) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.registrations.Classes.toString(Classes.java:630) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.registrations.Classes.toString(Classes.java:615) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.lang.VariableString.toString(VariableString.java:459) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.lang.VariableString.getArray(VariableString.java:623) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.lang.VariableString.getArray(VariableString.java:1) [11:16:00] [pool-40-thread-8/WARN]: at com.btk5h.skriptdb.skript.ExprUnsafe.get(ExprUnsafe.java:37) [11:16:00] [pool-40-thread-8/WARN]: at com.btk5h.skriptdb.skript.ExprUnsafe.get(ExprUnsafe.java:22) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:102) [11:16:00] [pool-40-thread-8/WARN]: at ch.njol.skript.lang.util.SimpleExpression.getSingle(SimpleExpression.java:60) [11:16:00] [pool-40-thread-8/WARN]: at com.btk5h.skriptdb.skript.EffExecuteStatement.createStatement(EffExecuteStatement.java:155) [11:16:00] [pool-40-thread-8/WARN]: at com.btk5h.skriptdb.skript.EffExecuteStatement.executeStatement(EffExecuteStatement.java:122) [11:16:00] [pool-40-thread-8/WARN]: at com.btk5h.skriptdb.skript.EffExecuteStatement.lambda$execute$0(EffExecuteStatement.java:94) [11:16:00] [pool-40-thread-8/WARN]: at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) [11:16:00] [pool-40-thread-8/WARN]: ... 3 more [11:16:00] [pool-40-thread-8/WARN]: Caused by: java.lang.IllegalStateException: Tile is null, asynchronous access? CraftBlock{pos=BlockPosition{x=579, y=63, z=-149},type=ENCHANTING_TABLE,data=Block{minecraft:enchanting_table},fluid=net.minecraft.server.v1_14_R1.FluidTypeEmpty@cd1e646} [11:16:00] [pool-40-thread-8/WARN]: at com.google.common.base.Preconditions.checkState(Preconditions.java:444) [11:16:00] [pool-40-thread-8/WARN]: at org.bukkit.craftbukkit.v1_14_R1.block.CraftBlockEntityState.<init>(CraftBlockEntityState.java:30) [11:16:00] [pool-40-thread-8/WARN]: ... 25 more

@btk5h
Copy link
Owner

btk5h commented Jun 26, 2019

Code?

@antoinech2

This comment has been minimized.

@antoinech2
Copy link
Author

antoinech2 commented Jun 26, 2019

I found the script that makes the error:
The code is:
on right click on a chest, furnace, shulker box, dropper, dispenser, hopper, trapped chest, anvil or enchantment table: execute unsafe "INSERT INTO skript_coffrelog (datetime,joueur,action,block,x_coord,y_coord,z_coord,world) VALUES (NOW(),'%player%','OPEN','%targeted block of player%',%round up x coord of targeted block of player%,%round up y coord of targeted block of player%,%round up z coord of targeted block of player%,'%world of player%')" in {mysql_db}

@antoinech2
Copy link
Author

antoinech2 commented Jun 26, 2019

Additional informations:

  • Same problem if I do a synchronously execute
  • I think the problem is only in Minecraft 1.14.3 because I updated my server, and the error is still here with skript-bd v0.1.1
  • The request is not executed

@antoinech2
Copy link
Author

antoinech2 commented Jun 26, 2019

Okay, I've test more things, and I noticed that skript-bd don't replace local variables with their values! It works for global variables
Exemple:

set {_test} to "test1"
set {test} to "test2"
execute unsafe "INSERT INTO skript_test (test1,test2) VALUES ('%{_test}%','%{test}%')" in {mysql_db}

the 'test1' value is < none > is the SQL table, but the 'test2' value is correct ("test2")

@btk5h btk5h added the bug label Jun 26, 2019
@btk5h
Copy link
Owner

btk5h commented Jun 26, 2019

I know what's causing the problem, though it might be a while until I have the time to fix it.

The local variable problem is an issue with Skript itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants