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

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

    XMLWordPrintable

Details

    Description

      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" >
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rmacalinao Ramon M
              Votes:
              45 Vote for this issue
              Watchers:
              64 Start watching this issue

              Dates

                Created:
                Updated: