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

Existing server not attempting to start after latest update (java 16 related?) #423

Closed
MrChunks opened this issue Jun 28, 2021 · 18 comments
Closed

Comments

@MrChunks
Copy link

MrChunks commented Jun 28, 2021

I'm terribly sorry if I don't provide a useful bug/issue report, I'm not sure what iformation is useful.

In short, I had a working Sky Factory 4 server (1.12.2) and after updating the docker today, it no longer starts. MineOS is fine, but clicking start doesn't do anything beyond add the following to the mineos.log file:

{"level":"info","message":"[server_name] 192.168.x.x issued command : "start"","timestamp":"2021-06-28T09:46:23.207Z"}
{"level":"info","message":"[server_name] received request "start"","timestamp":"2021-06-28T09:46:23.210Z"}

the server doesn't update (or even recreate them if they're moved) the "latest.log" or "debug.log" files in the server specific log folder.

Is there anything I can try to do to debug or provide more info? I'm running this on Unraid if that's relevant.

_hexparrot/mineos:latest
Digest:sha256:2ad355e1dd04fb0f8aa4d08f3b1fffa3361c3c9cdbb32cb3ad296185bf4ae46e
OS/ARCH
linux/amd64
_

Edit to add : I've tried to "rollback" the latest update by specifying the "digest" value, but I'm probably doing that wrong, if it's even supported by unraid - I couldn't find any docs for that in my Googling :) I just wanted to see if its a local problem or repeatable when doing the upgrade

Another edit: created a new vanilla 1.12.2 server, no settings. It works OK from what I can see, but if I switch to the Forge 1.12.2 2855 (recommended) version, it has the same problem as I'm experiencing above. I'm not 100% sure this is a valid test of not, but it's something?

Hopefully last edit: I see we're running java 16 now, which breaks old mods etc. Is this configurable via the docker install, or in any way can I roll this back but still get other updates?
Old MC versions simply don't support java 16:
https://forums.minecraftforge.net/announcement/15-java-16-and-you-how-to-avoid-crashes/

@MrChunks MrChunks changed the title Existing server not attempting to start after latest update Existing server not attempting to start after latest update (java 16 related?) Jun 28, 2021
@MrChunks
Copy link
Author

I confirmed it's the java version change, not that there was much question. I consoled into the docker image and ran:
apt remove openjdk-16-jre-headless
then when that finished, I ran:

apt-get update
apt-get install openjdk-8-jre

This as a pretty big download but after that I restarted the docker image and my server came right back up. So at least my users (ok, it's just me) won't be grumpy anymore. :)

@hexparrot
Copy link
Owner

Hey, thank you for the report--it's invaluable for us as the community to know when we make regressions. Java 16 has been a huge thorn because the vast majority of support has been asking for a means to run 1.17 (which naturally would be the case with new releases), and now we know 1.12.x we can outright recommend installing the old java to support those versions.

I'll try to compile this all in a wiki page, and thanks again for letting us know the issue and the resolution.

@MrChunks
Copy link
Author

Would it be correct to assume that any further updates to your docker image would require me to reapply this work around?
I saw in the binhex mineOS-node thread, they resolved the issue during configuration by allowing the specification of which java to use, 8, 11, or 16.

Perhaps a solution like that could work?

@hexparrot
Copy link
Owner

Are you familiar with building docker images from the dockerfile?

If so, it might be easiest to start with the Dockerfile, add in a line for multiple Java instances, e.g.,

  openjdk-11-jre-headless \
  openjdk-16-jre-headless \

Then using the JAVA_BINARY= attribute for each of the servers.

I'm already considering making this a permanent change, but I'm going to do some testing--and I kinda would rather have JAVA_BINARY in the webui rather than the manual changes.

TL;DR I hope that I will be able to deploy two javas and have a webui-based switching mechanism, but it'll take a bit of time.

@MrChunks
Copy link
Author

Cool, I can try to mess with that and see how it goes. I've never worked with dockerfiles directly, but there's enough documentation out there. I'll see if there's anything unraid specific as well. It would probably go a long way to teaching me stuff I should probably have figured out by now, so I'm not so helpless in the future :)

Thanks for the suggestion. I'll revisit this thread if I have anything useful to contribute.

@HNGamingUK
Copy link

I confirmed it's the java version change, not that there was much question. I consoled into the docker image and ran:
apt remove openjdk-16-jre-headless
then when that finished, I ran:

apt-get update
apt-get install openjdk-8-jre

This as a pretty big download but after that I restarted the docker image and my server came right back up. So at least my users (ok, it's just me) won't be grumpy anymore. :)

In relation to this for your awareness I was able to get mine working following the same method you went through. However instead I used openjdk-8-jre-headless as this is a smaller install and works.

For now I am not going to update my mineos container since it is working but hopefully something such as the method @hexparrot has mentioned can be implemented.

@Anora
Copy link

Anora commented Jul 2, 2021

I'm having that problem whit my MineOS jail on freenass and uninstalling and reinstalling the right java version is a pain on freeBSD

@fuzzybair
Copy link
Contributor

@Anora The issue here is related to my Pull request to update java in the docker image to support Minecraft 1.17, which is not impacted by java installed on the host. If you are using a host installed MineOS you should be able to install the version of Java you need. However running Minecraft 1.12.x and 1.17 will likely not work until support for the JAVA_BINARY= attribute for each of the servers is added.

@Anaerin
Copy link

Anaerin commented Jul 6, 2021

Huh. I found an undocumented fix. If you're running the latest MineOS WebUI, and you can edit the "server.config" file, you can add the argument "java_binary" in the java section, and it will override MineOS' default java selection. So you can have the OS running Java16, but have Java11 for Forge servers on 1.16 (or any other version, for that matter).

So, for example, before:

[java]
java_xmx=16384
jarfile=forge-1.16.5-36.1.30.jar
java_tweaks=
java_xms=16384

[onreboot]
start=true

[minecraft]
broadcast=true
unconventional=false
profile=1.16.5-recommended

after:

[java]
java_binary=/usr/local/openjdk11-jre/bin/java
java_xmx=16384
jarfile=forge-1.16.5-36.1.30.jar
java_tweaks=
java_xms=16384

[onreboot]
start=true

[minecraft]
broadcast=true
unconventional=false
profile=1.16.5-recommended

Will work just fine on a system that has Java 16 installed as the primary version. Now all we need is for this functionality to be exposed in the webui.

@grydian
Copy link

grydian commented Jul 7, 2021

I am using unraid and a docker for mineos. I have bashed into the docker and ran the commands in the issue to try and fix my java not launching older minecrafts. However nothing is different the instances still will not load. Anything I am missing here? I tried both the 8 and 11 versions of java and they both did not work. Any help would be amazing.

@Anaerin
Copy link

Anaerin commented Jul 7, 2021

I am using unraid and a docker for mineos. I have bashed into the docker and ran the commands in the issue to try and fix my java not launching older minecrafts. However nothing is different the instances still will not load. Anything I am missing here? I tried both the 8 and 11 versions of java and they both did not work. Any help would be amazing.

A first step would be to find out what version of Java is running. java --version will tell you.

If you have multiple versions, you'll have to find where the binary is. You may be able to find out what pattern your OS uses by using

ls -al `which java`

Which will show something like:

lrwxr-xr-x  1 root  wheel  29 Jul  5 23:52 /usr/local/bin/java -> /usr/local/openjdk16/bin/java

Which indicates (in this case) the current system java is a symbolic link to the java in /usr/local/openjdk16/bin/java. From there, you can work out where different versions would be stored, and replace the link to the right version.

@flareofghast
Copy link
Contributor

flareofghast commented Jul 7, 2021 via email

@flareofghast
Copy link
Contributor

flareofghast commented Jul 7, 2021 via email

@MrChunks
Copy link
Author

MrChunks commented Jul 12, 2021

In case anyone stumbles across this thread that's using unraid docker to run their server, this is a summary of what I needed to do after upgrading the image:

Console into the MineOS Docker image and run:
apt-get update
apt-get install openjdk-8-jre-headless

Go into the server configuration file for my server that needs Java 8 and add the following line to the file /appdata/minecraft/servers/<servername>/server.config
under the [java] section:

java_binary=/usr/lib/jvm/java-8-openjdk-amd64/bin/java

After this line was added, the server started successfully. In the future, after an update, I'll hopefully just have to do the openjdk install and it should be able to start.

@fuzzybair
Copy link
Contributor

@MrChunks I don't know how much you know about docker but, you will need to reinstall java inside the container every restart not just on update. Docker does not maintain state. the server.config is outside the container so you are ok there., I will get a PR up tonight to fix the docker image. Do you have a use case for running both versions of java in one container or would it make more sense to have a mineos:java8 and a mineos:java16?

@HNGamingUK
Copy link

@MrChunks I don't know how much you know about docker but, you will need to reinstall java inside the container every restart not just on update. Docker does not maintain state. the server.config is outside the container so you are ok there., I will get a PR up tonight to fix the docker image. Do you have a use case for running both versions of java in one container or would it make more sense to have a mineos:java8 and a mineos:java16?

Just so you are aware that the "state" (docker image) only gets wiped when updating, a simple restart of the container (docker stop & docker start) will use the same image that was edited to have java8.

I can confirm this as I have a script that stops each of my containers to back the whole thing up each night. The mineos one has come back online each time and I haven't needed to reinstall java8.

@hexparrot Did mention around potentially adding multiple java versions in (namely java8 and java16) and allowing the user to choose within the specific minecraft server menu. He did mention that this could take sometime.

For now as long as you install java8 and don't update the docker image for the container you will be fine.

@MrChunks
Copy link
Author

MrChunks commented Jul 13, 2021

@MrChunks ... Do you have a use case for running both versions of java in one container or would it make more sense to have a mineos:java8 and a mineos:java16?

I don't personally need both as I run 1 server for myself :) But if people are hosting, say, a vanilla world using the latest MC (needing java16) and another that is using any of the older modded packs (like me, running the popular SkyFactory 4 pack) then I can imagine needing both installed.

@MrChunks
Copy link
Author

Probably my last update on this matter: I left the java path setting (to java8) in the server config, and I just ran the latest update which includes java 8 as well as 16. My server came right up, no fiddling around.

So it looks like I can go back to blindly updating a boatload of docker images every day without even thinking about it.

Thanks for the help, and responsiveness and stuff! Cheers!

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

No branches or pull requests

8 participants