local server - 'connection to server failed'

Discussion in 'Mac and Linux' started by brunomartelli, December 27, 2014.

  1. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    Hi
    since the last patch to PA, its all gotten a lot worse.
    Local server fails every time without fail.
    In the settings/server it sometimes reads:
    server = US CENTRAL, sometimes it reads server = NOTHING.

    local server = ON - that always throws up 'connection to server failed.'

    if local server is set to AUTO - that always throws up 'connection to server failed.'

    So whats going on? if I restart sometimes it will work, but then loose connection after 30 mins.
    Seems like it can never use a local server. Is there any guide or explanation anywhere at all for what these settings should be set to and what they mean?

    I'm on Mac Os 10.10.1
    and in the PA log file it says
    [17:23:09.494] INFO Could not connect to server at 127.0.0.1:20545: Refused
    Last edited: December 27, 2014
  2. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
    I suspect your server has frozen, and it's preventing new servers from starting up. You can open Activity Monitor and look for a process named "server" to end. If you're comfortable with Terminal.app "killall server" works quite nicely as well.
  3. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ok thanks, Terminal said

    - No matching processes belonging to you were found
  4. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
    Okay, so if you're still getting connection errors it's something else.

    Perhaps try "lsof -i :20545 -c server" after getting the error, without closing PA. This should report any ports open by the server as well as anything else sitting on it's port number.
  5. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ok i tried that command, it did not do anything. i also tried 'lsof -i' amongst other things it said:

    steam_osx 24147 brunomartelli 20u IPv4 0xd7937870b0579947 0t0 TCP localhost:57343 (LISTEN)

    steam_osx 24147 brunomartelli 74u IPv4 0xd7937870af95e69f 0t0 UDP *:52283

    steam_osx 24147 brunomartelli 88u IPv4 0xd7937870b171b217 0t0 TCP localhost:57343->localhost:62134 (ESTABLISHED)

    steam_osx 24147 brunomartelli 94u IPv4 0xd7937870af9ed8f7 0t0 UDP *:27036

    steam_osx 24147 brunomartelli 96u IPv4 0xd7937870b15a37a7 0t0 TCP *:27036 (LISTEN)

    steam_osx 24147 brunomartelli 102u IPv4 0xd7937870b15a2607 0t0 TCP localhost:57343->localhost:62132 (ESTABLISHED)

    steam_osx 24147 brunomartelli 109u IPv4 0xd7937870b15a1467 0t0 TCP localhost:57343->localhost:62133 (ESTABLISHED)

    steam_osx 24147 brunomartelli 119u IPv4 0xd7937870b171a077 0t0 TCP localhost:57343->localhost:62135 (ESTABLISHED)

    PA 24166 brunomartelli 9u IPv4 0xd7937870b15a2ed7 0t0 TCP localhost:62132->localhost:57343 (ESTABLISHED)

    PA 24166 brunomartelli 132u IPv4 0xd7937870b1716b97 0t0 TCP brunos-mbp.home:62144->50.18.123.94:https (CLOSE_WAIT)

    PA 24166 brunomartelli 134u IPv4 0xd7937870b17b2607 0t0 TCP brunos-mbp.home:62150->50.18.123.94:https (CLOSE_WAIT)

    PA 24166 brunomartelli 138u IPv4 0xd7937870b17197a7 0t0 TCP brunos-mbp.home:62164->50.18.123.94:https (CLOSE_WAIT)

    PA 24166 brunomartelli 140u IPv4 0xd7937870afe07d37 0t0 TCP brunos-mbp.home:62166->50.18.123.94:https (CLOSE_WAIT)

    CoherentU 24168 brunomartelli 112u IPv4 0xd7937870b057a217 0t0 TCP localhost:distinct (LISTEN)

    CoherentU 24168 brunomartelli 211u IPv4 0xd7937870afe0a077 0t0 TCP brunos-mbp.home:62168->54.176.140.127:5280 (ESTABLISHED)

    gameoverl 24170 brunomartelli 99u IPv4 0xd7937870b15a1d37 0t0 TCP localhost:62133->localhost:57343 (ESTABLISHED)

    gameoverl 24170 brunomartelli 102u IPv4 0xd7937870b15a2607 0t0 TCP localhost:57343->localhost:62132 (ESTABLISHED)

    gameoverl 24170 brunomartelli 109u IPv4 0xd7937870b15a0b97 0t0 TCP localhost:62134->localhost:57343 (ESTABLISHED)

    gameoverl 24170 brunomartelli 110u IPv4 0xd7937870b171a947 0t0 TCP localhost:62135->localhost:57343 (ESTABLISHED)
  6. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    sorry thats hard to look at...
  7. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
    Okay, the first one rules out something else blocking the port, and a further rules out a stuck server process. It may be not starting or crashing early. You could try watching Activity Monitor to see if you can see it appearing briefly.

    You could try turning off the steam overlay, I know that caused some trouble in pre-local-server days.

    More:

    In terminal, enter "cd ~/Library/Application\ Support/Steam/SteamApps/common/Planetary\ Annihilation/PA.app/Contents/MacOS"

    Now try running ./server --headless and see if stays up. You could also try running lsof in another window to see if it's listening on 20545. If everything is good you should be able to run PA and it will connect to this server when you start a local game.

    You can also do ./PA and look through the output to see if there are any obvious error messages. "./PA >pa.log" will dump everything to a file that you can look at later or upload here.
  8. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    -thanks for your help!
    ok so i do:

    brunos-MBP:MacOS brunomartelli$ cd ~/Library/Application\ Support/Steam/SteamApps/common/Planetary\ Annihilation/PA.app/Contents/MacOS
    brunos-MBP:MacOS brunomartelli$ ./server --headless
    2014-12-28 17:29:22.433 server[27336:3679235] INFO SDL: Built w/ v2.0.4, linked w/ v2.0.4
    2014-12-28 17:29:22.433 server[27336:3679235] INFO Loaded buildID 2014122376557
    2014-12-28 17:29:22.433 server[27336:3679235] WARN Crash reporting disabled.
    2014-12-28 17:29:22.434 server[27336:3679235] INFO Starting background thread pool with 6 threads
    2014-12-28 17:29:22.434 server[27336:3679235] INFO GameServerImpl::resetModUpdateAuthToken: Auth token reset to "61738f13-7ab0-45e5-9543-99a25d63151a"


    - then I do this in another terminal window and I see '20545 (LISTEN)':

    brunos-MBP:~ brunomartelli$ lsof -i
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    UserEvent 223 brunomartelli 5u IPv4 0xd7937870af49dbb7 0t0 UDP *:*
    SystemUIS 232 brunomartelli 28u IPv4 0xd7937870af49b187 0t0 UDP *:63552
    SystemUIS 232 brunomartelli 30u IPv4 0xd7937870af49b637 0t0 UDP *:*
    CalendarA 242 brunomartelli 28u IPv4 0xd7937870d8673d37 0t0 TCP brunos-mbp.home:65011->17.172.208.29:https (ESTABLISHED)
    CalendarA 242 brunomartelli 29u IPv4 0xd7937870d8673d37 0t0 TCP brunos-mbp.home:65011->17.172.208.29:https (ESTABLISHED)
    sharingd 258 brunomartelli 12u IPv4 0xd7937870af470e0f 0t0 UDP *:*
    sharingd 258 brunomartelli 16u IPv4 0xd7937870af49a827 0t0 UDP *:*
    ovragent 292 brunomartelli 4u IPv6 0xd7937870ae338dc7 0t0 TCP localhost:30322 (LISTEN)
    WiFiAgent 305 brunomartelli 17u IPv4 0xd7937870af46df2f 0t0 UDP *:*
    com.apple 314 brunomartelli 6u IPv4 0xd7937870af4712bf 0t0 UDP *:*
    com.apple 330 brunomartelli 10u IPv4 0xd7937870afe0a947 0t0 TCP brunos-mbp.home:64854->17.252.11.250:https (CLOSE_WAIT)
    com.apple 330 brunomartelli 11u IPv4 0xd7937870afe0a947 0t0 TCP brunos-mbp.home:64854->17.252.11.250:https (CLOSE_WAIT)
    CIJScanne 27111 brunomartelli 14u IPv4 0xd7937870af9edda7 0t0 UDP *:50192
    CIJScanne 27111 brunomartelli 15u IPv4 0xd7937870b2f2d5cf 0t0 UDP *:56137
    server 27336 brunomartelli 5u IPv4 0xd7937870d8674607 0t0 TCP localhost:20545 (LISTEN)

    but then when i click on the PA icon, it opens steam, connects to playfab and I go to single player, connect to my war go to fight - it says 'connection to server refused etc.' and in Terminal i see:

    2014-12-28 17:34:22.492 server[27336:3679235] INFO Script requested exit:
    in states/empty line 59:54
    2014-12-28 17:34:22.492 server[27336:3679235] INFO Starting exit process
    2014-12-28 17:34:22.492 server[27336:3679235] INFO Shutting down script environment
    2014-12-28 17:34:22.494 server[27336:3679235] INFO Shutting down server
    2014-12-28 17:34:22.494 server[27336:3679235] INFO requesting exit
    brunos-MBP:MacOS brunomartelli$
  9. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
    One of those line numbers is related to timeout. Get PA running, start the server, and then hit Fight. Get the windows side-by-side if you can, to see if attempt to connect causes it to exit.

    A couple of tangents:

    You also need to pass "--game-mode gw" to the server if you want to test galactic war. I connected to a regular lobby when I tried your way, so it's not the issue. AI skirmish may be faster for testing; you're using the server as soon as you join the lobby.

    If you run ./PA directly (to see the full console output), you won't be logged into Steam. Since you are attempting to play on the local server you won't need to be logged in, but FYI you can log in with your PlayFab account and avoid Steam entirely.
  10. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ok so if I start PA, then use Terminal to get the server running, then go into Single player and then AI Skirmish i get 'connection to server refused etc.'
  11. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ok and i saw this in the terminal window (along with a bunch of other stuff):

    2014-12-28 21:01:24.549 PA[29296:3968068] INFO Connect to localhost:20545 worked
    2014-12-28 21:01:25.013 PA[29296:3968069] INFO connection_LoginRejected
    2014-12-28 21:01:28.031 PA[29296:3968055] INFO resetGameState

    is that because the playfab password isn't there because steam is not running??
  12. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
    Okay, so connection seems to be working, at least for a moment. Account should be irrelevant for offline play.

    I forgot about one more thing, although with the above it may not be much more informative.

    Code:
    ./server --headless --log-network-traffic net.log
    Here is the head of a successful connection:

    Code:
    [0.0000] 1: socket(0)
    [0.0000] 1: bind(127.0.0.1:20545): Worked
    [0.0000] 1: listen(1)
    [15.3350] 1: accept(): 2 127.0.0.1:52216
    [15.3699] 2: recv(2048): 87
        56 08 77 6f 6e 64 69 62 6c 65 00 4b 7b 22 75 62  65 72 69 64 22 3a 22 31 35 39 34 31 30 34 30 32
        35 34 36 34 37 37 36 32 39 32 36 22 2c 22 75 75  69 64 22 3a 22 44 33 45 37 35 45 35 32 41 37 41
        38 42 45 32 46 43 41 34 31 42 42 35 44 43 41 34  33 32 30 45 41 22 7d
    [15.3699] 2: send(3): 3
        00 01 08
    
    It's possible that the rejection comes much further down, but I've never gotten into interpreting the data.
  13. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    is it just me, or is playing this game and not being connected to the internet, just the teensiest bit complicated??
  14. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ok i did that, i get this in Terminal:

    brunos-MBP:MacOS brunomartelli$ ./server --headless --log-network-traffic net.log
    2014-12-28 21:21:22.114 server[29565:4002897] INFO SDL: Built w/ v2.0.4, linked w/ v2.0.4
    2014-12-28 21:21:22.114 server[29565:4002897] INFO Loaded buildID 2014122376557
    2014-12-28 21:21:22.115 server[29565:4002897] WARN Crash reporting disabled.
    2014-12-28 21:21:22.115 server[29565:4002897] INFO Starting background thread pool with 6 threads
    2014-12-28 21:21:22.115 server[29565:4002897] INFO GameServerImpl::resetModUpdateAuthToken: Auth token reset to "fae5bad6-1e39-43e8-8611-35246c90a03c"
    libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: setsockopt(SO_SNDBUF) failed
    Abort trap: 6
    brunos-MBP:MacOS brunomartelli$
  15. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ..one more thing, my firewall is off
  16. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
    So for log-network-traffic, I was going for the net.log file. But this crash is much more interesting. ;^)

    Unfortunately I think the devs are going to have look at this one, and it will likely be at least a week until they are back in office - and then juggling many bugs and feature requests.

    Can you confirm the "not connected to internet" part? I thought since you were logging in via Steam earlier that you were at least online.

    System report may also be useful: Steam client window -> Top menu bar -> Help -> System Information
  17. wondible

    wondible Post Master General

    Messages:
    3,286
    Likes Received:
    2,084
  18. brunomartelli

    brunomartelli New Member

    Messages:
    11
    Likes Received:
    0
    ok wifi off. firewall off
    in Terminal:
    cd ~/Library/Application\ Support/Steam/SteamApps/common/Planetary\ Annihilation/PA.app/Contents/MacOS
    Terminal:
    ./PA

    - then start the server:
    Terminal (new window):
    cd ~/Library/Application\ Support/Steam/SteamApps/common/Planetary\ Annihilation/PA.app/Contents/MacOS
    Terminal:
    ./server --headless --log-network-traffic net.log

    then in PA go to single player and AI Skirmish, I get:
    "Connection to server failed etc."

    in Terminal I see this:
    brunos-MacBook-Pro:MacOS brunomartelli$ ./server --headless --log-network-traffic net.log
    2014-12-29 19:07:04.341 server[35021:4784760] INFO SDL: Built w/ v2.0.4, linked w/ v2.0.4
    2014-12-29 19:07:04.342 server[35021:4784760] INFO Loaded buildID 2014122376557
    2014-12-29 19:07:04.342 server[35021:4784760] WARN Crash reporting disabled.
    2014-12-29 19:07:04.342 server[35021:4784760] INFO Starting background thread pool with 6 threads
    2014-12-29 19:07:04.342 server[35021:4784760] INFO GameServerImpl::resetModUpdateAuthToken: Auth token reset to "52d00a07-c130-4c4c-9d2d-9e0d09ff7e60"
    libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: setsockopt(SO_SNDBUF) failed
    Abort trap: 6
    brunos-MacBook-Pro:MacOS brunomartelli$

    In Activity Monitor I could see the server



Share This Page