Closed snegboris closed 1 month ago
same error on our end : "object_attributes": { id : XXXXX }
same error on our end : "object_attributes": { id : XXXXX }
Same here
Jenkins version 2.440.3 with plugin version 1.8.1 (latest for this LTS version) is also affected. But it's really just the note type (comment) trigger, other triggers work fine. Gitlab is the gitlab.com SaaS.
Jenkins 2.474 with plugin 1.9.1 is also affected, with comment triggers when the note ID is greater than max int.
Same here
It is confirmed with Gitlab support. Id
column for the notes changed from integer
to bigint
(see MR ). If I get approval from the person who replied I'll quote the whole answer, but this is basically the most important part.
Probably this https://github.com/jenkinsci/gitlab-plugin/blob/c8d5d7b89d2c7c5ae7a2cb3e30184558dff65f1e/src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/model/Note.java#L11 has to be updated, but I am no programmer, I don't know for sure. Hopefully someone more knowledgeable than me could submit a PR soon.
Here's the full quote:
The
id
column for notes on GitLab.com was converted frominteger
tobigint
in the database to allow a higher range of values, see in this MR for details. The values for the column now exceed the int datatypes range, which seems to be used for marshalling the value from the JSON in the Jenkins plugin.
Caused: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (2148334819) out of range of int (-2147483648 - 2147483647)
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1108] (through reference chain: com.dabsquared.gitlabjenkins.gitlab.hook.model.NoteHook["object_attributes"]->com.dabsquared.gitlabjenkins.gitlab.hook.model.NoteObjectAttributes["id"]
The Plugin needs to be updated to with a data type appropriate for marshalling the data from bigint column datatype.
The question is if we can get it fixed for some of the older plugin versions as well. We (and I guess plenty of others) are using only LTS Jenkins releases and I am unsure what is the latest supported plugin version for these.
I've submitted a draft pull request that others can use in their tests. The draft pull request is based on the 1.8 line, so it requires Jenkins 2.426.3 or newer.
The "checks" tab of that pull request will have an "Incrementals publisher" entry on the left side when the job is complete. Inside that page there will be instructions and links that allow others to download the build so they can test it.
The incrementals link is not provided by the ci.jenkins.io job because the branch is out-of-date. Here is a zip file of the plugin built on my computer.
The incrementals link is not provided by the ci.jenkins.io job because the branch is out-of-date. Here is a zip file of the plugin built on my computer.
I don't know if it's just me, but it seems not to work.
I think that this file should have the type of the id
field changed accordingly src/main/java/com/dabsquared/gitlabjenkins/gitlab/hook/model/NoteObjectAttributes.java
.
I'm not so confident with Java but I can push a fix in the existing PR if you enable changes from your fork @MarkEWaite or you can easily do it on your own. Let me know
Thanks for trying that first attempt @simonefranconetti . Here is another zip file with the NoteObjectAttribute change:
@MarkEWaite Now it seems to work properly! Thank you so much
@MarkEWaite I confirm this fixed the problem on Jenkins 2.440.3 too! Thank you! 🥇
A new release https://github.com/jenkinsci/gitlab-plugin/releases/tag/gitlab-plugin-1.9.4 has been cut containing @MarkEWaite's fix for this issue.
Release 1.8.2 is available for older Jenkins versions with the same fix.
Jenkins and plugins versions report
Environment
```text Jenkins: 2.462.3 OS: Linux - 5.15.0-119-generic Java: 17.0.12 - Eclipse Adoptium (OpenJDK 64-Bit Server VM) --- allure-jenkins-plugin:2.31.1 analysis-model-api:12.9.0 ant:511.v0a_a_1a_334f41b_ antisamy-markup-formatter:162.v0e6ec0fcfcf6 apache-httpcomponents-client-4-api:4.5.14-208.v438351942757 apache-httpcomponents-client-5-api:5.4-118.v199115451c4d asm-api:9.7.1-95.v9f552033802a_ authentication-tokens:1.119.v50285141b_7e1 bootstrap5-api:5.3.3-1 bouncycastle-api:2.30.1.78.1-248.ve27176eb_46cb_ branch-api:2.1178.v969d9eb_c728e build-blocker-plugin:166.vc82fc20b_a_ed6 build-name-setter:2.4.3 build-timeout:1.33 build-user-vars-plugin:176.vb_9c7907fd524 caffeine-api:3.1.8-133.v17b_1ff2e0599 checks-api:2.2.1 cloudbees-folder:6.955.v81e2a_35c08d3 command-launcher:115.vd8b_301cc15d0 commons-lang3-api:3.17.0-84.vb_b_938040b_078 commons-text-api:1.12.0-129.v99a_50df237f7 conditional-buildstep:1.4.3 copyartifact:749.vfb_dca_a_9b_6549 credentials:1384.vf0a_2ed06f9c6 credentials-binding:681.vf91669a_32e45 custom-folder-icon:2.14 dark-theme:479.v661b_1b_911c01 data-tables-api:2.1.8-1 display-url-api:2.204.vf6fddd8a_8b_e9 docker-commons:443.v921729d5611d docker-custom-build-environment:1.7.3 durable-task:577.v2a_8a_4b_7c0247 echarts-api:5.5.1-1 eddsa-api:0.3.0-4.v84c6f0f4969e email-ext:1844.v3ea_a_b_842374a_ envinject:2.919.v009a_a_1067cd0 envinject-api:1.199.v3ce31253ed13 file-operations:266.v9d4e1eb_235b_a_ font-awesome-api:6.6.0-2 forensics-api:2.6.0 generic-webhook-trigger:2.2.2 git:5.5.2 git-client:5.0.0 git-parameter:0.9.19 github:1.40.0 github-api:1.321-468.v6a_9f5f2d5a_7e github-branch-source:1797.v86fdb_4d57d43 gitlab-plugin:1.8.1 gradle:2.13.1 gson-api:2.11.0-41.v019fcf6125dc instance-identity:201.vd2a_b_5a_468a_a_6 ionicons-api:74.v93d5eb_813d5f jackson2-api:2.17.0-379.v02de8ec9f64c jakarta-activation-api:2.1.3-1 jakarta-mail-api:2.1.3-1 javax-activation-api:1.2.0-7 javax-mail-api:1.6.2-10 jaxb:2.3.9-1 jdk-tool:80.v8a_dee33ed6f0 jersey2-api:2.44-151.v6df377fff741 jjwt-api:0.11.5-112.ve82dfb_224b_a_d joda-time-api:2.13.0-85.vb_64d1c2921f1 jquery3-api:3.7.1-2 jsch:0.2.16-86.v42e010d9484b_ json-api:20240303-41.v94e11e6de726 json-path-api:2.9.0-58.v62e3e85b_a_655 junit:1304.vc85a_b_ca_96613 ldap:725.v3cb_b_711b_1a_ef mailer:488.v0c9639c1a_eb_3 material-theme:0.5.2-rc100.6121925fe229 matrix-auth:3.2.2 matrix-project:839.vff91cd7e3a_b_2 mina-sshd-api-common:2.14.0-133.vcc091215a_358 mina-sshd-api-core:2.14.0-133.vcc091215a_358 okhttp-api:4.11.0-172.vda_da_1feeb_c6e oss-symbols-api:75.v337a_1c270ffc pam-auth:1.11 parameterized-trigger:806.vf6fff3e28c3e pipeline-build-step:540.vb_e8849e1a_b_d8 pipeline-github-lib:61.v629f2cc41d83 pipeline-graph-analysis:216.vfd8b_ece330ca_ pipeline-groovy-lib:730.ve57b_34648c63 pipeline-input-step:495.ve9c153f6067b_ pipeline-milestone-step:119.vdfdc43fc3b_9a_ pipeline-model-api:2.2214.vb_b_34b_2ea_9b_83 pipeline-model-definition:2.2214.vb_b_34b_2ea_9b_83 pipeline-model-extensions:2.2214.vb_b_34b_2ea_9b_83 pipeline-rest-api:2.34 pipeline-stage-step:312.v8cd10304c27a_ pipeline-stage-tags-metadata:2.2214.vb_b_34b_2ea_9b_83 pipeline-stage-view:2.34 plain-credentials:183.va_de8f1dd5a_2b_ plugin-util-api:5.1.0 postbuild-task:1.9 postbuildscript:3.3.0-654.v67cf36130d78 powershell:2.1 prism-api:1.29.0-17 progress-bar-column-plugin:11.vdef198c2d6c1 publish-over:0.22 publish-over-ssh:1.25 rebuild:332.va_1ee476d8f6d resource-disposer:0.24 run-condition:1.7 scm-api:696.v778d637b_a_762 script-security:1362.v67dc1f0e1b_b_3 snakeyaml-api:2.3-123.v13484c65210a_ ssh-agent:376.v8933585c69d3 ssh-credentials:343.v884f71d78167 ssh-slaves:2.973.v0fa_8c0dea_f9f ssh-steps:2.0.68.va_d21a_12a_6476 sshd:3.330.vc866a_8389b_58 structs:338.v848422169819 theme-manager:262.vc57ee4a_eda_5d throttle-concurrents:2.14 timestamper:1.27 token-macro:400.v35420b_922dcb_ trilead-api:2.147.vb_73cc728a_32e uno-choice:2.8.4 variant:60.v7290fc0eb_b_cd warnings-ng:11.9.0 workflow-aggregator:600.vb_57cdd26fdd7 workflow-api:1336.vee415d95c521 workflow-basic-steps:1058.vcb_fc1e3a_21a_9 workflow-cps:3969.vdc9d3a_efcc6a_ workflow-durable-task-step:1371.vb_7cec8f3b_95e workflow-job:1436.vfa_244484591f workflow-multibranch:795.ve0cb_1f45ca_9a_ workflow-scm-step:427.v4ca_6512e7df1 workflow-step-api:678.v3ee58b_469476 workflow-support:926.v9f4f9b_b_98c19 ws-cleanup:0.47 ```What Operating System are you using (both controller, and any agents involved in the problem)?
Jenkins LTS docker image
Reproduction steps
Create a comment in MR
Example:
Expected Results
No error
Actual Results
The error occurs with the note id in webhook from GitLab.
Full log
``` Caught unhandled exception with ID 6b0380f1-b1f0-4982-8806-ab6ac52188cc com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (2148334819) out of range of int (-2147483648 - 2147483647) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1108] at PluginClassLoader for jackson2-api//com.fasterxml.jackson.core.base.ParserMinimalBase._reportInputCoercion(ParserMinimalBase.java:562) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowInt(ParserMinimalBase.java:624) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.core.base.ParserBase.convertNumberToInt(ParserBase.java:1059) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.core.base.ParserBase._parseIntValue(ParserBase.java:983) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.core.base.ParserBase.getIntValue(ParserBase.java:789) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:526) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.std.NumberDeserializers$IntegerDeserializer.deserialize(NumberDeserializers.java:506) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:310) Caused: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (2148334819) out of range of int (-2147483648 - 2147483647) at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1108] (through reference chain: com.dabsquared.gitlabjenkins.gitlab.hook.model.NoteHook["object_attributes"]->com.dabsquared.gitlabjenkins.gitlab.hook.model.NoteObjectAttributes["id"]) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:402) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:361) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.BeanDeserializerBase.wrapAndThrow(BeanDeserializerBase.java:1937) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:312) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:310) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4905) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3848) at PluginClassLoader for jackson2-api//com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3816) at PluginClassLoader for gitlab-plugin//com.dabsquared.gitlabjenkins.util.JsonUtil.read(JsonUtil.java:57) Caused: java.lang.RuntimeException at PluginClassLoader for gitlab-plugin//com.dabsquared.gitlabjenkins.util.JsonUtil.read(JsonUtil.java:59) at PluginClassLoader for gitlab-plugin//com.dabsquared.gitlabjenkins.webhook.build.NoteBuildAction.Anything else?
No response
Are you interested in contributing a fix?
No response