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

Skript Not Loading Correctly #2752

Closed
LoganLilypad opened this issue Jan 11, 2020 · 40 comments
Closed

Skript Not Loading Correctly #2752

LoganLilypad opened this issue Jan 11, 2020 · 40 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: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@LoganLilypad
Copy link

Question

I am currently trying to run a local test server with Skript and while trying to do so, Skript spits out an error. I am currently running the latest stable Spigot build along with the latest Skript build, even tried running Paper Spigot with no luck and finally tried running it on another computer.

There are no other plugins being ran on the server except Skript
Skript error taken from logs https://pastebin.com/raw/dKiCK6Vi

Just wondering if this is just me doing something wrong or if its an actual issue

@bensku
Copy link
Member

bensku commented Jan 11, 2020

This could be a bug in Skript. What scripts are you running? Does this happen without them? Also, if you have addons installed, try without them.

@LoganLilypad
Copy link
Author

Nope as I said, its just plain Skript, no addons or anything, I just booted up the server without touching anything

@bensku
Copy link
Member

bensku commented Jan 11, 2020

Oops, missed no other plugins part. With no scripts either, this is puzzling. Please try removing Skript plugin folder and reinstalling Skript jar; issues like this are sometimes caused by corrupted files.

@soulstriker23
Copy link

Has there been a fix for this? I tried paperspigot 1.15.1 (paper-48) with no other plugins, fresh install for skript 2.5 & 2.4.1 with the same issue.

@bluelhf
Copy link
Contributor

bluelhf commented Jan 19, 2020

@soulstriker23 Debugging this issue is hard because all the information we get from the stack trace roughly translates to

We were about to run out of space on the stack because something regex-related recursed far too deeply.

So, basically, we have little information to work with, and there isn't a fix yet because of that.

@bluelhf
Copy link
Contributor

bluelhf commented Jan 19, 2020

@bensku

Unfortunately, Java's builtin regex
support has problems with regexes
containing repetitive alternative paths
(that is, (A|B)*). This is compiled into a
recursive call, which results in a
StackOverflow error when used on a very large string.
A possible solution is to rewrite your regex to not use a repititive alternative.

Maybe this would help?

@bensku
Copy link
Member

bensku commented Jan 20, 2020

Applying this advise to current parser might not be possible, unfortunately.

@bluelhf
Copy link
Contributor

bluelhf commented Jan 20, 2020

Applying this advise to current parser might not be possible, unfortunately.

That would mean this is quite literally impossible to fix unless we start asking whoever maintains OpenJDK to improve Java's regex parser itself?

That's reassuring.

@bensku
Copy link
Member

bensku commented Jan 20, 2020

Sorry, I was unclear. I meant that it is possible that there is no way to fix this issue with current Skript parser. We'll try to avoid regex parsing in future works.

@Pikachu920
Copy link
Member

OP can always increase their stack size, it's more of a problem with how recursive the parser is with complex patterns that causes the trouble

@soulstriker23
Copy link

OP can always increase their stack size, it's more of a problem with how recursive the parser is with complex patterns that causes the trouble

Is that something the user can do to make skript actually work without it being disabled?

@bluelhf
Copy link
Contributor

bluelhf commented Jan 23, 2020

@soulstriker23 If the stack size is too small, Skript won't have enough space on the stack to do the regex, resulting in this error. The user can modify their stack size with the -Xss JVM argument, which should resolve the problem provided it's set to a high enough value.

@bensku
Copy link
Member

bensku commented Jan 23, 2020

I do not recommend increasing stack size, because it may lead to the server running out of memory. A better workaround is to not have overly long lines. Avoiding installation and/or usage of addons with very complex syntaxes might also help, but I haven't tested it.

@soulstriker23
Copy link

soulstriker23 commented Jan 23, 2020

@bensku Okay, that make sense. I tried it and it works sometimes. But then tried it again with fresh install and putting the skript.jar with no skript written (just the disabled default ones) it gives the massive error and disables skript completely so I can't do anything with it. Any reason why it would just randomly work and not? Only have skquery & skript installed.

@bensku
Copy link
Member

bensku commented Jan 23, 2020

Without scripts? There are a few possibilities:

  • Corrupted Skript jar
  • Unsupported Spigot version
  • Addon issue (this one is most likely, assuming you didn't try to use MC 1.8)

@bluelhf
Copy link
Contributor

bluelhf commented Jan 23, 2020

@LoganLilypad Are you, by chance, running a version of Paper that's not officially supported? A legacy build of Paper, that is..?

@soulstriker23
Copy link

soulstriker23 commented Jan 23, 2020

Well, @bensku
I downloaded the 2.4.1 skript.jar from the releases page.
Running PaperSpigot 1.15.1 Build#62 (latest) & I also removed skquery.
Starts to load then sends this whole error section and at the end says "disabled"
image

image

@Polda18
Copy link

Polda18 commented Jan 25, 2020

I have very similar issue:

[20:45:48 ERROR]: Error occurred while enabling Skript v2.4.1 (Is it up to date?)
java.lang.StackOverflowError: null
        at java.lang.Character.codePointAt(Unknown Source) ~[?:1.8.0_241]
      <snipped>
        at java.util.regex.Pattern$GroupHead.match(Unknown Source) ~[?:1.8.0_241]

Server: Paper 70 (Minecraft 1.15.2), Skript version 2.4.1, one Skript enabled:

# Hráč se připojí
on join:
	# Nejpre vyčistíme inventář
	set inventory of player to air
	
	# Do 9. slotu vložíme kompas pro výběr serveru
	set {_selector} to compass named "&2&lVolba serveru &7(Pravé myšítko)" with lore "&5Klikni pravým myšítkem pro výběr serveru"
	set slot 8 of player to {_selector}
	
	# Do 5. slotu vložíme knihu pro pravidla
	set {_pravidla} to book named "&4&lPravidla &7(Pravé myšítko)" with lore "&5Klikni pravým myšítkem k zobrazení pravidel"
	set slot 4 of player to {_pravidla}

This is some serious issue as I was gonna test out if that skript is going to work (Yes, I made testing server just for Skripts to be tested before it is going to be deployed into main server). I cannot since Skript is having bad time enabling itself. I don't know, can't it connect to Internet?

@RXJpaw
Copy link

RXJpaw commented Jan 26, 2020

#2770

@Polda18
Copy link

Polda18 commented Jan 26, 2020

@RXJpaw Are you therefore suggesting that this is fixed in Java 13, Erik? Oracle Java download still claims Java 8 is latest version. From IntelliJ IDEA I know that that's not true, since there is JDK version 11 used.

@bensku
Copy link
Member

bensku commented Jan 26, 2020

Script made by @Polda18 doesn't look terribly complex. Can someone reproduce this with it? If yes, does having addons have any effect on it? Can anyone reproduce on Java 11 or newer version?

Dropping support for Java 8 has been in plans for a while (see #1321), but continued support from OpenJDK vendors has made it difficult. If this is indeed a bug in Java 8, I'm not terribly interested in working on it.

@Polda18
Copy link

Polda18 commented Jan 26, 2020

@bensku Tried, it works. Looks like it really doesn't work on Java 8 or older.

@ShaneBeee
Copy link
Contributor

Here is a bit of info regarding this:

  • I run this on java 8, no issues. I'm using Oracle's Java 8, Im not sure if OpenJDK is the same or not.

  • Another user had the same issue. I built them a fresh build (using java 8), they were able to run it without any errors.

@bensku
Copy link
Member

bensku commented Jan 26, 2020

I can't reproduce these on OpenJDK 8 or 11 either. Some generic tips that might help:

  • Update Java to latest patch, without changing major version
  • Update Java to newer major version (e.g. 8 -> 11)
  • Change to OpenJDK (AdoptOpenJDK builds, for example)
  • Change to Oracle JDK, if running Java 8 (note: mind the license)

@Romitou
Copy link
Sponsor Contributor

Romitou commented May 12, 2020

Hello, I'm not sure what I'm saying, but the many times I've seen people with this error, the majority have been Java 32-bit. Do you think it could be related to that?

@Pikachu920
Copy link
Member

that's actually a good point, the default stack size is lower on 32bit which could explain at least part of this error. what do you think @bensku

@bluelhf
Copy link
Contributor

bluelhf commented May 13, 2020

@Pikachu920 The issue has been consistently solved by updating Java from 8 to something newer, usually 11 or 14. Whether they also upgraded to 64bit at the same time, I'm not sure. If I have some time I'll experiment with 32 and 64-bit versions of Java 8 and 11.

@Wealthyturtle
Copy link
Member

@bensku It seems like this is mainly caused by users not using 64-bit Java... Maybe it would be a good idea to add a warning if users run Skript on 32-bit Java?

@ASebastian1
Copy link

hello good, also the same error happens to me.
Do you know how to solve it?

@Romitou
Copy link
Sponsor Contributor

Romitou commented Jul 22, 2020

hello good, also the same error happens to me.
Do you know how to solve it?

Hello, this error has always been solved by updating Java to 64bits.

@ASebastian1
Copy link

hola bien, también me pasa el mismo error.
sabes como resolverlo?

Hola, este error siempre se ha solucionado actualizando Java a 64 bits.

I have a 64-bit PC, but the plugin does not run anyway.
Should I do something else?

@Romitou
Copy link
Sponsor Contributor

Romitou commented Jul 22, 2020

You may have a 64-bit PC, but you've probably downloaded 32-bit Java. Try downloading it again here, hopefully it will work!
https://www.java.com/en/download/manual.jsp

Screenshot:
image

@ASebastian1
Copy link

You may have a 64-bit PC, but you've probably downloaded 32-bit Java. Try downloading it again here, hopefully it will work!
https://www.java.com/en/download/manual.jsp

Screenshot:
image

It worked thanks a lot for the help.

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: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests