nimmis / docker-spigot

A docker container with spigot, builds spigot.jar on first start
175 stars 82 forks source link

Issue with spigot container when using external volume #15

Closed CedricAndry closed 7 years ago

CedricAndry commented 7 years ago

I installed nimmis/spigot Docker image on my Synology Diskstation and attached a specific volume to the container in order to save my Spigot server configuration.

Here is the volume attached : admin@DiskStation415:~/Minecraft_Docker$ ll total 22224 drwxrwxrwx+ 5 minecraft root 4096 Dec 18 11:09 . drwxr-xr-x 38 root root 4096 Dec 17 03:30 .. -rwxrwxrwx+ 1 minecraft users 1241 Dec 16 17:27 bukkit.yml drwxrwxrwx+ 3 minecraft root 4096 Dec 16 17:14 @eaDir -rwxrwxrwx+ 1 minecraft users 10 Dec 18 11:09 eula.txt drwxrwxrwx+ 2 minecraft users 4096 Dec 16 17:38 logs lrwxrwxrwx+ 1 admin users 17 Dec 17 11:19 minecraft.jar -> spigot-latest.jar drwxrwxrwx 8 minecraft users 4096 Dec 15 19:26 Mission QUOTAR -rwxrwxrwx+ 1 minecraft users 816 Dec 17 11:19 server.properties lrwxrwxrwx+ 1 admin users 17 Dec 18 11:09 spigot.jar -> spigot-latest.jar -rwxrwxrwx+ 1 minecraft root 22715741 Dec 16 17:30 spigot-latest.jar -rwxrwxrwx+ 1 minecraft users 3494 Dec 16 17:27 spigot.yml lrwxrwxrwx 1 admin users 36 Dec 17 11:50 world -> /volume3/@appstore/Craftbukkit/world

Here is the error and what is see in the stdout log file: root@nimmis-spigot:/var/log# cd supervisor
root@nimmis-spigot:/var/log/supervisor# ll
total 16
drwxr-xr-x 2 root root 4096 Dec 18 10:20 ./
drwxrwxr-x 11 root syslog 4096 Dec 16 14:17 ../
-rw------- 1 root root 0 Dec 18 10:20 crond-stderr---supervisor-3fpkPL.log
-rw------- 1 root root 0 Dec 18 10:20 crond-stdout---supervisor-Fu76im.log
-rw------- 1 root root 0 Dec 18 10:20 spigot-stderr---supervisor-9MuQsv.log
-rw------- 1 root root 444 Dec 18 10:20 spigot-stdout---supervisor-CS7fPp.log
-rw-r--r-- 1 root root 329 Dec 18 10:20 supervisord.log
-rw------- 1 root root 0 Dec 18 10:20 syslog-ng-stderr---supervisor-bgVunt.log
-rw------- 1 root root 0 Dec 18 10:20 syslog-ng-stdout---supervisor-7EcwH8.log
root@nimmis-spigot:/var/log/supervisor# tail -f spigot-stdout---supervisor-CS7fPp.log
Starting minecraft server as user minecraft...the user minecraft has not write access to directory /minecraft/
Starting minecraft server as user minecraft...the user minecraft has not write access to directory /minecraft/
Starting minecraft server as user minecraft...the user minecraft has not write access to directory /minecraft/
Starting minecraft server as user minecraft...the user minecraft has not write access to directory /minecraft/
^C
root@nimmis-spigot:/var/log/supervisor# ll /minecraft
total 22224
drwx------ 5 1035 root 4096 Dec 18 10:09 ./
drwxr-xr-x 60 root root 4096 Dec 18 10:20 ../
drwxrwxrwx 3 1035 root 4096 Dec 16 16:14 @eaDir/
drwxrwxrwx 8 1035 users 4096 Dec 15 18:26 Mission QUOTAR/
-rwx------ 1 1035 users 1241 Dec 16 16:27 bukkit.yml
-rwx------ 1 1035 users 10 Dec 18 10:09 eula.txt

drwx------ 2 1035 users 4096 Dec 16 16:38 logs/
lrwxrwxrwx 1 1024 users 17 Dec 17 10:19 minecraft.jar -> spigot-latest.jar
-rwx------ 1 1035 users 816 Dec 17 10:19 server.properties

-rwx------ 1 1035 root 22715741 Dec 16 16:30 spigot-latest.jar
lrwxrwxrwx 1 1024 users 17 Dec 18 10:09 spigot.jar -> spigot-latest.jar

-rwx------ 1 1035 users 3494 Dec 16 16:27 spigot.yml*
lrwxrwxrwx 1 1024 users 36 Dec 17 10:50 world -> /volume3/@appstore/Craftbukkit/world

How can I match my host minecraft user and the container minecraft user?

nimmis commented 7 years ago

changing the minecraft user UID from 1000 (predefined) to 1035 can be fixed by running the following command inside the docker container

sed -i.bak 's/1000:1000/1035:1000/' /etc/passwd

you have an /etc/password.bak with the original value. do a

mc_restart

after.

But which user does the directory/files in /volume3/@appstore/Craftbukkit/world have as owner, user 1035/minecraft need to have write rights there.

CedricAndry commented 7 years ago

Thanks a lot, this solve my issue with right for minecraft user. I am now stuck on another issue In /var/log/error: Dec 18 18:29:59 nimmis-spigot su[160]: pam_env(su:session): Unable to open env file: /etc/default/locale : No such file or directory

Java process does not spawn on this container.

nimmis commented 7 years ago

There was a bug in nimmis/ubuntu:14.04 where this file /etc/default/locale wasn't generated. I have updated the container with a fix so i will eventually rebuild nimmis/spigot, you can fix it in your container by running

/usr/sbin/update-locale

inside the container, that should fix the problem.