factoriotools / factorio-docker

Factorio headless server in a Docker container
https://hub.docker.com/r/factoriotools/factorio/
MIT License
926 stars 219 forks source link

Operation not permitted [/opt/factorio/bin/x64/../../config/config.ini] #495

Open pmoisel opened 3 months ago

pmoisel commented 3 months ago

After a while my friend and me wanted to come back to factorio. So i updated my server to 1.1.107 (stable) and got this:

0.000 Error Util.cpp:86: filesystem error: cannot make canonical path: Operation not permitted [/opt/factorio/bin/x64/../../config/config.ini]

I checked older versions and the server will run a container up to 1.1.100, updating to 1.1.101 or newer results in error stated above.

Any suggestions?

Fank commented 3 months ago

Can you share how you start the container? So I may be able to reproduce it.

pmoisel commented 3 months ago

Sure. I have a systemd-service:

[Unit]
Description=Factorio Server
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker stop factorio4
ExecStartPre=-/usr/bin/docker rm factorio4
ExecStartPre=/usr/bin/docker pull factoriotools/factorio:stable
ExecStart=docker run \
        -d \
        -p 34200:34197/udp \
        -v /home/factorio4:/factorio \
        --name factorio4 \
        -e LOAD_LATEST_SAVE=false \
        -e SAVE_NAME=archievement.zip \
        factoriotools/factorio:stable
ExecStop=/usr/bin/docker stop factorio4
User=factorio
Group=factorio
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

resulting in:

docker logs factorio4 -f   
+ FACTORIO_VOL=/factorio
+ LOAD_LATEST_SAVE=false
+ GENERATE_NEW_SAVE=false
+ PRESET=
+ SAVE_NAME=archievement.zip
+ BIND=
+ CONSOLE_LOG_LOCATION=
+ mkdir -p /factorio
+ mkdir -p /factorio/saves
+ mkdir -p /factorio/config
+ mkdir -p /factorio/mods
+ mkdir -p /factorio/scenarios
+ mkdir -p /factorio/script-output
+ [[ ! -f /factorio/config/rconpw ]]
+ [[ ! -f /factorio/config/server-settings.json ]]
+ [[ ! -f /factorio/config/map-gen-settings.json ]]
+ [[ ! -f /factorio/config/map-settings.json ]]
++ find -L /factorio/saves -iname '*.tmp.zip' -mindepth 1
++ wc -l
+ NRTMPSAVES=0
+ [[ 0 -gt 0 ]]
+ [[ '' == \t\r\u\e ]]
+ EXEC=
++ id -u
+ [[ 0 = 0 ]]
+ usermod -o -u 845 factorio
usermod: no changes
+ groupmod -o -g 845 factorio
+ chown -R factorio:factorio /factorio
+ EXEC='runuser -u factorio -g factorio --'
+ [[ -f /bin/box64 ]]
+ sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
++ find -L /factorio/saves -iname '*.zip' -mindepth 1
++ wc -l
+ NRSAVES=1
+ [[ false != true ]]
+ [[ 1 == 0 ]]
+ [[ false == true ]]
+ FLAGS=(--port "$PORT" --server-settings "$CONFIG/server-settings.json" --server-banlist "$CONFIG/server-banlist.json" --rcon-port "$RCON_PORT" --server-whitelist "$CONFIG/server-whitelist.json" --use-server-whitelist --server-adminlist "$CONFIG/server-adminlist.json" --rcon-password "$(cat "$CONFIG/rconpw")" --server-id /factorio/config/server-id.json)
++ cat /factorio/config/rconpw
+ '[' -n '' ']'
+ '[' -n '' ']'
+ [[ false == true ]]
+ FLAGS+=(--start-server "$SAVE_NAME")
+ exec runuser -u factorio -g factorio -- /opt/factorio/bin/x64/factorio --port 34197 --server-settings /factorio/config/server-settings.json --server-banlist /factorio/config/server-banlist.json --rcon-port 27015 --server-whitelist /factorio/config/server-whitelist.json --use-server-whitelist --server-adminlist /factorio/config/server-adminlist.json --rcon-password SOMESECRETPW --server-id /factorio/config/server-id.json --start-server archievement.zip
   0.000 Error Util.cpp:86: filesystem error: cannot make canonical path: Operation not permitted [/opt/factorio/bin/x64/../../config/config.ini]
pmoisel commented 2 months ago

any update?

Adversarius13293 commented 2 weeks ago

We had pretty much the same problem. Up to version 1.1.101 everything was fine. But every version tested from 102 to 110 had the same error message. Even when setting up a new container without any save game.
We tried many different things, but nothing worked. So our last option was a new host os, since we were still using Ubuntu 19. Now with Ubuntu 22 everything is working for us.