Headless server on Mac

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Kohlerslave
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jan 07, 2017 6:32 am
Contact:

Headless server on Mac

Post by Kohlerslave »

I have searched everywhere and there is no help for us Mac users. So now I'm gonna try here.

I've managed to set it all up and get it running. Problem is, it doesn't consistantly work. When I have a clean install of Factorio on my Mac Mini(which I'm using as a server), I set up a headless server with a new map and it'll run. I can connect from my laptop and play. When I disconnect and shut down the server(using ctrl-c), everything appears to shut down properly. When I rerun the server, I can connect and play for about 15 seconds and then I get the "trying to connect to the server" pop up, and then it just won't connect. After that, when I try to shut down the server, it hangs at "Info ServerMultiplayerManager.cpp:658: mapTick(66341) changing state from (DisconnectingScheduled) to(Disconnecting)". It never leaves that line and I have to force-quit Factorio and close the Terminal window.

At this point, I've tried everything I can think off. The log doesn't give any errors at all. I host Starbound and Minecraft servers from the Mini for weeks without any issues. Heck, the Minecraft server ran for over 2 months straight(I forgot to do my usual backups). That same computer also runs a Plex server, so I know it's more than capable of doing this. Not sure if I'm missing something or if this is just a bug in the server software.

Any help would be great. I can post logs, but like I said, they don't say anything out of the ordinary.

Thanks

Loewchen
Global Moderator
Global Moderator
Posts: 8322
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Headless server on Mac

Post by Loewchen »

Post the logs from server and client please.

Kohlerslave
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jan 07, 2017 6:32 am
Contact:

Re: Headless server on Mac

Post by Kohlerslave »

Here's the server log:
factorio-server.log
(4.87 KiB) Downloaded 144 times
And here's the client log:
factorio-client.log
(5.77 KiB) Downloaded 117 times
Let me know what else I can provide. I just ran these about 5 minutes ago.

Loewchen
Global Moderator
Global Moderator
Posts: 8322
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Headless server on Mac

Post by Loewchen »

You somehow closed stdin, see here: viewtopic.php?f=7&t=32786

Kohlerslave
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jan 07, 2017 6:32 am
Contact:

Re: Headless server on Mac

Post by Kohlerslave »

You're link references Docker, but I'm not using that. I don't know what stdin is or how it closed. Why would this allow me to play initially and then make the server crap out after relaunch?

Kohlerslave
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jan 07, 2017 6:32 am
Contact:

Re: Headless server on Mac

Post by Kohlerslave »

After looking at my logs again, the issue you're referencing is after the client-server disconnect issue I'm having. The stdin fail is happening after I've pressed Ctrl-C to stop the server. The point where I'm having the connection drop is right before the Received SIGINT, shutting down. This is where the log is at when my client losses connection:

Server Log:

Code: Select all

32.895 Info ServerMultiplayerManager.cpp:742: mapTick(66419) received stateChanged peerID(1) oldState(TryingToCatchUp) newState(WaitingForCommandToStartSendingTickClosures)
  32.895 Info GameActionHandler.cpp:2556: MapTick(66419) processed PlayerJoinGame peerID(1) playerIndex(0) mode(connect)
  32.969 Info ServerMultiplayerManager.cpp:742: mapTick(66423) received stateChanged peerID(1) oldState(WaitingForCommandToStartSendingTickClosures) newState(InGame)
 138.533 Received SIGINT, shutting down
As for the client log, you can see that it connects and downloads the map. In the below example, you can see that I can connect, get the map and play for a little while, but shortly after that, I get a window that I can't reproduce right now, with a bar across the bottom(Server is not responding). Then it says "Communication with server failed" with boxes to click Save Game, Quit Game or Reconnect. When I try to reconnect, I get the "Couldn't establish network communication with server." error. This happened at the 81.453 mark in the log below.

Client Log:

Code: Select all

20.805 Info ClientMultiplayerManager.cpp:539: MapTick(-1) changing state from(ConnectedWaitingForMap) to(ConnectedDownloadingMap)
  21.682 Finished download (0 s, 2.5 MB, 2.9 MB/s)
  21.701 Info ClientMultiplayerManager.cpp:650: mapTick(-1) map download finished creating scenario
  21.701 Loading map /Users/ben/Library/Application Support/factorio/temp/mp-download.zip
  21.701 Info ClientMultiplayerManager.cpp:539: MapTick(-1) changing state from(ConnectedDownloadingMap) to(ConnectedLoadingMap)
  21.702 Error FileUtil.cpp:284: Can't remove /Users/ben/Library/Application Support/factorio/temp/currently-playing: No such file or directory
  21.723 Info Scenario.cpp:152: Map version 0.14.21-0
  21.899 Checksum for script /Users/ben/Library/Application Support/factorio/temp/currently-playing/control.lua: 1057114497
  21.903 Info ClientMultiplayerManager.cpp:539: MapTick(66341) changing state from(ConnectedLoadingMap) to(TryingToCatchUp)
  22.020 Info ClientMultiplayerManager.cpp:539: MapTick(66415) changing state from(TryingToCatchUp) to(WaitingForCommandToStartSendingTickClosures)
  22.103 Info ClientMultiplayerManager.cpp:539: MapTick(66415) changing state from(WaitingForCommandToStartSendingTickClosures) to(InGame)
  22.169 Info GameActionHandler.cpp:2556: MapTick(66419) processed PlayerJoinGame peerID(1) playerIndex(0) mode(connect)
  30.103 Info ClientSynchronizer.cpp:255: Changing local latency from 32 to 14 (nextTickToSend: 66927, ticksClientWillJumpOver: 0 {})
  40.103 Info ClientSynchronizer.cpp:255: Changing local latency from 14 to 10 (nextTickToSend: 67509, ticksClientWillJumpOver: 0 {})
  55.119 Info ClientSynchronizer.cpp:255: Changing local latency from 10 to 9 (nextTickToSend: 68407, ticksClientWillJumpOver: 0 {})
  81.453 Info ClientMultiplayerManager.cpp:539: MapTick(68675) changing state from(InGame) to(WaitingForUserToSaveOrQuitAfterServerLeft)
  83.461 Info UDPSocket.cpp:235: Socket closed
  83.461 Joining game 10.0.1.150:34197
  83.461 Info UDPSocket.cpp:33: Opening socket
  83.462 Info ClientMultiplayerManager.cpp:539: MapTick(-1) changing state from(Ready) to(Connecting)
  86.136 Error ClientMultiplayerManager.cpp:90: MultiplayerManager failed: multiplayer.not-received-connection-accept-reply
  86.136 Info ClientMultiplayerManager.cpp:539: MapTick(-1) changing state from(Connecting) to(InitializationFailed)
  87.336 Info ClientMultiplayerManager.cpp:177: Quitting multiplayer connection.
  87.336 Info ClientMultiplayerManager.cpp:539: MapTick(-1) changing state from(InitializationFailed) to(Disconnected)
  87.351 Info UDPSocket.cpp:235: Socket closed
I tried all over again with the Steam install on my Mac Mini. Previously, I was trying the download right from the Factorio site. Exact same results. I don't know what else to do. Nothing works. I hosted a multiplayer game from within the client, which my brother was able to connect to and we played for 4 hours tonight without a hitch. This has something to do with the headless server.

Kohlerslave
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Jan 07, 2017 6:32 am
Contact:

Re: Headless server on Mac

Post by Kohlerslave »

Am I on my own on this? I'm guessing no one else knows what's causing this.

WarmCat
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Feb 21, 2016 1:32 am
Contact:

Re: Headless server on Mac

Post by WarmCat »

You are not alone.
I find that if I run factorio server on my macmini, I must keep factorio in the foreground (even though no window is open) else my clients will disconnect.
It seems that if it goes to the background, it is no longer connected to stdin. I'm going to post a bug report on it, when running as headerless it should be able to serve even when in background.
I'll post back here if I figure anything else out.

TrentLess
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun May 14, 2017 4:18 am
Contact:

Re: Headless server on Mac

Post by TrentLess »

I have experienced the same problem. Here are the verbose logs from my run.

Client Log:
client-factorio-current.log
Client Verbose Log
(9.41 KiB) Downloaded 124 times
Server Log:
server-factorio-current.log
Server Verbose Log
(11.55 KiB) Downloaded 127 times

Post Reply

Return to “Technical Help”