Google应用引擎开发服务器昨天运行良好,但是当我今天尝试启动它时。它只会喊出此错误。

我尝试使用lsof -i:8080/lsof -i:8000来确保未占用这些端口。
我也尝试使用--port arg切换到另一个端口。
我什至删除了gae文件夹并安装了一个新文件夹。
-根本没有运气。

也许有一个明显的解决方案,但我看不到。

这是Oh-My-God跟踪堆栈。

Traceback (most recent call last):
File "/home/henry/software/google_appengine/dev_appserver.py", line 182, in <module>
        _run_file(__file__, globals())
File "/home/henry/software/google_appengine/dev_appserver.py", line 178, in _run_file
        execfile(script_path, globals_)
File "/home/henry/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 689, in <module>
        main()
File "/home/henry/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 682, in main
        dev_server.start(options)
File "/home/henry/software/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 653, in start
        apis.start()
File "/home/henry/software/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 152, in start
        super(APIServer, self).start()
File "/home/henry/software/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 294, in start
        raise BindError('Unable to find a consistent port %s' % host)
    google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to find a consistent port localhost
    Exception in thread Thread-4 (most likely raised during interpreter shutdown):
    Traceback (most recent call last):
      File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
      File "/usr/lib/python2.7/threading.py", line 763, in runhenry@henry-A

最佳答案

这可能是由您的主机文件中“localhost”的多个条目引起的。

例如在文件/etc/hosts中:

127.0.0.1 localhost
127.0.0.1 mymachinename localhost

如果您删除除本地主机以外的所有映射,则有望解决该问题。
127.0.0.1 mymachinename localhost

这是一个已知问题,据我了解,它将在以后的版本中得到纠正。

10-06 08:40