Connection to Server Failed, Returning to Main Menu. Running local server - OSX 10.7

Discussion in 'Mac and Linux' started by opiate987, December 4, 2014.

  1. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,329
    Likes Received:
    2,126
    I've been playing around with the server options and I noticed one called --log-network-traffic. Could you start the server like so:
    Code:
    ./server --log-network-traffic /tmp/net.log --headless
    Then post the content of /tmp/net.log. For reference, in my case it looks like this:
  2. opiate987

    opiate987 New Member

    Messages:
    15
    Likes Received:
    1
    Interesting....


    [0.0000] 1: socket(0)
    [0.0000] 1: bind(127.0.0.1:20545): AddressUnavailable
    [0.0000] 1: listen(1)
  3. wondible

    wondible Post Master General

    Messages:
    3,299
    Likes Received:
    2,089
    This supports my theory that there is an frozen process sitting around controlling the port. netstat didn't work, how about lsof?

    Code:
    lsof -i :20545
    
  4. opiate987

    opiate987 New Member

    Messages:
    15
    Likes Received:
    1
    lsof -i :20545 returns nothing :/
  5. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,329
    Likes Received:
    2,126
    Then the error should be PortUnavailable, no?
  6. wondible

    wondible Post Master General

    Messages:
    3,299
    Likes Received:
    2,089
    So... the firewall is off, so something else must have the address.

    Code:
    lsof -i tcp -c server
    
    This reports all TCP connections and all files open by a process named server. Do it without the game or server running, so we can see what the base state is.

    Second thought: are you trying to run it truly offline? I've sometimes had trouble testing web servers on a train; somehow the entire networking system gets shut down and it can't even route locally.
  7. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,329
    Likes Received:
    2,126
    Ok, I've been able to reproduce this on Mac OS X 10.8. It's really bizarre. With the server running (with only --headless):
    Code:
    $ lsof -i tcp -c server | grep LISTEN
    server  145 ******  6u  IPv4 0x6bbf0a69f80f8d45  0t0  TCP *:49153 (LISTEN)
    
    It's listening on port 49153!

    I shut down the server, and restart it:
    Code:
    $ lsof -i tcp -c server | grep LISTEN
    server  161 ******  6u  IPv4 0x6bbf0a69f80f8d45  0t0  TCP *:49154 (LISTEN)
    
    It's now listening on the previous port + 1. This happens every time I shut down the server and start it again. Usage of --port makes no difference.

    If I turn on the network logging with --log-network-traffic, I still have:
    However, if I test the connection using
    Code:
    telnet localhost 49157
    Then the server actually reacts in the Terminal where it's running:
    (and stuff shows up in the net.log as well of course)

    @jorgenpt : I think you do the Mac stuff, so do you have any idea what's causing this?
    lokiCML and wondible like this.
  8. opiate987

    opiate987 New Member

    Messages:
    15
    Likes Received:
    1
    Mines listening on 54467, but doesn't increment
  9. opiate987

    opiate987 New Member

    Messages:
    15
    Likes Received:
    1
    actually mine does increment but not by 1, now its
    54474 (LISTEN)
  10. jorgenpt

    jorgenpt Uber Programmer Uber Alumni

    Messages:
    164
    Likes Received:
    390
    What does this command, from the terminal, show:

    Code:
    cat /etc/hosts
  11. opiate987

    opiate987 New Member

    Messages:
    15
    Likes Received:
    1
    Code:
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1    localhost
    255.255.255.255    broadcasthost
    ::1             localhost 
    fe80::1%lo0    localhost
    
  12. jorgenpt

    jorgenpt Uber Programmer Uber Alumni

    Messages:
    164
    Likes Received:
    390
    Ok, that seems fine. I also doublechecked, and we don't use localhost explicitly.

    I have a theory on what the cause for this is, and I'll push to get it out in PTE ASAP. Hopefully tomorrow. Then we can see if that's what's causing problems for you.
    SXX, lokiCML and DeathByDenim like this.
  13. jorgenpt

    jorgenpt Uber Programmer Uber Alumni

    Messages:
    164
    Likes Received:
    390
    Can you try with the latest PTE version? It should be 76079-pte.
  14. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,329
    Likes Received:
    2,126
    Ok, I managed to get my hands on the OS X 10.8 comp again. I only have SSH access so I can't test with the PA client, but in the network log it now says:
    And netstat indeed reports it listening on the correct port:
    Code:
    $ netstat -na|grep 20545
    tcp4  0  0  127.0.0.1.20545  *.*  LISTEN  
    
    jorgenpt likes this.
  15. opiate987

    opiate987 New Member

    Messages:
    15
    Likes Received:
    1
    awesome, all works thanks you guys!
    DeathByDenim likes this.

Share This Page