You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the API call fails, e.g. due to change being deleted, or buildbot not having access to that project, it throws an exception:
2024-05-15 10:12:38+0000 [-] while polling for changes
Traceback (most recent call last):
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 913, in errback
self._startRunCallbacks(fail)
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 981, in _startRunCallbacks
self._runCallbacks()
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1075, in _runCallbacks
current.result = callback( # type: ignore[misc]
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1946, in _gotResultInlineCallbacks
_inlineCallbacks(r, gen, status, context)
--- <exception caught here> ---
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1996, in _inlineCallbacks
result = context.run(
File "/buildbot_venv/lib/python3.9/site-packages/twisted/python/failure.py", line 519, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/buildbot_venv/lib/python3.9/site-packages/buildbot/changes/gerritchangesource.py", line 566, in poll
yield self.lineReceived(line)
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1996, in _inlineCallbacks
result = context.run(
File "/buildbot_venv/lib/python3.9/site-packages/twisted/python/failure.py", line 519, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/buildbot_venv/lib/python3.9/site-packages/buildbot/changes/gerritchangesource.py", line 570, in eventReceived
res = yield super().eventReceived(event)
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 1996, in _inlineCallbacks
result = context.run(
File "/buildbot_venv/lib/python3.9/site-packages/twisted/python/failure.py", line 519, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/buildbot_venv/lib/python3.9/site-packages/buildbot/changes/gerritchangesource.py", line 254, in addChangeFromEvent
files = yield self.getFiles(
File "/buildbot_venv/lib/python3.9/site-packages/twisted/internet/defer.py", line 2000, in _inlineCallbacks
result = context.run(gen.send, result)
File "/buildbot_venv/lib/python3.9/site-packages/buildbot/changes/gerritchangesource.py", line 580, in getFiles
res = res.splitlines()[1].decode('utf8') # the first line of every response is `)]}'`
builtins.IndexError: list index out of range
This causes buildbot to loop over the event log again and again, with no easy way to get out of it except to disable get_files (and whatever code needed that information).
When looking at the code the problem is obvious:
@defer.inlineCallbacks
def getFiles(self, change, patchset):
res = yield self._http.get(f"/changes/{change}/revisions/{patchset}/files/")
res = yield res.content()
res = res.splitlines()[1].decode('utf8') # the first line of every response is `)]}'`
return list(json.loads(res))
Probably should return gracefully ("unknown") when res is shorter than 2 lines.
The text was updated successfully, but these errors were encountered:
If the API call fails, e.g. due to change being deleted, or buildbot not having access to that project, it throws an exception:
This causes buildbot to loop over the event log again and again, with no easy way to get out of it except to disable get_files (and whatever code needed that information).
When looking at the code the problem is obvious:
Probably should return gracefully ("unknown") when res is shorter than 2 lines.
The text was updated successfully, but these errors were encountered: