How to properly re-index self hosted Jira

Vitalii Malii August 9, 2021

I'm trying to perform re-index Jira, using this topic
https://confluence.atlassian.com/jirakb/reindex-jira-server-using-rest-api-via-curl-command-663617587.html

but i get next output. 

A task could not be found for the given task id

Any variants how to solve this problem ?

I could perform this action by hands, but i can't. I have to implement Jenkins job which will make a curl request, or resort to any other options for automating this process.
Thanks

1 answer

0 votes
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2021

Hi @Vitalii Malii 

Are you sending a GET request? That will try to return details of current indexing job.

You need to POST to start an reindex.

Vitalii Malii August 9, 2021

Hi @Tom Lister no, i'm sending POST request, like described in this knowledge base article https://confluence.atlassian.com/jirakb/reindex-jira-server-using-rest-api-via-curl-command-663617587.html

Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 9, 2021

Hi @Vitalii Malii 

I set off a test POST via PostMan tool as https://new-staging-log.blah.com/rest/api/2/reindex?type=FOREGROUND

and got a json response

{ 
"progressUrl": "/secure/admin/jira/IndexProgress.jspa?taskId=44500",
"currentProgress": 1,
"currentSubTask":
"Currently working on: Issue index",
"type": "FOREGROUND",
"submittedTime": "2021-08-09T15:05:15.097+0000",
"startTime": "2021-08-09T15:05:15.119+0000",
"success": false}

If I check the server an indexing process is running.

So the article is correct.

Via curl I get the same

AST0004352:~ tom.lister$ curl -u tom.lister:password -X POST https://new-staging-log.blah.com/rest/api/2/reindex?type=FOREGROUND

{"progressUrl":"/secure/admin/jira/IndexProgress.jspa?taskId=44500","currentProgress":4,"currentSubTask":"Currently working on: Issue index","type":"FOREGROUND","submittedTime":"2021-08-09T15:05:15.097+0000","startTime":"2021-08-09T15:05:15.119+0000","success":false}AST0004352:~ tom.lister$

AST0004352:~ tom.lister$

I'm think something subtly different about your curl call.
have you got screenshots to share?

Suggest an answer

Log in or Sign up to answer