Subscribe Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security. Subscribe

TestRail 500 response code when trying to send_post to API

I am using TestRail integrated with Python to send PyTest results. We are currently using TestRail v5.5 even though there are newer versions available, we have not updated in a while. And i do not have the power to do so. With that being said, here is the command I am trying to send:

tr_data = 'Test Name is: ' + test_title + '\n' + 'Needed Value is: ' + assert_value + '\n' + 'Found Value(s) : ' + str(found_vals) + '\n' + \
                  'Test Results: '
settings.client.send_post('add_result/' + test_idnum, {'status_id': 1, 'comment' : str(tr_data)})

tr_data is the contents of the comment I am trying to attach to the test results using send_post. The error I am met with is

self = <Response [500]>

    def raise_for_status(self):
        """Raises stored :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ''
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode('utf-8')
            except UnicodeDecodeError:
                reason = self.reason.decode('iso-8859-1')
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = u'%s Client Error: %s for url: %s' % (self.status_code, reason, self.url)
    
        elif 500 <= self.status_code < 600:
            http_error_msg = u'%s Server Error: %s for url: %s' % (self.status_code, reason, self.url)
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://testrail.neteng.services.lab.net/index.php?/api/v2/add_result/5518

I have had troubles in the past using the send_post method provided in the API but this is the first time I’ve gotten a 500 error. Usually, sending the status code without comments works, but with this error nothing that I send is being accepted. Any assistance would be greatly appreciated!
I do not have the power to update.