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
job = japi.build_job(job_name, **params)
while not job.get_build(): # this line throws exception
time.sleep(1)
build = job.get_build()
and it occasionally throws an exception like this: Traceback (most recent call last): . . . in run_job while not job.get_build(): File "/opt/scotty/bazel_install/execroot/__main__/bazel-out/k8-fastbuild/bin/middleware_v2/jenkins/replay_trend_branches.runfiles/dd_py_deps_api4jenkins/site-packages/api4jenkins/queue.py", line 55, in get_build self._build = self._new_item( File "/opt/scotty/bazel_install/execroot/__main__/bazel-out/k8-fastbuild/bin/middleware_v2/jenkins/replay_trend_branches.runfiles/dd_py_deps_api4jenkins/site-packages/api4jenkins/item.py", line 67, in _new_item return new_item(self.jenkins, module, item) File "/opt/scotty/bazel_install/execroot/__main__/bazel-out/k8-fastbuild/bin/middleware_v2/jenkins/replay_trend_branches.runfiles/dd_py_deps_api4jenkins/site-packages/api4jenkins/item.py", line 38, in func class_name = delimiter.split(item['_class'])[-1] TypeError: 'NoneType' object is not subscriptable
The text was updated successfully, but these errors were encountered:
There is nothing wrong on the Jenkins server side. Perhaps the client is making some assumptions that may not always hold.
I have worked around this issue by wrapping the job.get_build() call in a try / except block in a separate function.
I have code that looks like this:
and it occasionally throws an exception like this:
Traceback (most recent call last): . . . in run_job while not job.get_build(): File "/opt/scotty/bazel_install/execroot/__main__/bazel-out/k8-fastbuild/bin/middleware_v2/jenkins/replay_trend_branches.runfiles/dd_py_deps_api4jenkins/site-packages/api4jenkins/queue.py", line 55, in get_build self._build = self._new_item( File "/opt/scotty/bazel_install/execroot/__main__/bazel-out/k8-fastbuild/bin/middleware_v2/jenkins/replay_trend_branches.runfiles/dd_py_deps_api4jenkins/site-packages/api4jenkins/item.py", line 67, in _new_item return new_item(self.jenkins, module, item) File "/opt/scotty/bazel_install/execroot/__main__/bazel-out/k8-fastbuild/bin/middleware_v2/jenkins/replay_trend_branches.runfiles/dd_py_deps_api4jenkins/site-packages/api4jenkins/item.py", line 38, in func class_name = delimiter.split(item['_class'])[-1] TypeError: 'NoneType' object is not subscriptable
The text was updated successfully, but these errors were encountered: