Gtilab integration with TeamCity 2019.1

Hi,

I followed the video guide at https://youtu.be/aE150gCfQyI but I'm having problems when I click Test connection on Pull request build feature configuration. The error is:

Pull request information retrieval I/O error: Pull request information retrieval failure due to HTTP error, status code 404: Not Found
 
When I ignore the test, more detailed info can be seen at build configuration:
 
Failed to retrieve pull request information for branch refs/merge-requests/1/head; Exception: java.io.IOException: Pull request information retrieval failure due to HTTP error, status code 404: Not Found 
stack trace:
java.io.IOException: Pull request information retrieval failure due to HTTP error, status code 404: Not Found
at jetbrains.buildServer.pullRequests.impl.BasePullRequestProvider$AbstractHttpResponseProcessor.processResponse(BasePullRequestProvider.java:58)
at jetbrains.buildServer.pullRequests.impl.gitlab.GitLabPullRequestProvider$GitLabResponseProcessorSinglePR.processResponse(GitLabPullRequestProvider.java:164)
at jetbrains.buildServer.pullRequests.impl.HttpHelper$2.consume(HttpHelper.java:59)
at jetbrains.buildServer.util.HTTPRequestBuilder$ApacheClient43RequestHandler.doRequest(HTTPRequestBuilder.java:71)
at jetbrains.buildServer.pullRequests.impl.HttpHelper.call(HttpHelper.java:77)
at jetbrains.buildServer.pullRequests.impl.HttpHelper.get(HttpHelper.java:110)
at jetbrains.buildServer.pullRequests.impl.gitlab.GitLabPullRequestProvider.lambda$fetchPullRequestInfo$2(GitLabPullRequestProvider.java:145)
at jetbrains.buildServer.serverSide.impl.BaseAccessChecker.runWithDisabledCheck(BaseAccessChecker.java:32)
at jetbrains.buildServer.serverSide.impl.SecondaryNodeSecurityManager.runSafeNetworkOperation(SecondaryNodeSecurityManager.java:16)
at jetbrains.buildServer.pullRequests.impl.gitlab.GitLabPullRequestProvider.fetchPullRequestInfo(GitLabPullRequestProvider.java:144)
at jetbrains.buildServer.pullRequests.impl.gitlab.GitLabPullRequestProvider.getPullRequest(GitLabPullRequestProvider.java:78)
at jetbrains.buildServer.pullRequests.impl.PullRequestManagerImpl.retrievePullRequest(PullRequestManagerImpl.java:542)
at jetbrains.buildServer.pullRequests.impl.PullRequestManagerImpl.access$000(PullRequestManagerImpl.java:34)
at jetbrains.buildServer.pullRequests.impl.PullRequestManagerImpl$5.run(PullRequestManagerImpl.java:501)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:76)
at jetbrains.buildServer.util.ExceptionUtil$1.run(ExceptionUtil.java:41)
at jetbrains.buildServer.serverSide.impl.executors.SimpleExecutorServices$RunnableWrapper.run(SimpleExecutorServices.java:3)
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:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
 
I found nothing relevant in teamcity logs (but maybe I just did not look into the right file). However this can be found in gitlab logs:
 
{
"time":"2019-06-04T07:49:57.463Z",
"severity":"INFO",
"duration":0.61,
"db":0,
"view":0.61,
"status":404,
"method":"GET",
"path":"/api/v4/projects/project/server%2Fcitest/merge_requests",
"params":[

],
"host":"gitlab.icewarp.com",
"ip":"185.138.223.88, 185.138.223.88",
"ua":"TeamCity Server 2019.1 (build 65998)",
"route":"/api/:version/*path",
"queue_duration":4.34,
"gitaly_calls":0,
"correlation_id":"01q6Rg3kcu1"
}
 
The "path" /api/v4/projects/project/server%2Fcitest/merge_requests really returns 404, but replacing the slash after project (which is a gitlab group) by %2F retrieves some data - /api/v4/projects/project%2Fserver%2Fcitest/merge_requests.
 
Is it possible it is a bug or do you have any clue what could be wrong with my configuration?
 
Regards
 
0
5 comments

Hi Pavel,

Thanks for reporting this.

Yes this indeed looks like a bug. Is `project` a group and `server` a subgroup of it, while `citest` is a project in that subgroup?


0
Avatar
Permanently deleted user

Hi,

yes, the repository structure is exactly as you say. I tried to create project/citest2 for test and Test connection succeeds for it. So it really seems like a problem with subgroups.

Pavel

 

0

We have reproduced the issue and are working on fixing it now. You can watch its progress here: https://youtrack.jetbrains.com/issue/TW-60731
The fixed version will be released with TeamCity 2019.1.1 but we will probably be able to provide you with an updated version of the plugin itself earlier than that. 

0
Avatar
Permanently deleted user

That would be perfect, thanks.

0

Hi Pavel, I have attached a version of the plugin with this issue fixed to that issue in our issue tracker. You can download it to your plugins directory and try if it fixes the issue in your case. Of course when it comes to production installations we cannot recommend using this version of the plugin as another fully verified version of it with this and some other fixes will be released as part of TeamCity 2019.1.1 bugfix release. 

0

Please sign in to leave a comment.