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

EntityData stacktrace #993

Closed
TheLimeGlass opened this issue Dec 1, 2017 · 3 comments
Closed

EntityData stacktrace #993

TheLimeGlass opened this issue Dec 1, 2017 · 3 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@TheLimeGlass
Copy link
Collaborator

TheLimeGlass commented Dec 1, 2017

Hey @bensku remember when I was talking to you about the parser not compiling properly in the EntityData version? Well I think I got an error for you. This is just in general. I stop my server and this happens. Nothing is related to it or anything, just when the server stops, this is your Skript build not a custom one of mine.

[20:32:29] [Server thread/ERROR]: Error occurred while disabling Skript v2.2-dev32 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
	at ch.njol.skript.entity.EntityData.getAll(EntityData.java:468) ~[?:?]
	at ch.njol.skript.expressions.ExprEntities.get(ExprEntities.java:146) ~[?:?]
	at ch.njol.skript.expressions.ExprEntities.get(ExprEntities.java:1) ~[?:?]
	at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:104) ~[?:?]
	at ch.njol.skript.lang.util.SimpleExpression.iterator(SimpleExpression.java:307) ~[?:?]
	at ch.njol.skript.expressions.ExprEntities.iterator(ExprEntities.java:211) ~[?:?]
	at ch.njol.skript.lang.Loop.walk(Loop.java:79) ~[?:?]
	at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89) ~[?:?]
	at ch.njol.skript.lang.Trigger.execute(Trigger.java:55) ~[?:?]
	at ch.njol.skript.events.EvtScript.unregisterAll(EvtScript.java:75) ~[?:?]
	at ch.njol.skript.SkriptEventHandler.removeAllTriggers(SkriptEventHandler.java:248) ~[?:?]
	at ch.njol.skript.Skript.disableScripts(Skript.java:687) ~[?:?]
	at ch.njol.skript.Skript.onDisable(Skript.java:749) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:361) [spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:422) [spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:415) [spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at org.bukkit.craftbukkit.v1_12_R1.CraftServer.disablePlugins(CraftServer.java:352) [spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at net.minecraft.server.v1_12_R1.MinecraftServer.stop(MinecraftServer.java:465) [spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:613) [spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_151]
Caused by: org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled
	at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.validate(CraftScheduler.java:403) ~[spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.runTaskTimer(CraftScheduler.java:126) ~[spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.scheduleSyncRepeatingTask(CraftScheduler.java:122) ~[spigot-1.12.2.jar:git-Spigot-7129aeb-c15d869]
	at ch.njol.skript.util.Task.schedule(Task.java:88) ~[?:?]
	at ch.njol.skript.util.Task.<init>(Task.java:53) ~[?:?]
	at ch.njol.skript.util.Task.<init>(Task.java:46) ~[?:?]
	at ch.njol.skript.bukkitutil.PlayerUtils$1.<init>(PlayerUtils.java:57) ~[?:?]
	at ch.njol.skript.bukkitutil.PlayerUtils.<clinit>(PlayerUtils.java:57) ~[?:?]
	... 21 more

There were no players on the server when I stopped it and I always put the difficulty in peaceful when I join.

I don't know what the issue is from so I'm going to post this here.

Spigot: Latest build from BuildTools as of this post (1.12.2)
Skript: Skript-dev32
Operating system: Windows

@bensku
Copy link
Member

bensku commented Dec 2, 2017

It seems that Skript is already disabled but trying to execute a script. That is bad, very, very, bad. Maybe Spigot ignored it before... Or you're doing something weird. Could you post the code so I can better find the error?

@bensku bensku added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Dec 2, 2017
@TheLimeGlass
Copy link
Collaborator Author

TheLimeGlass commented Dec 3, 2017

It happens when the server stops, my script was very small when this happened, and I modified it alot from then. This error happens Randomly and doesn't seem to be compared with what ever script I have.

@Snow-Pyon Snow-Pyon added the priority: low Issues that are not harmful to the experience but are related to useful changes or additions. label Feb 11, 2018
@Nicofisi
Copy link
Member

Apparently Bukkit marks the plugin as disabled before calling its onDisable() method (which is a bit stupid if you asked me)

PlayerUtils registers some task when it's first accessed:

// created when first used
final static Task task = new Task(Skript.getInstance(), 1, 1) {
@Override
public void run() {
try {
for (final Player p : inviUpdate)
p.updateInventory();
} catch (final NullPointerException e) { // can happen on older CraftBukkit (Tekkit) builds
if (Skript.debug())
e.printStackTrace();
}
inviUpdate.clear();
}
};

which again, if you asked me, is very unintuitive on Bukkit's side - there's no schedule/run word here, who could expect that the constructor automatically registers the task? Yet it does..

Cause: @TheLimeGlass' scripts use something that uses PlayerUtils for the first time in on unload:

Possible solution: start the task at Skript start, maybe?

@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Mar 27, 2021
@APickledWalrus APickledWalrus added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

7 participants