containerbuildsystem/atomic-reactor

build_orchestrate_build: get_current_builds should catch OsbsResponseException

Closed this issue · 3 comments

If one of the workers cannot be contacted the build stops:

2017-03-08 08:43:33,546 - atomic_reactor.plugin - DEBUG - running plugin 'orchestrate_build'
2017-03-08 08:43:33,547 - atomic_reactor.plugin - INFO - running plugin instance with args: '{[...]}'
2017-03-08 08:43:33,548 - atomic_reactor.util - DEBUG - Parent Config ENV: [u'container=docker', u'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
2017-03-08 08:43:33,550 - atomic_reactor.util - INFO - searching for dockerfile in '/tmp/tmpfst87u/rsyslog-docker' (local path None)
2017-03-08 08:43:33,550 - atomic_reactor.util - DEBUG - abs path = '/tmp/tmpfst87u/rsyslog-docker', local path = 'None'
2017-03-08 08:43:33,551 - atomic_reactor.util - DEBUG - Dockerfile found: '/tmp/tmpfst87u/rsyslog-docker/Dockerfile'
2017-03-08 08:43:34,605 - atomic_reactor.plugin - DEBUG - Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/atomic_reactor-1.6.22-py2.7.egg/atomic_reactor/plugin.py", line 239, in run
    plugin_response = plugin_instance.run()
  File "/usr/lib/python2.7/site-packages/atomic_reactor-1.6.22-py2.7.egg/atomic_reactor/plugins/build_orchestrate_build.py", line 219, in run
    [self.choose_cluster(platform) for platform in platforms]
  File "/usr/lib/python2.7/site-packages/atomic_reactor-1.6.22-py2.7.egg/atomic_reactor/plugins/build_orchestrate_build.py", line 164, in choose_cluster
    config.get_enabled_clusters_for_platform(platform)]
  File "/usr/lib/python2.7/site-packages/atomic_reactor-1.6.22-py2.7.egg/atomic_reactor/plugins/build_orchestrate_build.py", line 157, in get_cluster_info
    current_builds = self.get_current_builds(osbs)
  File "/usr/lib/python2.7/site-packages/atomic_reactor-1.6.22-py2.7.egg/atomic_reactor/plugins/build_orchestrate_build.py", line 149, in get_current_builds
    return len(osbs.list_builds(field_selector=field_selector))
  File "build/bdist.linux-x86_64/egg/osbs/api.py", line 41, in catch_exceptions
    return func(*args, **kwargs)
  File "build/bdist.linux-x86_64/egg/osbs/api.py", line 109, in list_builds
    serialized_response = response.json()
  File "build/bdist.linux-x86_64/egg/osbs/http.py", line 380, in json
    raise OsbsResponseException(self.content, self.status_code)
OsbsResponseException: Unauthorized

The plugin should return exclude this worker and move on

I actually think this should be a fatal error. It indicates an incorrect config.yml (and can be fixed there).

It might be an intermittent networking error if one of the workers cannot be reached.

Not sure which exception would be thrown if worker.yaml or osbs.conf are incorrect

Being addressed by #712