DiUS / build-lights

DiUS Build Lights
http://buildlights.dius.com.au
Other
7 stars 3 forks source link

light-controller: handle exception if cannot reach CI server #12

Open jasaw opened 7 years ago

jasaw commented 7 years ago

Pi was configured to talk to Jenkins CI, but getting connection refused exception and dies.

Traceback (most recent call last): File "/storage/build-lights/light-controller/light_controller.py", line 162, in lc = LightController() File "/storage/build-lights/light-controller/light_controller.py", line 112, in init self.ci = importlib.import_module('ci_server.' + ci_server_type).Source(ci_server_conf) File "/storage/build-lights/light-controller/ci_server/jenkins.py", line 26, in init self.J = Jenkins(url) File "/usr/local/lib/python2.7/dist-packages/jenkinsapi/jenkins.py", line 59, in init JenkinsBase.init(self, baseurl, poll=not lazy) File "/usr/local/lib/python2.7/dist-packages/jenkinsapi/jenkinsbase.py", line 35, in init self.poll() File "/usr/local/lib/python2.7/dist-packages/jenkinsapi/jenkinsbase.py", line 59, in poll data = self._poll(tree=tree) File "/usr/local/lib/python2.7/dist-packages/jenkinsapi/jenkins.py", line 64, in _poll if not tree else tree) File "/usr/local/lib/python2.7/dist-packages/jenkinsapi/jenkinsbase.py", line 79, in get_data response = requester.get_url(url, params) File "/usr/local/lib/python2.7/dist-packages/jenkinsapi/utils/requester.py", line 109, in get_url return requests.get(self._update_url_scheme(url), requestKwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in get return request('get', url, kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 49, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send r = adapter.send(request, kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 407, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', error(111, 'Connection refused'))

surpher commented 7 years ago

Pi was configured and tested against a local Jenkins CI in local network. Pi was then moved to a new location in a different network with limited connectivity where the configured Jenkins CI server is not reachable anymore. When booting up the Pi, light_controller and light_controller_server fail to launch (as evident from Supervisor dashboard ..:9001). Restarting the controllers through Supervisor dashboard shows 500 Error.