Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: Could not parse the result of the push health as json. Url: https://treeherder.mozilla.org/api/pr... #360

Open
sentry-io bot opened this issue Apr 11, 2024 · 1 comment
Labels
Bug Something isn't working P2 Medium Priority

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 11, 2024

Sentry Issue: UPDATEBOT-PROD-1T

JSONDecodeError: Expecting value: line 2 column 1 (char 1)
  File "__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Expecting value: line 2 column 1 (char 1)
  File "apis/taskcluster.py", line 390, in get_push_health
    push_health = r.json()

Exception: Could not parse the result of the push health as json. Url: https://treeherder.mozilla.org/api/project/try/push/health/?revision=a6955c475a24c2acc1f6804ad1bf5713c8c0b0d9 Response:

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>

(5 additional frame(s) were not displayed)
...
  File "/builds/worker/updatebot/tasktypes/vendoring.py", line 559, in _process_job_details_for_awaiting_retrigger_results
    no_build_failures, results, comment_lines = self._get_comments_on_push(library, existing_job)
  File "components/logging.py", line 38, in func_wrapper
    ret = func(*args, **kwargs)
  File "/builds/worker/updatebot/tasktypes/vendoring.py", line 307, in _get_comments_on_push
    this_push_health = self.taskclusterProvider.get_push_health(t.revision)
  File "components/logging.py", line 38, in func_wrapper
    ret = func(*args, **kwargs)
  File "apis/taskcluster.py", line 392, in get_push_health
    raise Exception("Could not parse the result of the push health as json. Url: %s Response:\n%s" % (push_health_url, r.text))

It looks like we expect JSON and do not properly handle sever errors. We should find out how we can (silently) retrigger this request in case of transient server errors. Distinguishing between transient and permanent server errors is likely going to be a bit of an issue that I'm not entirely sure how to tackle. Maybe we should keep track of retries until we reach a maximum?

@sentry-io sentry-io bot added the Bug Something isn't working label Apr 11, 2024
@mozfreddyb mozfreddyb added the P2 Medium Priority label Apr 11, 2024
@mozfreddyb
Copy link
Collaborator

I don't think this should be high priority, but it's worth fixing for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working P2 Medium Priority
Projects
None yet
Development

No branches or pull requests

1 participant