How to check the Long Running Tasks Status in Confluence Data Center

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

What are the Long-Running Tasks?

Long-running tasks are jobs that will be responsible for tasks that will generally take more time to be executed and will be running in the background. The most common tasks that are considered long-running ones are the following:

  • Moving multiple pages
  • Deleting user groups
  • Deleting a space (generally a long one)

Once these tasks can take more time to be performed, the chances of facing an issue with the process are higher and it can lead the tasks to be idle/corrupted in which would impact in different operations. Mostly, operations that also rely on long-running tasks and would be interrupted by those.

Cause

Sometimes, some of the long-running tasks will not be tracked from the GUI because the proxy server terminates the browser connections as per the proxy timeout configuration. In such cases, the only option is to track the status of the long-running task status from the logs. 

Confluence has a URL for checking the status of the long-running task. For checking progress there is a link to view the Long Running Tasks <base-url>/admin/longrunningtask.action.

But this page throws an error every time it is opened and never shows any content. The page opens displaying the following error

This issue is tracked in the following bug ticket CONFSERVER-45909 - Long Running Task admin page displays an error.

Solution

Confluence has REST API to check the long running tasks status.

  1. We can run following REST call in the browser after successfull logged into the Confluence. In the below result we could see percentageComplete, that will indicates how much task has been completed. 

    <Confluence-baseurl>rest/api/longtask

  2. We can run the CURL command also, to get the status of the long running tasks. 

    curl -u <username>:<password> -X GET "http://localhost:21311/c71311/rest/api/longtask"
    
    Result:
    
    {
       "results":[
          {
             "id":"fde58ab8-b94a-4904-bf67-427149add8c8",
             "name":{
                "key":"export.space.task.name",
                "args":[
                   
                ]
             },
             "elapsedTime":1614,
             "percentageComplete":100,
             "successful":true,
             "messages":[
                {
                   "translation":"Export complete. Download <a class=\"space-export-download-path\" href=\"/c71311/download/temp/Confluence-space-export-225932-2.xml.zip\">here</a>.",
                   "args":[
                      
                   ]
                }
             ]
          },
          {
             "id":"c46d7510-8a7f-486b-b9a2-b88f0d0fafd5",
             "name":{
                "key":"export.space.task.name",
                "args":[
                   
                ]
             },
             "elapsedTime":42076,
             "percentageComplete":18,
             "successful":true,
             "messages":[
                {
                   "translation":"Writing export",
                   "args":[
                      
                   ]
                }
             ]
          }
       ],
       "start":0,
       "limit":100,
       "size":2,
       "_links":{
          "self":"http://localhost:21311/c71311/rest/api/longtask",
          "base":"http://localhost:21311/c71311",
          "context":"/c71311"
       }
    }



Last modified on Jan 30, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.