OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
541 stars 130 forks source link

Develop server not starting/no save file possible #264

Closed Omaha2002 closed 3 years ago

Omaha2002 commented 3 years ago

When using the docker develop version it is not possible to create the first save file.

It is possible to upload a save file but selecting it results in server exiting with a:

image

knoxfighter commented 3 years ago

First mentioned: https://github.com/OpenFactorioServerManager/factorio-server-manager/issues/261#issuecomment-788788461

Omaha2002 commented 3 years ago

I realise I mentioned it in #261 but also that I was hijacking another issue with the mods not working.

mroote commented 3 years ago

I'm not able to reproduce this. Could you send the log output with the error?

Omaha2002 commented 3 years ago

Here it is:

2021/03/08 10:58:47 Loaded Factorio settings from /opt/factorio/config/server-settings.json 2021/03/08 10:58:47 Starting server on: 0.0.0.0:80 2021/03/08 10:58:53 Error in creating Factorio save: exit status 1 2021/03/08 10:58:53 Error creating save {test}: exit status 1 2021/03/08 10:59:00 Starting Factorio server. 2021/03/08 10:59:00 Starting Factorio server with settings: {"bindip":"0.0.0.0","savefile":"eerste keer.zip","port":34197} 2021/03/08 10:59:00 Starting server with command: /opt/factorio/bin/x64/factorio [--bind 0.0.0.0 --port 34197 --server-settings /opt/factorio/config/ server-settings.json --rcon-port 42621 --rcon-password X*****A --server-adminlist /opt/factorio/config/server-adminlist.json --start- server /opt/factorio/saves/eerste keer.zip] 2021/03/08 10:59:00 new state, will also send to correct room 2021/03/08 10:59:00 Factorio Server: 0.000 Error Util.cpp:83: filesystem error: cannot make canonical path: Operation not permitted [/opt/factorio/ bin/x64/../../config] 2021/03/08 10:59:00 [0.000 Error Util.cpp:83: filesystem error: cannot make canonical path: Operation not permitted [/opt/factorio/bin/x64/../../confi g]] 2021/03/08 10:59:00 Factorio process exited with error: exit status 1 2021/03/08 10:59:00 new state, will also send to correct room 2021/03/08 10:59:00 Error starting Factorio server: exit status 1 2021/03/08 10:59:01 Did not detect running Factorio server attempt: 0 2021/03/08 10:59:02 Did not detect running Factorio server attempt: 1 2021/03/08 10:59:03 Did not detect running Factorio server attempt: 2 2021/03/08 10:59:04 Did not detect running Factorio server attempt: 3 2021/03/08 10:59:04 Error starting Factorio server: exit status 1

Did again a fresh install, removed all dockers, directories, downloaded new .env and docker-compose.yaml, all installed well, page coming up, can't create save file: % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 447 100 447 0 0 697 0 --:--:-- --:--:-- --:--:-- 696 100 48.6M 100 48.6M 0 0 50.9M 0 --:--:-- --:--:-- --:--:-- 50.9M 2021/03/08 11:23:05 CookieEncryptionKey invalid or empty, create new random one 2021/03/08 11:23:05 Rcon password default one or empty, generated new one: 2021/03/08 11:23:05 Password: XVlB****A /opt/fsm/mod_packs 2021/03/08 11:23:05 Server settings at /opt/factorio/config/server-settings.json not found, copying example server settings. 2021/03/08 11:23:05 Loaded Factorio settings from /opt/factorio/config/server-settings.json 2021/03/08 11:23:05 Created default admin user. Please change it's password as soon as possible. 2021/03/08 11:23:05 Username: admin 2021/03/08 11:23:05 Password: **** 2021/03/08 11:23:05 Starting server on: 0.0.0.0:80 2021/03/08 11:23:35 Logging in user: admin 2021/03/08 11:23:35 User: admin, logged in successfully 2021/03/08 11:24:07 Error in creating Factorio save: exit status 1 2021/03/08 11:24:07 Error creating save {test}: exit status 1 2021/03/08 11:25:59 Error in creating Factorio save: exit status 1 2021/03/08 11:25:59 Error creating save {fdsf}: exit status 1

mroote commented 3 years ago

The first error looks like a permission issue trying to create the server directories. The second error might be an issue with the permissions of your volume that prevent the save file from being created?

Omaha2002 commented 3 years ago

That seems to be the case, thing is I didn't change any permissions and ran the docker-compose.yaml without anything else.

Server permissions:

drwxr-xr-x 5 root root 4096 Mar 8 11:22 ./ drwxr-xr-x 6 jeroen jeroen 4096 Feb 19 07:17 ../ -rw-r--r-- 1 root root 78 Feb 19 07:17 .env -rw-r--r-- 1 root root 2199 Mar 2 08:52 docker-compose.yaml drwxr-xr-x 6 root root 4096 Mar 8 11:22 factorio-data/ drwxr-xr-x 2 root root 4096 Mar 8 11:23 fsm-data/ drwxr-xr-x 2 root root 4096 Mar 8 11:13 traefik-data/

On my other "old" server I have the same permissions on the dirs. For testing purposes I did a chmod -R 777 * on all dirs, doesn't change anything, still the same error.

knoxfighter commented 3 years ago

Since our docker container is running as root, drive permissions should not be of any problem. I also not yet had the time and motivation to look into this issue, sorry. Which factorio version do you use?

It seems like factorio has problems correctly creating the right path: Error Util.cpp:83: filesystem error: cannot make canonical path: Operation not permitted [/opt/factorio/ bin/x64/../../config]

Omaha2002 commented 3 years ago

I installed factorio:latest as a test, that one works, able to create save file and start server. But of course still has the Mods error.

mroote commented 3 years ago

Hmm thanks for the test seems the issue is isolated to the current develop build in that case. Could you post your docker-compose file?

Omaha2002 commented 3 years ago

I wget this one: https://raw.githubusercontent.com/OpenFactorioServerManager/factorio-server-manager/develop/docker/docker-compose.yaml

and change: "ofsm/ofsm:latest" to "ofsm/ofsm:develop"

when I do a docker ps I see it's running ofsm/ofsm:develop

(sorry for the edit)

knoxfighter commented 3 years ago

I can reporduce this:

factorio-server-manager    | 2021/03/08 15:59:46 Error in creating Factorio save: exit status 1
factorio-server-manager    | 2021/03/08 15:59:46 Error creating save {eerste keer.zip}: exit status 1

Only happens in the docker container and not on my local development.

Local works fine, local built image is also broken. Docker is to blame here, hopefully i can find out, why.

Error message same as when starting server:

   0.000 Error Util.cpp:83: filesystem error: cannot make canonical path: Operation not permitted [/opt/factorio/bin/x64/../../config]
knoxfighter commented 3 years ago

This does not happen, when using an ubuntu docker image. I don't understand why, that is happening :(

Omaha2002 commented 3 years ago

I use docker on Ubuntu

knoxfighter commented 3 years ago

It's about the docker image and not the docker host: The image is built with alpine linux.

Omaha2002 commented 3 years ago

Stable works, develop doesn't, is it because dynamic linking?

something with bind mounts? https://docs.docker.com/storage/bind-mounts/

knoxfighter commented 3 years ago

To be fair, i have absolutely no idea, what is going on there. Cause the error is not caused by the server-manager, but by the factorio-server itself. I don't find any clue, why that should not work with muslc anymore. I would say, we can just move the docker image to use ubuntu or debian. What do you thing @mroote ?

mroote commented 3 years ago

I think we went with Alpine originally just to save on image size, the latest Ubuntu container is bigger but not significantly so. ~8MB on frolvlad/alpine-glibc vs ~30MB with the latest Ubuntu. If switching the base container solves the issue I don't have a problem with that.

knoxfighter commented 3 years ago

It does fix it on my local machine, i will create a branch with the changes later (will play gw2 now), then you can test it by easily checking out the image from dockerhub :)

knoxfighter commented 3 years ago

Pushed to a new branch, please test the ubuntu docker image ofsm/ofsm:use-ubuntu-docker.

Omaha2002 commented 3 years ago

Did a fresh Install of ofsm/ofsm:use-ubuntu-docker, can confirm it's working:

i would say: push to production :-) #261 & #264 solved

mroote commented 3 years ago

Thanks for helping out with testing this @Omaha2002