Web UI not running server created as 'root' properly

So after much learning I have been able to get my FTB servers to function. But something is really bothering me. I want to play skyfactory 3 but when I select the jar from the premade profile or when I use the files I download on my own and put into the server I get an issue where all non vanilla commands do not work and the world doesnt generate a void. When I run the ServerStart.sh through putty terminal, though, the server runs 100% as it should. My current assumption is that the Serverstart.sh has some extra lines that initializes whatever is built in. Theoretically I can just run my server through the command line as Ive port forwarded, but I would really like to be able to use the Web ui.

Thanks for any respones!

What user did you run this script as? root? or your non-root user?

The main focus here is if you ran it as root, it will have generated the files with ownership to root, which means the other user (in the webui) cannot create/modify and potentially even read what was generated.

I did run it as root, silly me. If I go in and run that same file as mc rather than root would the UI work as it should?

Pardon my newb, but what is the reason you shouldn’t use the root login all the time for UI and commandline

It seems Im unable to edit anything through winSCP or with putty without the root login

Precisely this reason, because when things are run as root, they are owned by root and files it’ll create are root-owned, too. Typically–as is the best practices in server administration–only the most system-critical services should be run as root, because it’s the super user; it has the potential to bring down the entire system if it misbehaves or if exploited.

And internet-facing services, such as game servers, web servers, and its ilk are often very large projects which are impossible to keep exploit-free (or even just bug-free). Common services that do run as root are like SSH, which are so finely tuned over decades that it is very trusted to be root-run.

Anyway, all that ties in to “simply use a non-root user for Minecraft servers”. Both in the webui and in the terminal.

If, for example, you were root when you did rm -rf /, you’d trash the whole system. But as mc, you’d do pretty much no damage at all (to the system).

Likewise, the mc user has full ownership of the directories it needs access to, which are your server directories located within /var/games/minecraft/servers/servername. So running ServerStart.sh is 100% possible with your mc user, even if you can’t do anything to /var/ or /var/games/ or /var/games/minecraft/, etc.


To fix this, run the following commands as root (you have to be root to correct it):

chown -R mc:mc /var/games/minecraft/{servers,archive,backup}/servername

(replace server name with each server).

That’s for one server. You can shortcut it for all servers in your webui with:

chown -R mc:mc /var/games/minecraft/{servers,archive,backup}/*

Thank you for the explanation. I went through, re-made everything and ran the FTBInstall.sh and ServerStart.sh scripts as mc yet I still dont have access to the non vanilla commands except if I execute the server through the commandline.

What do you mean access to the non-vanilla commands?

My actual issue is that commands that are not from a vanilla server(anything added by FTB) do not exist or show up in /help and world gen was not being overridden by the void map and generating normally unless I run the ServerStart.sh through putty.

Can you verify that in the webui you have the appropriate Jarfile selected for the server (separate from the profile)?

When you start up the server, the console should end up showing the startup content–is it indicating it’s running just the normal vanilla jar?

I have tried running from both jar files that show up in the dropdown menu when I select the skyfactory profile. The vanilla jar runs fine except for the other issues I described. When I run the FTB jar it doesn’t even launch properly yet continues to increase RAM usage. When I started the server as through the UI on the vanilla JAR in my minecraft instance recognized the server as vanilla although most of the server’s mods were working. When I started through the command line again I noticed that minecraft recognized the server as being modded and had 180 mods. Also starting the server through the web UI deleted some blocks which showed up in console. This is the log: http://pastebin.com/Ab36uiSH. This seems to support the theory I had that the ServerStart.sh has some crtical initializations that whatever the start button in the UI does not preform

Are you giving it enough ram (XMX and XMS in the webui)

Definitely. XMX is set to 4gb

hi Cyphecx,

you have some work to do to salvage your FTB servers. (multiple?)

i can see from your posted log that the server is starting normally but because you still use the old saved world files things are not loading/working properly. my feeling is it has to do with the original issue Sir hexparrot solved for you namely, using root.

again, my own feeling but by using root a whole cascading unforseen series of events take place and unintended results occur. every time. take it from me, Hahaha, i know all about it so welcome to the club.

no worries, now we know. MineOS used as intended works great. it even works great used as unintended. it was never intended to be used as root so the headline “Web UI not running server properly” is missleading. trash in trash out at best is the rule.

anyway, what i mean is this: for whatever reason your old “world” file was built with mods like tinkers constuct. open computers, storage drawers and the like. but now, as the server loads the world those mods are not loading properly. as such the server deals with items made with the mods by posting warnings and dealing with them as it can by skipping them or whatever.

finally it looks like it errors out and crashes but i’m not sure. whatever.

it seems to me the original error of building the servers as root has had its residual effects here.

now you will learn what the back ups and archives are for, lol.

make them, move them. delete your servers. rebuild your servers as intended (mc as user, not root) import your back ups and get them up and working properly. (i would use the node js version, just a thought.)

when all the mods load and are working the old world files should load and work fine as well.

help is around here someplace but it is a big sports weekend in the usa.

good luck!

tNt

EDIT: forgot to mention, you may have to end up rebuilding your servers and importing only the world folders because the saved archive as is may still crash. you simply get the new FTB servers up and stable with all the mods running, shut down, place your old world files into the new world folder and see what happens when you start the server.

Thanks so much for the reply! So what Im gathering is that I should just grab the world file that I want to use from the current server and recreate everything making sure not to use root inapropriately? As for using root, is there anything I should know besides that I should only use root to preform the chown command on my server directories? If so thats no problem, as I have only got the one server right now. As for the title being misleading what would you suggest I change it too? Thanks again my friend!

hi Cyphecx,

yes! you have it exactly. first recreate your server without using ‘root’. default user is “mc” as created by Sir hexparrot. of course you can change it to whatever you want, just not ‘root’, lol.

once it is up and running with all the mods you wanted working together and stable, it has already generated a ‘world’ and world folder.

all you do then is replace the files in the world folder with the files from the original server. (SFTP or whatever method you choose with the user name you decided to use, just not as root.)

it will work, up and running stable or it will not. if not, it will give you a log file to begin to help trouble shoot the issues. please let us know what happens.

the only other thing i found i need root for was to gain access and modify the iptables as outlined on this page:

https://minecraft.codeemo.com/mineoswiki/index.php?title=Iptables

i no longer do that as i have found i prefer one instance of minecraft per server, not multiple instances on one server. i use vmware and virtual servers for that purpose.

Good Luck!

tNt

EDIT: since you asked, lol. “Web UI not running server created as ‘root’ properly” or some such.

I find the easiest way to resolve this is by archiving and importing:

  1. log in as the initial server owner (in this case, root)
  2. create an archive of the server (while it’s down)
  3. move the file (or copy) to /var/games/minecraft/import/
  4. log in as the intended server owner (e.g., mc)
  5. Go to “Import a Server” and click “create server from archive”

The newly imported server will be owned by the non-root user, now.

  1. (optional, but probably desirable), remove the initial server from root in the webui.

So I tried first, to use the method hexparrot reccomended, but the first thing I noticed is when I logged into the UI using root, the account had no servers. I tried the same steps using the mc account and no dice. Next I tried to delete everything except the archive I made just in case using root and winSCP and remade the server using mc and the webUi and running FTBInstall.sh using mc and the same problems persisted. World gen was not being overridden and becoming a void world, and I didn’t have access to any non-vanilla server commands. This leads me to the original theory I had, that what ever series of scripts are being run when I click the start button in the UI is missing something that the ServerStart.sh provided by FTB has.

Well, you can open ServerStart.sh and see exactly what it does. Then, you can compare it to what MineOS does, which is very predictable…

java -jar somejar.jar -Xmx 1024 -Xms 1024 nogui

What does that mean that it just didn’t work. Did you get an error? Did you not see that the archive was created? What behaviors indicate to you that creating an archive through mc didn’t work?

What I meant by it didn’t work is that I was getting the same issues. Commands werent showing up and I assume that had I made a new world it would not have generated properly.
ServerStart.sh - Pastebin.com These are the contents of the ServerStart.sh. It seems to have quite a different set of commands than

java -jar somejar.jar -Xmx 1024 -Xms 1024 nogui

If there is a way to make the server run the ServerStart.sh rather than run the other command that would be the next thing I want to try.