Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Contact Support
GitKraken Status  

Pull request index error — org.json.JSONException

Problem

Pull requests (or merge requests in GitLab) do not index and the pull request index (pullreqsIndexInfo.json inside jira/home/caches/indexes/plugins/jira-git-pull-requests) is broken.

Example locations:

jira/home/caches/indexes/plugins/jira-git-pull-requests/2/pullreqs/pullreqsIndexInfo.json

jira/home/caches/indexes/plugins/jira-git-pull-requests/3/pullreqs/pullreqsIndexInfo.json

 

Diagnosis

Jira admins will see a message similar to the one below in the Jira /application-logs/atlassian-jira.log:

2018/01/16 22:30:20 Can't do reindex of merge requests java.io.IOException: Can't do reindex of merge requests
    at com.xiplink.jira.git.revisions.PullRequestIndexManagerImpl.pullRequestException(PullRequestIndexManagerImpl.java:157)
    at com.xiplink.jira.git.revisions.PullRequestIndexManagerImpl.updatePullReqIndex(PullRequestIndexManagerImpl.java:151)
    at com.xiplink.jira.git.revisions.GitPluginIndexManagerImpl.updateIndexImpl(GitPluginIndexManagerImpl.java:409)
    at com.xiplink.jira.git.revisions.GitPluginIndexManagerImpl.updateIndex(GitPluginIndexManagerImpl.java:431)
    at com.xiplink.jira.git.revisions.RevisionIndexerImpl$1.doRun(RevisionIndexerImpl.java:300)
    at com.xiplink.jira.git.revisions.RevisionIndexerImpl$QueueEntry.run(RevisionIndexerImpl.java:123)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
    at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
    at org.json.JSONObject.<init>(JSONObject.java:194)
    at org.json.JSONObject.<init>(JSONObject.java:321)
    at com.bigbrassband.common.indexer.PullreqIndexer.indexPullRequests(PullreqIndexer.java:60)
    at com.xiplink.jira.git.revisions.PullRequestIndexManagerImpl.updatePullReqIndex(PullRequestIndexManagerImpl.java:149)
    ... 9 more

 

Solutions

This issue should be resolved in v3.5.0.2+. If similar issue is found in later versions, please contact us at [email protected].

  1. Verify that the Git Integration for Jira app does not have a reindex process in progress.

  2. Disable the Git Integration for Jira app in Jira Administration ➜ Manage apps.

  3. Remove the folder /jira/home/caches/indexes/plugins/jira-git-pull-requests/ from the file system.

  4. Enable the Git Integration for Jira app in Jira Administration ➜ Manage apps.

  5. Start a reindex of the Git Integration for Jira app.

 

Resolution

jira/home/caches/indexes/plugins/jira-git-pull-requests/ will be recreated.

Contact Us
If you still have a question – reach out to our Support Desk or email us at [email protected].

 

More articles about troubleshooting, workarounds and solutions

Why I am getting the error, “git-upload-pack not permitted”?

Avoid OutOfMemory exceptions by configuring or memory allocation with Jira to accommodate large repositories

Cannot auto-deploy some tracked repositories: Specified origin is incorrect or not supported

Connection Reset when Accessing the Database

“Dangerous use of multiple connections” error on local database

Duplicate entry 0 for key PRIMARY exceptions in log

Error while reindexing – Java heap space / Object too large, rejecting the pack

Error creating git branches and also using NFS

Fix performance issues for nested cloned repositories with enabled Git Service Permissions mode

Fixing reindex issues using Indexing Queue Viewer

Gitolite integration: Why the Git integration app not see the master branch?

Health Check: Database Collation

Indexing error – Too many open files

Installation fails when installing manually

Jira index error: IndexNotFoundException: no segments* file found

Malformed input or input contains unmappable characters

Personal access token failing Azure DevOps integration with Not Authorized error

Problems with shared home on Azure Storage

Pull request index error: org.json.JSONException (this page)

Repositories missing from Azure DevOps integration

“Service proxy has been destroyed” exceptions in log

SQLException ‘Incorrect string value’ in merge requests

SSH key file format is invalid

TFS – Not authorized exception when Jira works thru proxy

Unexpected exception parsing XML document from URL error in log

Why don’t I see the Create Branch or Pull Request features?

Your token has not been granted the required scopes

Have feedback about this article? Did we miss something? Let us know!
On this page