App Engine套接字错误:[Errno 98]地址已在使用中

时间:2017-08-22 15:14:59

标签: python python-2.7 sockets google-app-engine

我无法找到谷歌应用引擎本地服务器收听端口号的解决方案。我已经尝试了几个端口号,我一直在使用"地址已经在使用"错误。我检查了端口的可用性,但它们没有使用。

我正在尝试为python标准应用程序引擎运行示例hello_world应用程序,我在我的系统上安装了python 2.7.12,下面是输出:

dev_appserver.py --port=8085  app.yaml
INFO     2017-08-22 15:11:15,041 devappserver2.py:116] Skipping SDK update check.
INFO     2017-08-22 15:11:15,264 api_server.py:313] Starting API server at: http://localhost:32989
INFO     2017-08-22 15:11:15,269 dispatcher.py:226] Starting module "default" running at: http://localhost:8085
INFO     2017-08-22 15:11:15,271 api_server.py:945] Applying all pending transactions and saving the datastore
INFO     2017-08-22 15:11:15,271 api_server.py:948] Saving search indexes
Traceback (most recent call last):
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 103, in <module>
    _run_file(__file__, globals())
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 97, in _run_file
    execfile(_PATHS.script_file(script_name), globals_)
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 381, in <module>
    main()
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 369, in main
    dev_server.start(options)
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 201, in start
    admin.start()
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/admin/admin_server.py", line 114, in start
    super(AdminServer, self).start()
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 330, in start
    self._start_all_fixed_port(host_ports)
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 354, in _start_all_fixed_port
    server.start()
  File "/home/jade/Dev/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 255, in start
    self.socket.listen(self.request_queue_size)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use

我已经检查了stackoverflow上的其他解决方案,但没有一个建议对我有用。任何解决方案?

2 个答案:

答案 0 :(得分:0)

Address already in use

此错误表示您已在此端口上运行服务器。要解决这个问题,您必须找到在您的计算机上运行的其他服务器并终止它,或者为您的服务器选择一个不同的端口来运行:

dev_appserver.py --port=8087  app.yaml

答案 1 :(得分:-2)

我之前也遇到过同样的问题。我发现重新启动计算机会有所帮助,然后确保下次要停止时使用 ctrl + c 完全终止服务器。