Forums

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

GitLab merge requests not displayed anymore in issues

Thomas Lier October 17, 2018

Hi,

We are using GIT Integration for JIRA plugin with our OnPremise GitLab CE server.

On each JIRA issu, we have in the "GIT Commits" tab all commits that contains the ticket number in comment => OK.

On the right side on the issue, just under the Agile section, there is the "Git Source Code Section". In that section, we can see all branches referenced to this ticket and also the number of commits.

My issue is that even if we have an open MergeRequest for this issue : the MR is not referenced in that section.

We only see the button to create a new MR.

 

Does anyone has the same issue ?

Thanks,

Thomas

1 answer

1 accepted

1 vote
Answer accepted
Mark L. Smith
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2018

Hi Thomas,

Is this Jira Server or Jira Cloud?

Thomas Lier October 17, 2018

Hi Mark,

It is JIRA Server (JIRA Software 7.9.2).

Mark L. Smith
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2018

On your "Manage Repos" screen, is everything green?

Thomas Lier October 17, 2018

Yes, everything is Green.

Indexing seems to be fine as I can see latests commits on the "Git Commit" tab in JIRA issues. All branches are also corretly displayed on the "GIT Source Code" section.

Only MR are not displayed ...

Mark L. Smith
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2018

Another question... what version of GitLab CE are you using?

 

You can enable logging for com.bigbrassband.jira. package.

We have INFO log messages such as:

Skipping merge request check for Repo: [repoId] =
Can not get list of merge requests for repo: [repoId] =
etc..

Thomas Lier October 18, 2018

Hi,

Thanks a lot. Indeed there are HTTP 500 errors in logs.

 

It seems like GitLab does not like the per_page=100 parameter.
https://our_git_url/api/v4/projects/91/merge_requests?per_page=100
=> KO: HTTP 500
https://our_git_url/api/v4/projects/91/merge_requests?per_page=70
=> OK


Maybe we have now reached a number of MR that cause error in GitLab API.
Is there a way to limit the page size on JIRA plugin ? 

Our GitLab instance version is : 11.0.2

Regards,
Thomas

2018-10-18 10:59:17,964 bigbrassband-gitplugin-RevisionIndexerImpl:thread - 0 WARN ServiceRunner [c.b.j.g.s.indexer.pullrequests.PullRequestIndexManagerImpl] Can not get list of merge requests for repo: https://our_git_url/
patch/app.git
com.bigbrassband.jira.git.exceptions.external.WrappedIntegrationAPIException: External service error
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl$SingleGitManagerWithPullReqIndex.getPullRequests(PullRequestIndexManagerImpl.java:108)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl$SingleGitManagerWithPullReqIndex.getPullRequests(PullRequestIndexManagerImpl.java:66)
at com.bigbrassband.common.indexer.sources.RepoSourceWithPullRequestIndex$1.onUuidFolder(RepoSourceWithPullRequestIndex.java:49)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PlainSmartFolder.visitUuidDirectories(PlainSmartFolder.java:26)
at com.bigbrassband.common.indexer.sources.RepoSourceWithPullRequestIndex.updatePullRequests(RepoSourceWithPullRequestIndex.java:37)
at com.bigbrassband.common.indexer.PullreqIndexer.updatePullRequests(PullreqIndexer.java:158)
at com.bigbrassband.common.indexer.PullreqIndexer.indexPullRequests(PullreqIndexer.java:93)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl.updatePullReqIndex(PullRequestIndexManagerImpl.java:181)
at com.bigbrassband.jira.git.services.indexer.revisions.GitPluginIndexManagerImpl.updateIndexImpl(GitPluginIndexManagerImpl.java:446)
at com.bigbrassband.jira.git.services.indexer.revisions.GitPluginIndexManagerImpl.updateIndex(GitPluginIndexManagerImpl.java:486)
at com.bigbrassband.jira.git.services.indexer.revisions.RevisionIndexerImpl$1.doRun(RevisionIndexerImpl.java:358)
at com.bigbrassband.jira.git.services.indexer.revisions.RevisionIndexerImpl$QueueEntry.run(RevisionIndexerImpl.java:163)
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: java.lang.Error: org.gitlab.api.GitlabAPIException: {"message":"500 Internal Server Error"}
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:298)
at org.gitlab.api.http.GitlabHTTPRequestor$1.hasNext(GitlabHTTPRequestor.java:252)
at org.gitlab.api.http.GitlabHTTPRequestor.getAll(GitlabHTTPRequestor.java:199)
at org.gitlab.api.GitlabAPI.getMergeRequests(GitlabAPI.java:1303)
at com.bigbrassband.common.integration.GitLabApiPool$GitLabApiWrapper$3.call(GitLabApiPool.java:473)
at com.bigbrassband.common.integration.GitLabApiPool$GitLabApiWrapper.doSafely(GitLabApiPool.java:245)
at com.bigbrassband.common.integration.GitLabApiPool$GitLabApiWrapper.getMergeRequests(GitLabApiPool.java:470)
at com.bigbrassband.jira.git.services.integration.gitlab.CachedGitLabApi.getMergeRequests(CachedGitLabApi.java:131)
at com.bigbrassband.jira.git.services.integration.gitlab.GitLabApiService$GitLabRepoApi.getMergeRequests(GitLabApiService.java:97)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl$SingleGitManagerWithPullReqIndex.getPullRequests(PullRequestIndexManagerImpl.java:84)
... 16 more
Caused by: org.gitlab.api.GitlabAPIException: {"message":"500 Internal Server Error"}
at org.gitlab.api.http.GitlabHTTPRequestor.handleAPIError(GitlabHTTPRequestor.java:485)
at org.gitlab.api.http.GitlabHTTPRequestor.access$3(GitlabHTTPRequestor.java:471)
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:295)
... 26 more
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: https://our_git_url/api/v4/projects/91/merge_requests?per_page=100
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gitlab.api.http.GitlabHTTPRequestor.parse(GitlabHTTPRequestor.java:443)
at org.gitlab.api.http.GitlabHTTPRequestor.access$2(GitlabHTTPRequestor.java:437)
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:291)
... 26 more

Thomas Lier October 18, 2018

Hi,

Thanks a lot. Indeed there are HTTP 500 errors in logs.

 

It seems like GitLab does not like the per_page=100 parameter.
https://our_git_url/api/v4/projects/91/merge_requests?per_page=100
=> KO: HTTP 500
https://our_git_url/api/v4/projects/91/merge_requests?per_page=70
=> OK


Maybe we have now reached a number of MR that cause error in GitLab API.
Is there a way to limit the page size on JIRA plugin ? 

Our GitLab instance version is : 11.0.2

Regards,
Thomas

2018-10-18 10:59:17,964 bigbrassband-gitplugin-RevisionIndexerImpl:thread - 0 WARN ServiceRunner [c.b.j.g.s.indexer.pullrequests.PullRequestIndexManagerImpl] Can not get list of merge requests for repo: https://our_git_url/
patch/app.git
com.bigbrassband.jira.git.exceptions.external.WrappedIntegrationAPIException: External service error
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl$SingleGitManagerWithPullReqIndex.getPullRequests(PullRequestIndexManagerImpl.java:108)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl$SingleGitManagerWithPullReqIndex.getPullRequests(PullRequestIndexManagerImpl.java:66)
at com.bigbrassband.common.indexer.sources.RepoSourceWithPullRequestIndex$1.onUuidFolder(RepoSourceWithPullRequestIndex.java:49)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PlainSmartFolder.visitUuidDirectories(PlainSmartFolder.java:26)
at com.bigbrassband.common.indexer.sources.RepoSourceWithPullRequestIndex.updatePullRequests(RepoSourceWithPullRequestIndex.java:37)
at com.bigbrassband.common.indexer.PullreqIndexer.updatePullRequests(PullreqIndexer.java:158)
at com.bigbrassband.common.indexer.PullreqIndexer.indexPullRequests(PullreqIndexer.java:93)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl.updatePullReqIndex(PullRequestIndexManagerImpl.java:181)
at com.bigbrassband.jira.git.services.indexer.revisions.GitPluginIndexManagerImpl.updateIndexImpl(GitPluginIndexManagerImpl.java:446)
at com.bigbrassband.jira.git.services.indexer.revisions.GitPluginIndexManagerImpl.updateIndex(GitPluginIndexManagerImpl.java:486)
at com.bigbrassband.jira.git.services.indexer.revisions.RevisionIndexerImpl$1.doRun(RevisionIndexerImpl.java:358)
at com.bigbrassband.jira.git.services.indexer.revisions.RevisionIndexerImpl$QueueEntry.run(RevisionIndexerImpl.java:163)
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: java.lang.Error: org.gitlab.api.GitlabAPIException: {"message":"500 Internal Server Error"}
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:298)
at org.gitlab.api.http.GitlabHTTPRequestor$1.hasNext(GitlabHTTPRequestor.java:252)
at org.gitlab.api.http.GitlabHTTPRequestor.getAll(GitlabHTTPRequestor.java:199)
at org.gitlab.api.GitlabAPI.getMergeRequests(GitlabAPI.java:1303)
at com.bigbrassband.common.integration.GitLabApiPool$GitLabApiWrapper$3.call(GitLabApiPool.java:473)
at com.bigbrassband.common.integration.GitLabApiPool$GitLabApiWrapper.doSafely(GitLabApiPool.java:245)
at com.bigbrassband.common.integration.GitLabApiPool$GitLabApiWrapper.getMergeRequests(GitLabApiPool.java:470)
at com.bigbrassband.jira.git.services.integration.gitlab.CachedGitLabApi.getMergeRequests(CachedGitLabApi.java:131)
at com.bigbrassband.jira.git.services.integration.gitlab.GitLabApiService$GitLabRepoApi.getMergeRequests(GitLabApiService.java:97)
at com.bigbrassband.jira.git.services.indexer.pullrequests.PullRequestIndexManagerImpl$SingleGitManagerWithPullReqIndex.getPullRequests(PullRequestIndexManagerImpl.java:84)
... 16 more
Caused by: org.gitlab.api.GitlabAPIException: {"message":"500 Internal Server Error"}
at org.gitlab.api.http.GitlabHTTPRequestor.handleAPIError(GitlabHTTPRequestor.java:485)
at org.gitlab.api.http.GitlabHTTPRequestor.access$3(GitlabHTTPRequestor.java:471)
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:295)
... 26 more
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: https://our_git_url/api/v4/projects/91/merge_requests?per_page=100
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gitlab.api.http.GitlabHTTPRequestor.parse(GitlabHTTPRequestor.java:443)
at org.gitlab.api.http.GitlabHTTPRequestor.access$2(GitlabHTTPRequestor.java:437)
at org.gitlab.api.http.GitlabHTTPRequestor$1.fetch(GitlabHTTPRequestor.java:291)
... 26 more

Mark L. Smith
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2018

500 means "internal server error"...

In your example case, what happens when you go to the next page: 

https://our_git_url/api/v4/projects/91/merge_requests?per_page=70&page=2

Thomas Lier October 18, 2018

Hi Mark,

I have just found our problem.

The issue is that some of our MR are KO (also HTTP 500 even with GitLab WebUI) because they are still open while target branch does not exist anymore.

I will clean those MR (by creating again the target branch in order to be able to close the MR) and then API will work again.

I then assume that the indexing on Git Integration side will be OK again.

Thanks for your help !!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events