We have the following crontab expression executing on our Jira instance every Friday night:
00 03 * * 5 bash /root/rebuild_jira_index.sh >>/root/rebuild_jira_index.log 2>&1
The /root/rebuild_jira_index.sh script performs the following steps:
It appears that the re-index command is not succeeding.
What is your reindex command? Did you try the one mentioned on this page? https://confluence.atlassian.com/jirakb/reindex-jira-server-using-rest-api-via-curl-command-663617587.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You definitelly need to authenticate user (jira-administrator) to invoke this endpoint
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Martin,
I will definitely try that and get back.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But Martin,
It was able to execute the script without any credentials in curl command previously. Is this a new update ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The script :
# shut down jira service
while [[ $(pgrep java) ]]
do
sudo service jira stop
sleep 30
done
# remove index files
# https://confluence.atlassian.com/jirakb/unable-to-rebuild-jira-application-indexes-228623566.html
sudo rm -rf /var/atlassian/application-data/jira/caches/indexesV1/
# start up jira service
sudo service jira start
# wait until jira is ready to serve
# https://jira.atlassian.com/browse/JRASERVER-63928
# https://confluence.atlassian.com/enterprise/confluence-data-center-technical-overview-612959401.html
while [[ ! $(curl -s https://jira.xxxxxxx.com/status | grep RUNNING) ]]
do
sleep 600
done
# trigger full foreground re-index
curl -n -X POST https://jira.xxxxxxxxx.com/rest/api/2/reindex?type=FOREGROUND
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hm that's weird, documentation says that you need to have Admin permission to execute this endpoint. If there is no authentication, there is no permission. Your script also removes index files so I guess FOREGROUND reindex should not work. Can you try to rebuilt index manually after startup? Is foreground reindex option available?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes i am able to do foreground re index manually.
Also i am running this script from the instance instance itself as root.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.