Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Concecutive API calls generate random Internal Server Error 500 org.springframework.transaction

sebastien.gillet
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 4, 2022
We get the following errors while calling the detailed Confluence Cloud API endpoints in batch (tens of calls).
  • The calls are made consecutively (errors occurs whatever the delay between 200ms and 5000ms between each call).
  • The errors are intermittent: about 50-70% of calls end up with one or the other of the errors.
  • The errors occur unevenly, and don't seem to have any logic regarding what call works or not. For instance, in a process deleting all the children Pages of a parent Page, about half of the calls will fail on first execution (deleting about half of the Pages), then about 50% on the remaining pages on the 2nd second call, and so on until all the remaining pages are dseleted.
  • On the POST endpoint below, about 75% of the calls fail.
Error 1:
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
Error 2:
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is net.sf.hibernate.JDBCException: Unable to acquire JDBC Connection
REST API calls generating a random mix of these errors:
axios.default.delete(`[our domain]/wiki/rest/api/content/${childPage.id}`,
   {
    headers: {
      "Authorization": `Basic ${TOKEN}`,
      "Accept": 'application/json',
      "Content-Type": 'application/json'
    }
  });
axios.default.post('[our domain]/wiki/rest/api/content',
  reqBodyData,
  {
    headers: {
      "Authorization": `Basic ${TOKEN}`,
      "Accept": 'application/json',
      "Content-Type": 'application/json'
    }
  });
Please can you advise what triggers those errors and how to run these APIs, at least consecutively, in an efficient manner (i.e. without too much delay between each call), without getting these errors?

1 answer

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 4, 2022

Hi @sebastien.gillet

Check if you are using any specific plugins in the pages that causes issues: https://community.atlassian.com/t5/Confluence-questions/Error-Transaction-rolled-back-because-it-has-been-marked-as/qaq-p/1181849

Also, create a ticket with atlassian support and ask them to analyze the logs. 

Regards

sebastien.gillet
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2022

Thank you @Fabian Lim 
We have reported the issue to Atlassian Support and investigating.
We will post back here when a solution is found.

Robert Gottesman
Contributor
January 26, 2022

I am seeing the same random errors when adding new pages via the Confluence Cloud REST API.  The specific HTTP 500 message

"org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only"

My case might be slightly different than @sebastien.gillet as the page is actually added hence this seems to be a False/Negative.  As mentioned above, these errors are plentiful and inconsistent.

I will be posting this to Atlassian support as well.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events