This thread is for accumulating various command-line actions and issues that may be experienced while using MineOS. Please don’t post issues to this thread, but instead start a new post from here, using the link to the right (appears when you mouse-over) “Reply as linked Topic”
Firewalls
What does my firewall look like?
root@mineos ~# iptables --list
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:8443
ACCEPT tcp -- anywhere anywhere tcp dpt:25565
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
How can I turn off the firewall for testing? (will revert upon server restart)
root@mineos ~# iptables -P INPUT ACCEPT
root@mineos ~# iptables -F
Webui service
How do I know the webui is running?
root@mineos games/minecraft# netstat -tnl | grep 8443
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN
Check for tcp
, 0.0.0.0:8443
. This indicates it’ll work on IPv4 and is listening on all interfaces on the right port.
How else can I check?
root@mineos ~# ps -aux | grep node
root 989 1.9 4.7 1302200 96852 ? Sl 17:58 0:13 /usr/bin/node webui.js
root 1605 0.0 0.0 11128 976 pts/0 S+ 18:10 0:00 grep --color=auto node
Check for webui.js
. Also take note that root
is running your expected binary, which in this case is /usr/bin/node
but can vary depending on your nodejs installation choices.
How else can I check?
root@mineos games/minecraft# supervisorctl status mineos
mineos RUNNING pid 989, uptime 0:30:27
This is a supervisord
process, but depending on your installation, you might also find out this process via systemctl mineos status
.
How else can I check?
will@willonubuntu:~$ curl -k -c cookie.txt -d "username=mc" -d "password=Mcpassword1" https://12.34.56.78:8443/auth
Found. Redirecting to /admin/index.html
will@willonubuntu:~$ curl -k -b cookie.txt https://12.34.56.78:8443/admin/index.html
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" ng-app="mineos"> <!--<![endif]-->
<head>
This can be done from both the local server to check if it’s running, or from a remote server to test connectivity!
This is definitely the least popular option, but actually is confirming that the webui is connectable and that the authentication stack is working. Still, the other options are likely sufficient (knowing the webui is up).
The webui keeps crashing! What can I do?
- Update to a recent commit (or reset your scripts)
- Restart the background service to load the new commit!
supervisorctl restart mineos
- Look at
/var/log/mineos.log
and share a copy with us (there’s nothing in there that’s unsafe to share, but you can blur out the ip addresses if you want)
Permissions
What should my /var/games/minecraft
directory look like, generally:
root@mineos games/minecraft# ls -la /var/games/minecraft/*
/var/games/minecraft/archive:
total 12
drwxrwxr-x 3 root root 4096 Apr 20 18:40 . <--- . and .. should be owned by root:root in all cases
drwxr-xr-x 7 root root 4096 Mar 7 18:06 ..
drwxrwxr-x 2 mc mc 4096 Apr 12 22:12 reree <---owned by a user that's not root
/var/games/minecraft/backup:
total 12
drwxrwxr-x 3 root root 4096 Apr 20 18:40 .
drwxr-xr-x 7 root root 4096 Mar 7 18:06 ..
drwxrwxr-x 2 mc mc 4096 Apr 12 22:12 reree <---owned by a user that's not root
/var/games/minecraft/import:
total 8
drwxrwxrwx 2 root mc 4096 Mar 7 18:06 . <--okay to be root:mc because we want mc to be able to upload here
drwxr-xr-x 7 root root 4096 Mar 7 18:06 ..
/var/games/minecraft/profiles:
total 20
drwxrwxr-x 5 root root 4096 Mar 25 18:12 .
drwxr-xr-x 7 root root 4096 Mar 7 18:06 ..
drwxrwxr-x 2 root root 4096 Mar 25 18:12 1.9 <-- all profiles should be owned by root:root
drwxrwxr-x 2 root root 4096 Mar 10 18:31 PocketMine-1266
drwxrwxr-x 2 root root 4096 Mar 10 18:31 PocketMine-980
/var/games/minecraft/servers:
total 12
drwxrwxr-x 3 root root 4096 Apr 20 18:40 .
drwxr-xr-x 7 root root 4096 Mar 7 18:06 ..
drwxrwxr-x 2 mc mc 4096 Apr 12 22:12 reree <-- this example has mc:mc, but can be any user:group
Webui operation
The profiles dropdown isn’t populated or the jar dropdown!
Check /var/log/mineos.log
, it should indicate what is going wrong in the webui.
Nothing works in the webui!
Refresh the page–if your webui crashed, you’ll be returned to the login page, which is why none of the other buttons worked (because the connection was severed). Check the mineos.log
for details.
Git
What commit am I on?
root@mineos games/minecraft# git log -n 1 | grep commit
commit 2d22dc16952c70b0124ce0ee3ec1b5671452ad02
What commits are out there?
root@mineos games/minecraft# git rev-parse HEAD
5e7c7db6921544b441857e3f222f759bf0e89829 <--- this is the latest commit you know about!
root@mineos games/minecraft# git fetch
root@mineos games/minecraft# git rev-parse origin/master
2d22dc16952c70b0124ce0ee3ec1b5671452ad02 <--- this is the latest commit I've written!
Why can’t I run my servers as non-root
?
In all likelihood, you have at some point run the servers as root
, which has allowed the superuser to create new files that are then only accessible/modifiable as root
. Since your non-root
users (a.k.a. unprivileged users) can then not properly access/modify the minecraft files, it naturally will error out and crash before starting.
You will need to change ownership (chown
) of these files from their current owner (root
) to another user.
root@mineos ~# chown -R mc:mc /var/games/minecraft/servers/myserver
root@mineos ~# chown -R mc:mc /var/games/minecraft/archive/myserver
root@mineos ~# chown -R mc:mc /var/games/minecraft/backup/myserver
See this post.
Why can’t I update Java? I followed instructions at http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html?m=1 and the commands don’t work.
This worked for me and I suspect will work for you, make sure you follow all spaces, commas and quotation marks to the letter:
sh -c ‘echo “deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main” >> /etc/apt/sources.list’
sh -c ‘echo “deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main” >> /etc/apt/sources.list’
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
update to java 9 would then be:
sh -c ‘echo “deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main” >> /etc/apt/sources.list’
sh -c ‘echo “deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main” >> /etc/apt/sources.list’
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java9-installer
NOTE: I have tested above java8 commands as working on MineOS Node JS and will remove this note once it is confirmed we should upgrade to java9 and I have confirmed testing java9 commands as working!
Good Luck!
tNt
How is MineOS even opening Minecraft with Java?!
mc@mineos-tkldev ~$ cd /usr/games/minecraft/
mc@mineos-tkldev .../games/minecraft$ ./mineos_console.js -s myserver get_start_args
[myserver] Successfully executed "get_start_args"
[ '-dmS',
'mc-myserver',
'/usr/bin/java',
'-server',
'-Xmx300M',
'-Xms300M',
'-jar',
'minecraft_server.1.14.4.jar',
'nogui' ]
Once you know the arguments MineOS will use, you can run these commands in the foreground (a terminal session) as the same user as the user in the webui:
$ cd /var/games/minecraft/servers/myserver
$ /usr/bin/java -server -Xmx300M -Xms300M -jar minecraft_server.1.14.4.jar nogui
Basically, ignore the first two arguments (used for screen, which is for background processes), and combine all the remaining ones together, while in the server’s live directory. Whatever error is responsible for the Webui not being able to bring it up should be now right there, easily readable.