jenkinsci / gitlab-branch-source-plugin

A Jenkins Plugin for GitLab Multibranch Pipeline jobs and Folder Organization
https://plugins.jenkins.io/gitlab-branch-source
MIT License
121 stars 88 forks source link

Numeric value out of range of int when requesting the GitLab Pipeline Status #178

Closed aixigo-cschreuer closed 2 years ago

aixigo-cschreuer commented 2 years ago

Jenkins and plugins versions report

My perfectly running Multibranch Configuration breaks since last week due to a numeric value out of range error / integer overflow when setting the ID-Property of the CommitStatus through the GitLabPipelineStatusNotifier. With every running (Jenkins)-build of my MR the numeric value increases, but i cannot determine the origin of the numeric value. Are there changes in by gitlab in the API ?

Stacktrace:

GitLab Pipeline Status] Notifying merge request build status: FAILED BNP-Digital-Advisory-gitlab-pull-request-created-build-and-test-check-2/MR-67: There was a failure building this commit
hudson.remoting.ProxyException: com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (2169692901) out of range of int (-2147483648 - 2147483647)
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 17]
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportInputCoercion(ParserMinimalBase.java:601)
    at com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowInt(ParserMinimalBase.java:570)
    at com.fasterxml.jackson.core.base.ParserBase.convertNumberToInt(ParserBase.java:889)
    at com.fasterxml.jackson.core.base.ParserBase._parseIntValue(ParserBase.java:802)
    at com.fasterxml.jackson.core.base.ParserBase.getIntValue(ParserBase.java:646)
    at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:472)
    at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:452)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
Caused: hudson.remoting.ProxyException: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (2169692901) out of range of int (-2147483648 - 2147483647)
 at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 17] (through reference chain: org.gitlab4j.api.models.CommitStatus["id"])
    at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:397)
    at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:356)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1714)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1682)
    at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:977)
    at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:814)
    at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:233)
    at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:212)
    at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:132)
    at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1072)
    at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:882)
Caused: hudson.remoting.ProxyException: javax.ws.rs.ProcessingException: Error reading entity from input stream.
    at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:897)
    at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:816)
    at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:298)
    at org.glassfish.jersey.client.InboundJaxrsResponse$1.call(InboundJaxrsResponse.java:91)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:365)
    at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:240)
    at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:88)
    at org.gitlab4j.api.CommitsApi.addCommitStatus(CommitsApi.java:589)
    at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.sendNotifications(GitLabPipelineStatusNotifier.java:321)
    at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier.access$400(GitLabPipelineStatusNotifier.java:52)
    at io.jenkins.plugins.gitlabbranchsource.helpers.GitLabPipelineStatusNotifier$JobCheckOutListener.onCheckout(GitLabPipelineStatusNotifier.java:470)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:150)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
    at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
    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)

Configuration of the multibranch pipeline:

Environment:

Jenkins: 2.317 OS: Linux - 5.10.0-10-amd64

ace-editor:1.1 ant:1.11 antisamy-markup-formatter:2.1 apache-httpcomponents-client-4-api:4.5.13-1.0 bootstrap4-api:4.6.0-1 bouncycastle-api:2.20 branch-api:2.6.3 build-timeout:1.20 checks-api:1.5.0 cloudbees-folder:6.15 command-launcher:1.5 credentials:2.3.15 credentials-binding:1.24 display-url-api:2.3.4 durable-task:1.35 echarts-api:4.9.0-3 email-ext:2.81 font-awesome-api:5.15.2-1 generic-webhook-trigger:1.72 git:4.6.0 git-client:3.6.0 git-server:1.9 github:1.33.1 github-api:1.122 github-branch-source:2.10.1 gitlab-api:1.0.6 gitlab-branch-source:1.5.9 gradle:1.36 handlebars:1.1.1 handy-uri-templates-2-api:2.1.8-1.0 jackson2-api:2.12.1 jdk-tool:1.5 jjwt-api:0.11.2-9.c8b45b8bb173 jquery3-api:3.5.1-2 jsch:0.1.55.2 junit:1.48 ldap:2.4 lockable-resources:2.10 mailer:1.32.1 matrix-auth:2.6.6 matrix-project:1.18 momentjs:1.1.1 okhttp-api:3.14.9 pam-auth:1.6 pipeline-build-step:2.13 pipeline-github-lib:1.0 pipeline-graph-analysis:1.10 pipeline-input-step:2.12 pipeline-milestone-step:1.3.2 pipeline-model-api:1.8.4 pipeline-model-definition:1.8.4 pipeline-model-extensions:1.8.4 pipeline-rest-api:2.19 pipeline-stage-step:2.5 pipeline-stage-tags-metadata:1.8.4 pipeline-stage-view:2.19 plain-credentials:1.7 plugin-util-api:1.7.1 popper-api:1.16.1-1 resource-disposer:0.14 scm-api:2.6.4 script-security:1.76 snakeyaml-api:1.27.0 ssh-credentials:1.18.1 ssh-slaves:1.31.5 sshd:3.0.3 structs:1.22 thinBackup:1.10 timestamper:1.11.8 token-macro:2.15 trilead-api:1.0.13 workflow-aggregator:2.6 workflow-api:2.41 workflow-basic-steps:2.23 workflow-cps:2.89 workflow-cps-global-lib:2.17 workflow-durable-task-step:2.37 workflow-job:2.40 workflow-multibranch:2.22 workflow-scm-step:2.11 workflow-step-api:2.23 workflow-support:3.7 ws-cleanup:0.38

What Operating System are you using (both controller, and any agents involved in the problem)?

see environment

Reproduction steps

Configuration of the multibranch pipeline:

Expected Results

Pipelines Status can be retrieved

Actual Results

Mulitbranch pipeline can not be executed anymore. Every build fails due to problem above.

Anything else?

No response

aixigo-cschreuer commented 2 years ago

maybe this is the reason https://github.com/gitlab4j/gitlab4j-api/issues/805

arnabcse28 commented 2 years ago

hi aixigo-cschreuer, where do you get the above stack trace? In jenkins build console log itself?

I am encountering a somewhat related problem where Jenkins build log says: [GitLab Pipeline Status] Notifying merge request build status: SUCCESS : This commit looks good

However, gitlab never gets the notification and unable to update the build badge for MR.

aixigo-cschreuer commented 2 years ago

@arnabcse28 The error appeared in the jenkins log of the build. The reason for the error is https://github.com/gitlab4j/gitlab4j-api/issues/805 mentioned above . It is fixed now in gitlab4j-api-5.1.0, but unfortunatly the gitlab-api-plugin is not released with the updated gitlab4j-api version.

jetersen commented 2 years ago

Should be fixed in #188

I am currently preparing a release 👍

jetersen commented 2 years ago

released in 621.vd49608f876da_