factoriotools / factorio-docker

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

[SOLVED] Can't connect with uploaded save #427

Closed Disorrder closed 2 years ago

Disorrder commented 2 years ago

Game is working good when I generate new save. But when I try to upload save even without mods, I can't connect to server.

But nothing helps. My goal is continue to play my save on server. What am I doing wrong? Fun fact: I can continue to play generated by server save in single play.

My docker-compose config

version: '3'

services:
  factorio-pp:
    image: factoriotools/factorio
    restart: unless-stopped
    ports:
      - "27015:27015"
      - "34197:34197/udp"
    volumes:
      - /opt/factorio:/factorio
    environment:
      - LOAD_LATEST_SAVE=false
      - SAVE_NAME=test-no-mods

Logs are ok as well

factorio-pp_1        | + FACTORIO_VOL=/factorio
factorio-pp_1        | + LOAD_LATEST_SAVE=false
factorio-pp_1        | + GENERATE_NEW_SAVE=false
factorio-pp_1        | + SAVE_NAME=test-no-mods
factorio-pp_1        | + mkdir -p /factorio
factorio-pp_1        | + mkdir -p /factorio/saves
factorio-pp_1        | + mkdir -p /factorio/config
factorio-pp_1        | + mkdir -p /factorio/mods
factorio-pp_1        | + mkdir -p /factorio/scenarios
factorio-pp_1        | + mkdir -p /factorio/script-output
factorio-pp_1        | + [[ ! -f /factorio/config/rconpw ]]
factorio-pp_1        | + [[ ! -f /factorio/config/server-settings.json ]]
factorio-pp_1        | + [[ ! -f /factorio/config/map-gen-settings.json ]]
factorio-pp_1        | + [[ ! -f /factorio/config/map-settings.json ]]
factorio-pp_1        | ++ wc -l
factorio-pp_1        | ++ find -L /factorio/saves -iname '*.tmp.zip' -mindepth 1
factorio-pp_1        | + NRTMPSAVES=0
factorio-pp_1        | + [[ 0 -gt 0 ]]
factorio-pp_1        | + [[ '' == \t\r\u\e ]]
factorio-pp_1        | ++ id -u
factorio-pp_1        | + [[ 0 = 0 ]]
factorio-pp_1        | + usermod -o -u 845 factorio
factorio-pp_1        | usermod: no changes
factorio-pp_1        | + groupmod -o -g 845 factorio
factorio-pp_1        | + chown -R factorio:factorio /factorio
factorio-pp_1        | + SU_EXEC='su-exec factorio'
factorio-pp_1        | + sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
factorio-pp_1        | ++ wc -l
factorio-pp_1        | ++ find -L /factorio/saves -iname '*.zip' -mindepth 1
factorio-pp_1        | + NRSAVES=5
factorio-pp_1        | + [[ false != true ]]
factorio-pp_1        | + [[ 5 == 0 ]]
factorio-pp_1        | + [[ false == true ]]
factorio-pp_1        | + 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)
factorio-pp_1        | ++ cat /factorio/config/rconpw
factorio-pp_1        | + [[ false == true ]]
factorio-pp_1        | + FLAGS+=(--start-server "$SAVE_NAME")
factorio-pp_1        | + exec su-exec 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 lol --server-id /factorio/config/server-id.json --start-server test-no-mods
factorio-pp_1        |    0.000 2022-02-09 17:38:05; Factorio 1.1.53 (build 59373, linux64, headless)
factorio-pp_1        |    0.005 Operating system: Linux
factorio-pp_1        |    0.005 Program arguments: "/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" <private> "--server-id" "/factorio/config/server-id.json" "--start-server" "test-no-mods" 
factorio-pp_1        |    0.005 Read data path: /opt/factorio/data
factorio-pp_1        |    0.005 Write data path: /factorio [22361/30172MB]
factorio-pp_1        |    0.005 Binaries path: /opt/factorio/bin
factorio-pp_1        |    0.016 System info: [CPU: AMD EPYC Processor, 1 core, RAM: 1987 MB]
factorio-pp_1        |    0.020 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
factorio-pp_1        |    0.020 Running in headless mode
factorio-pp_1        |    0.030 Loading mod core 0.0.0 (data.lua)
factorio-pp_1        |    0.133 Loading mod base 1.1.53 (data.lua)
factorio-pp_1        |    0.477 Loading mod base 1.1.53 (data-updates.lua)
factorio-pp_1        |    0.643 Checksum for core: 1625176034
factorio-pp_1        |    0.647 Checksum of base: 98178652
factorio-pp_1        |    0.888 Prototype list checksum: 3034860339
factorio-pp_1        |    0.957 Info PlayerData.cpp:71: Local player-data.json available, timestamp 1644439080
factorio-pp_1        |    0.957 Info PlayerData.cpp:78: Cloud player-data.json unavailable
factorio-pp_1        |    0.959 Factorio initialised
factorio-pp_1        |    0.959 Warning FileUtil.cpp:573: test-no-mods not found; using /factorio/saves/test-no-mods.zip
factorio-pp_1        |    0.960 Info ServerSynchronizer.cpp:29: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
factorio-pp_1        |    0.960 Info ServerMultiplayerManager.cpp:797: updateTick(4294967295) changing state from(Ready) to(PreparedToHostGame)
factorio-pp_1        |    0.960 Info ServerMultiplayerManager.cpp:797: updateTick(4294967295) changing state from(PreparedToHostGame) to(CreatingGame)
factorio-pp_1        |    0.965 Loading map /factorio/saves/test-no-mods.zip: 1321522 bytes.
factorio-pp_1        |    0.990 Loading level.dat: 1630912 bytes.
factorio-pp_1        |    1.013 Info Scenario.cpp:198: Map version 1.1.53-0
factorio-pp_1        |    1.089 Loading script.dat: 1182 bytes.
factorio-pp_1        |    1.101 Checksum for script /factorio/temp/currently-playing/control.lua: 3795083680
factorio-pp_1        |    1.109 Info UDPSocket.cpp:27: Opening socket at (IP ADDR:({0.0.0.0:34197}))
factorio-pp_1        |    1.109 Hosting game at IP ADDR:({0.0.0.0:34197})
factorio-pp_1        |    1.109 Info HttpSharedState.cpp:54: Downloading https://auth.factorio.com/generate-server-padlock-2?api_version=4
factorio-pp_1        |    1.478 Info AuthServerConnector.cpp:68: Obtained serverPadlock for serverHash (yAQJuomOyGdzEGBweN3sEuyRnfHdbqjy) from the auth server.
factorio-pp_1        |    1.478 Info ServerMultiplayerManager.cpp:797: updateTick(2846) changing state from(CreatingGame) to(InGame)
factorio-pp_1        |    1.478 Info UDPSocket.cpp:39: Opening socket for broadcast
factorio-pp_1        |    1.479 Info RemoteCommandProcessor.cpp:130: Starting RCON interface at IP ADDR:({0.0.0.0:27015})
factorio-pp_1        |    1.479 Info CommandLineMultiplayer.cpp:293: Maximum segment size = 100; minimum segment size = 25; maximum-segment-size peer count = 10; minimum-segment-size peer count = 20
factorio-pp_1        |    1.479 Error InterruptibleStdioStream.cpp:61: Got EOF on stdin; closing

Solution: SAVE_NAME=test-no-mods -> SAVE_NAME=test-no-mods.zip

nicolas-lang commented 2 years ago

you should probably remove your rcon password from the log... not a big problem ... but still...

nicolas-lang commented 2 years ago

minor issues:

besides that the server logs look fine, what are you doing to connect?

other

Disorrder commented 2 years ago

@nicolas-lang Thank you for reply!

you should probably remove your rcon password from the log... not a big problem ... but still...

lol, thank you

SAVE_NAME=test-no-mods shoudl probably be test-no-mods.zip

Makes no sense :( Still warns: 0.973 Warning FileUtil.cpp:573: test-no-mods.zip not found; using /factorio/saves/test-no-mods.zip I noticed this warning, but I guess this is not error, just warn about new save location.

is it hosted locally and are you using the local LAN IP?

Nope, it's hosted on VPS, so I try to connect to disordered.ru:34197. Again, new generated save works! Can't connect only if I use my save I want to continue.

is you connection attempt logged ? If not you just have a network issue...

When I use generated save, yes, all connections are logging. But with my uploaded save no, connections never logged

Usually I just set "use latest save" and make sure ./saves/ has just a single file in it

It doesn't work as well. My goal is to start multiple servers using different saves. That's why I use docker-compose. And I need to specify save name. But now I'm trying to start at least one.

Disorrder commented 2 years ago

@nicolas-lang humm, tried to connect accidentally. Just wow! Okay, i changed to SAVE_NAME=test-no-mods.zip and it became to work! Yay! Thank you Despite it still warns to logs. Well, I think it should throw an error if save not really found And we should to add this to readme