Commit status publisher with GitLab.com returns error 400

Hello everyone,

I ran into strange issue with commit status publisher and I appreciate any help with that.

We use TeamCity Professional 2019.1.1 (build 66192). I set up GitLab.com integration and it says in can connect to GitLab successfully. I set up two build features, e.g. Pull Requests and Commit status publisher, and both of them report that they can connect to GitLab successfully as well. The Pull Requests feature works okay, but Commit status publisher always reports an error that looks like:

Commit Status Publisher HTTP request has failed. Publisher: gitlabStatusPublisher(https://gitlab.com/api/v4/projects/razvitie%2Fapps%2Fapigw/statuses/1b3da894875229b6b8475cdbff0852fa5ac4fc72). HTTP response error, response code: 400, reason: Bad Request

Looking into the logs I see not much more information:

[2019-07-31 12:08:43,776] INFO - jetbrains.buildServer.SERVER - Build removed from queue (started): 3798
[2019-07-31 12:08:43,787] INFO - jetbrains.buildServer.SERVER - Flush queue finished in 33ms, number of builds started: 1
[2019-07-31 12:08:45,277] WARN - blisher.gitlab.GitlabPublisher - {"message":{"target_url":["is blocked: Host cannot be resolved or invalid"]}}
jetbrains.buildServer.commitPublisher.HttpPublisherException: HTTP response error, response code: 400, reason: Bad Request
at jetbrains.buildServer.commitPublisher.gitlab.GitlabPublisher.processResponse(GitlabPublisher.java:150)
at jetbrains.buildServer.commitPublisher.HttpHelper.call(HttpHelper.java:91)
at jetbrains.buildServer.commitPublisher.HttpHelper.post(HttpHelper.java:100)
at jetbrains.buildServer.commitPublisher.HttpBasedCommitStatusPublisher.lambda$post$0(HttpBasedCommitStatusPublisher.java:40)
at jetbrains.buildServer.serverSide.impl.BaseAccessChecker.runWithDisabledCheck(BaseAccessChecker.java:11)
at jetbrains.buildServer.serverSide.impl.SecondaryNodeSecurityManager.runSafeNetworkOperation(SecondaryNodeSecurityManager.java:39)
at jetbrains.buildServer.commitPublisher.HttpBasedCommitStatusPublisher.post(HttpBasedCommitStatusPublisher.java:39)
at jetbrains.buildServer.commitPublisher.gitlab.GitlabPublisher.publish(GitlabPublisher.java:138)
at jetbrains.buildServer.commitPublisher.gitlab.GitlabPublisher.publish(GitlabPublisher.java:128)
at jetbrains.buildServer.commitPublisher.gitlab.GitlabPublisher.publish(GitlabPublisher.java:104)
at jetbrains.buildServer.commitPublisher.gitlab.GitlabPublisher.buildStarted(GitlabPublisher.java:66)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$1.run(CommitStatusPublisherListener.java:63)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$PublisherTaskConsumer.runTask(CommitStatusPublisherListener.java:485)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$BuildPublisherTaskConsumer.runForEveryPublisher(CommitStatusPublisherListener.java:390)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$BuildPublisherTaskConsumer.lambda$accept$0(CommitStatusPublisherListener.java:349)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626)
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 can see the “Could not retrieve the pipeline status” message from the GitLab perspective, but I am not sure if it is related to this problem.

Could it be a misconfiguration at my side or is it a bug in the TeamCity or even GitLab?

Thanks in advance.

1
5 comments

Just updated to version 2019.1.2 (build 66342). Unfortunately, the problem persists.

0
Avatar
Permanently deleted user

Too bad this hasn't been picked up by external search engines earlier; this would have saved me some debugging. :)

After my organization upgraded to GitLab Enterprise Edition 12.0.4-ee we started running into this same issue with TeamCity.

Like Anton I was running TeamCity 2019.1.1, and upgraded to 2019.1.2 after I noticed this started happening. I've confirmed that I can access the site it's trying to post to from the server itself.

0
Avatar
Permanently deleted user

The version of GitLab that was previously installed and working was (Docker Image) 11.10.6-ee.0.

0
Avatar
Permanently deleted user

Looking around at other posts I was reminded of their YouTrack instance; I've submitted this as https://youtrack.jetbrains.com/issue/TW-61439

0
Avatar
Permanently deleted user

Just in case, there's been activity on the issue.

Switching the Server URL in the server's global settings - /admin/admin.html?item=serverConfigGeneral - to a different FQDN allowed GitLab to start updating the build status again. In my case it was already the FQDN for the internal TeamCity web server, but I needed to change it to the IIS proxy's domain name.

0

Please sign in to leave a comment.