VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
461 stars 218 forks source link

webserver not started when un resolvable #2102

Open craig8 opened 5 years ago

craig8 commented 5 years ago

When setting up the platform with bind-web-addrss using a hostname (e.g. https://v2:8443 or http://v2:8090) and the host (v2) is not resolvable to an ip, the platform starts anyways even though the master web service doesn't start successfully.

The following nasty error is printed out to the log.

2019-08-02 15:17:33,674 () volttron.platform.web.master_web_service INFO: Starting web server binding to http://v2:8080.
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 766, in gevent._greenlet.Greenlet.run
  File "/home/osboxes/repos/volttron-develop/env/lib/python3.6/site-packages/gevent/baseserver.py", line 367, in serve_forever
    self.start()
  File "/home/osboxes/repos/volttron-develop/env/lib/python3.6/site-packages/gevent/baseserver.py", line 305, in start
    self.init_socket()
  File "/home/osboxes/repos/volttron-develop/env/lib/python3.6/site-packages/gevent/pywsgi.py", line 1490, in init_socket
    StreamServer.init_socket(self)
  File "/home/osboxes/repos/volttron-develop/env/lib/python3.6/site-packages/gevent/server.py", line 146, in init_socket
    self.socket = self.get_listener(self.address, self.backlog, self.family)
  File "/home/osboxes/repos/volttron-develop/env/lib/python3.6/site-packages/gevent/server.py", line 157, in get_listener
    return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
  File "/home/osboxes/repos/volttron-develop/env/lib/python3.6/site-packages/gevent/server.py", line 256, in _tcp_listener
    sock.bind(address)
OSError: [Errno 99] Cannot assign requested address: ('v2', 8080)
2019-08-02T22:17:33Z <Greenlet at 0x7f3ae9cb8048: <bound method BaseServer.serve_forever of <WSGIServer at 0x7f3ae9ccaf60 address=v2:8080>>> failed with OSError
craig8 commented 5 years ago

This relates to #2101 but is the root cause of the issue of the platform startup.