Closed bplein closed 3 years ago
Log file when it's affected:
2.861 Warning ServerRouter.cpp:513: Received own address message reply with conflicting address (got IP ADDR:({XXX.XXX.XXX.XXX:34200}), expected IP ADDR:({XXX.XXX.XXX.XXX:18721}))
2.861 Warning ServerMultiplayerManager.cpp:628: Determining own address has failed. Best guess: IP ADDR:({XXX.XXX.XXX.XXX:18721})
2.861 Verbose MatchingServer.cpp:97: Sending create request for game(4294967295) to matching server
2.862 Info HttpSharedState.cpp:54: Downloading https://multiplayer.factorio.com/create-game
2.929 Info ServerRouter.cpp:519: Own address is IP ADDR:({XXX.XXX.XXX.XXX:18721}) (confirmed by pingpong2)
2.946 Info ServerRouter.cpp:519: Own address is IP ADDR:({XXX.XXX.XXX.XXX:18721}) (confirmed by pingpong4)
3.140 Info MatchingServer.cpp:114: Matching server game `9488901` has been created.
3.147 Info ServerMultiplayerManager.cpp:712: Matching server connection
My script to restart a container has this code in it:
docker stop $SERVERNAME
sleep 2
docker rm $SERVERNAME
sleep 2
docker network rm ${CONTAINER_NAME}_default
rm volume/saves/*.tmp.zip
sleep 2
docker-compose up -d
Let's close this. It has nothing to do with the container image. It looks like a Docker issue, maybe a race condition when I'm starting up many at one time. I've switched to host networking for these containers and it works perfectly and may be a bit more performant as well.
This may be a limitation of Docker, but I'll post it here to get your input.
I run 5 containers of factorio using this project's image, all on the same host. I use docker-compose and pass in the differences to it using environment variables.
If I restart a container individually, all is well. But if I do a mass restart (for example, the image is updated, my cron job sees this and in parallel all 5 get restarted), then the ping pong server picks up the wrong UDP port. The container port expose IS correctly exposed (I can test it with netcat) and the container is listening on the correct port, but ping pong gets confused.
This could be a docker issue. I wanted to see if you've seen this before. Right now I'm looking at having to write code that scrapes the log files after a restart to determine if it came up correctly. If anyone else has ideas on "health check" for factorio containers, that would be helpful!
Anyhow, here's the docker-compose template I use (I read in a file that holds the values for each server... and ${LATEST} is set to the specific version that is latest, not "latest":
docker-compose-template.yml