Failed to start devlopment server — BindError: Unable to find a consistent port localhost

前端 未结 7 2067
逝去的感伤
逝去的感伤 2020-12-03 23:13

Google-app-engine development server runs great yesterday, but when I try to start it today. It only shout out this Error.

I tried use lsof -i:8080 / <

相关标签:
7条回答
  • 2020-12-03 23:42

    In my case just restarting the terminal worked.

    0 讨论(0)
  • 2020-12-03 23:44
    dev_appserver.py . --port 4000
    

    this fixed it for me.

    0 讨论(0)
  • 2020-12-03 23:45

    I solved this issue by passing an explicit api port to dev_appserver.py:

    dev_appserver.py path/to/project --api_port 3000
    

    I was unable to solve the issue by editing the hosts file or passing --port / --host to dev_appserver.py.

    I didn't identify the root cause.

    0 讨论(0)
  • 2020-12-03 23:56

    Similar to what was posted, I had this issue and fixed it by altering the hosts file. The issue was with IPv6 addresses redirecting to localhost:

    In my hosts file I had

    127.0.0.1    localhost
    ::1          localhost 
    fe80::1%lo0  localhost
    

    And I commented out the IPv6 addresses to give

    127.0.0.1     localhost
    #::1          localhost 
    #fe80::1%lo0  localhost
    

    I'm not sure this is a viable permanent solution as I imagine it's important to have the IPv6 numerical addresses for localhost to be in the hosts file but it works for now until a proper fix is released.

    0 讨论(0)
  • 2020-12-03 23:59

    While I never seen that before try running it on a different port or even using a different host:

    dev_appserver.py /path/to/project --port 8888 --host 127.0.0.1
    

    Where for host add your current IP address.

    0 讨论(0)
  • 2020-12-04 00:02

    This can be caused by multiple entries in your hosts file for 'localhost'.

    For example in file /etc/hosts:

    127.0.0.1 localhost
    127.0.0.1 mymachinename localhost
    

    if you delete all mappings but one for localhost, the problem will hopefully be resolved.

    127.0.0.1 mymachinename localhost
    

    This is a known issue and as far as I understand it will be corrected in a future release.

    0 讨论(0)
提交回复
热议问题