Actions
action #109815
closedQA (public) - coordination #91646: [saga][epic] SUSE Maintenance QA workflows with fully automated testing, approval and release
QA (public) - coordination #109818: [epic] qa-maintenance/openQAbot improvements
Add retry for HTTP requests in openQABot where missing
Description
Observation¶
It looks like openQABot can still fail when receiving a 500 response without retry:
++ ./oqabot.py --verbose --only-mr --metadata /etc/openqabot/mr.yml
INFO: <Response [500]> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Server error!</title>
<link rev="made" href="mailto:smash-devel@suse.de" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}
/*]]>*/--></style>
</head>
<body>
<h1>Server error!</h1>
<p>
The server encountered an internal error and was
unable to complete your request. Either the server is
overloaded or there was an error in a CGI script.
</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:smash-devel@suse.de">webmaster</a>.
</p>
<h2>Error 500</h2>
<address>
<a href="/">smelt.suse.de</a><br />
<span>Apache</span>
</address>
</body>
</html>
ERROR: Error getting requests: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/builds/qa-maintenance/openQABot/openqabot/update/mr.py", line 128, in _get_mr_requests
mr = response.json()
File "/usr/lib/python3.6/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR:root:Something bad happended during reading MR data from SMELT/IBS: Expecting value: line 1 column 1 (char 0)
(https://gitlab.suse.de/qa-maintenance/openQABot/-/jobs/923109)
Acceptance criteria¶
- AC1: openQABot retries again several times (waiting a reasonable time between the retries) before giving up when doing requests to external services.
Actions