factoriotools / factorio-docker

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

Initial start of container leads to InterruptibleStdioStream #357

Closed kmo-dev closed 2 years ago

kmo-dev commented 3 years ago

start command:

sudo docker run -d \
  -p 34197:34197/udp \
  -p 27015:27015/tcp \
  -v /opt/factorio:/factorio \
  --name factorio \
  --restart=always \
  factoriotools/factorio

logs:

+ FACTORIO_VOL=/factorio
+ LOAD_LATEST_SAVE=true
+ GENERATE_NEW_SAVE=false
+ SAVE_NAME=
+ 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 ]]
++ wc -l
++ find -L /factorio/saves -iname '*.tmp.zip' -mindepth 1
+ NRTMPSAVES=0
+ [[ 0 -gt 0 ]]
+ [[ '' == \t\r\u\e ]]
++ id -u
+ [[ 0 = 0 ]]
+ usermod -o -u 845 factorio
usermod: no changes
+ groupmod -o -g 845 factorio
+ chown -R factorio:factorio /factorio
+ SU_EXEC='su-exec factorio'
+ sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
++ wc -l
++ find -L /factorio/saves -iname '*.zip' -mindepth 1
+ 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
+ [[ true == true ]]
+ FLAGS+=(--start-server-load-latest)
+ 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 shu4outeiC9shai --server-id /factorio/config/server-id.json --start-server-load-latest
   0.000 2021-01-24 15:07:11; Factorio 1.1.14 (build 57894, linux64, headless)
   0.001 Operating system: Linux
   0.001 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-load-latest"
   0.001 Read data path: /opt/factorio/data
   0.001 Write data path: /factorio [26751/29598MB]
   0.001 Binaries path: /opt/factorio/bin
   0.044 System info: [CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz, 1 core, RAM: 1923 MB]
   0.045 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>
   0.046 Running in headless mode
   0.141 Loading mod core 0.0.0 (data.lua)
   0.256 Loading mod base 1.1.14 (data.lua)
   0.624 Loading mod base 1.1.14 (data-updates.lua)
   0.796 Checksum for core: 1905034584
   0.796 Checksum of base: 3399982571
   1.194 Prototype list checksum: 3034860339
   1.253 Info PlayerData.cpp:70: Local player-data.json available, timestamp 1611399873
   1.253 Info PlayerData.cpp:77: Cloud player-data.json unavailable
   1.258 Factorio initialised
   1.262 Info ServerSynchronizer.cpp:29: nextHeartbeatSequenceNumber(0) initialized Synchronizer nextTickClosureTick(0).
   1.263 Info ServerMultiplayerManager.cpp:780: updateTick(4294967295) changing state from(Ready) to(PreparedToHostGame)
   1.263 Info ServerMultiplayerManager.cpp:780: updateTick(4294967295) changing state from(PreparedToHostGame) to(CreatingGame)
   1.271 Loading map /factorio/saves/_autosave1.zip: 634461 bytes.
   1.321 Loading level.dat: 1103927 bytes.
   1.339 Info Scenario.cpp:197: Map version 1.1.14-0
   1.417 Loading script.dat: 387 bytes.
   1.421 Checksum for script /factorio/temp/currently-playing/control.lua: 2929504738
   1.436 Info UDPSocket.cpp:27: Opening socket at (IP ADDR:({0.0.0.0:34197}))
   1.437 Hosting game at IP ADDR:({0.0.0.0:34197})
   1.437 Info HttpSharedState.cpp:54: Downloading https://auth.factorio.com/generate-server-padlock-2?api_version=4
   1.776 Info AuthServerConnector.cpp:68: Obtained serverPadlock for serverHash (UWHyXhYMIeuLGvbi5ndY9vD8utsDhMUA) from the auth server.
   1.777 Info ServerMultiplayerManager.cpp:780: updateTick(0) changing state from(CreatingGame) to(InGame)
   1.857 Info ServerRouter.cpp:636: Asking pingpong servers (pingpong1.factorio.com:34197, pingpong2.factorio.com:34197, pingpong3.factorio.com:34197, pingpong4.factorio.com:34197) for own address
   1.857 Info UDPSocket.cpp:39: Opening socket for broadcast
   1.859 Info RemoteCommandProcessor.cpp:131: Starting RCON interface at IP ADDR:({0.0.0.0:27015})
   1.859 Info CommandLineMultiplayer.cpp:278: Maximum segment size = 100; minimum segment size = 25; maximum-segment-size peer count = 10; minimum-segment-size peer count = 20
   1.859 Error InterruptibleStdioStream.cpp:61: Got EOF on stdin; closing
   1.927 Info ServerRouter.cpp:519: Own address is IP ADDR:({40.127.195.191:34197}) (confirmed by pingpong1)
   1.947 Info ServerRouter.cpp:519: Own address is IP ADDR:({40.127.195.191:34197}) (confirmed by pingpong3)
   2.099 Info ServerRouter.cpp:519: Own address is IP ADDR:({40.127.195.191:34197}) (confirmed by pingpong4)
   2.250 Info MatchingServer.cpp:114: Matching server game `9019475` has been created.
   2.267 Info ServerMultiplayerManager.cpp:712: Matching server connection resumed
SuperSandro2000 commented 3 years ago

You need to set the TOKEN ENV because otherwise it asks you for it which it can't because the shell is not interactive.