Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-81846

HTTP Status 403 returned for DB connection error when calling REST APIs

XMLWordPrintable

    Summary

    Bulk rest api calls that fails with DB connection errors is returning a 403 response code to the client.

    1. Content response is even more misleading :

    <html>
    <head>
        <title>Forbidden (403)</title> 
    <!--[if IE]><![endif]-->
    <script type="text/javascript" >
    

    2. Jira application logs indicates DB connection error from too many request within a short period of time.

    ERROR	com.atlassian.plugins.rest.common.error.jersey.ThrowableExceptionMapper	
    Uncaught exception thrown by REST service: org.ofbiz.core.entity.GenericDataSourceException: 
    Unable to establish a connection with the database. (PSQL_TOO_MANY_CONNECTIONS Exception already occurred in this workcontext, skipping next getConnection)
    

    Jira is returning wrong response code along with error message. The external App sends API request to Jira and it failed. Jira returns 403 error while it can return 429 error. If the App receives 403, it will stop operation. If the App receives 429, it should retry sending request again.

    Steps to Reproduce

    1. Call REST APIs in continuous succession

    Expected Results

    If the rate limit is hit, the status 429. Throttling limit state should be returned in headers like here

    Actual Results

    HTTP 403 response code returned with the following content

    <html>
    <head>
        <title>Forbidden (403)</title> 
    <!--[if IE]><![endif]-->
    <script type="text/javascript" >
    

    Workaround

    Pre requisites: using a script to reach the REST API endpoints.
    Steps: Adding a delay mechanism to the using script to minimize the chances of hitting rate limits on the Atlassian REST API.

            Unassigned Unassigned
            rmacalinao Ramon M (Inactive)
            Votes:
            46 Vote for this issue
            Watchers:
            66 Start watching this issue

              Created:
              Updated: