Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58919

DateTimeParseException on MR web hook

    XMLWordPrintable

Details

    • GSoC 2019. Coding Phase 3

    Description

      When GitLab sends the web hook for a Merge Request Jenkins fails with a 500 (Internal Server Error). The response shows the error is in parsing one of the timestamps:

      java.time.format.DateTimeParseException: Text '2019-08-12T17:08:14+02:00' could not be parsed, unparsed text found at index 22
      	at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1952)
      	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851)
      	at java.time.OffsetDateTime.parse(OffsetDateTime.java:402)
      	at org.gitlab4j.api.utils.ISO8601.toInstant(ISO8601.java:155)
      	at org.gitlab4j.api.utils.ISO8601.toDate(ISO8601.java:169)
      	at org.gitlab4j.api.utils.JacksonJson$JsonDateDeserializer.deserialize(JacksonJson.java:281)
      	at org.gitlab4j.api.utils.JacksonJson$JsonDateDeserializer.deserialize(JacksonJson.java:275)
      	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
      

      This happens since our update to GitLab 12.1 - seems like GitLab now uses this format for "last_commit.timestamp": "2019-08-12T17:08:14+02:00".

      Attachments

        1. full-error.html
          20 kB
          Christian Köberl

        Activity

          I already created a PR in gitlab4j which should fix this: https://github.com/gitlab4j/gitlab4j-api/pull/422

          derkoe Christian Köberl added a comment - I already created a PR in gitlab4j which should fix this:  https://github.com/gitlab4j/gitlab4j-api/pull/422

          Thanks for the pr in gitlab4j. Btw can you confirm the plugin worked with an earlier GitLab Server version? I am using GitLab Gold version - `GitLab Enterprise Edition 12.2.0-pre` and I do not have such issue. Although it could be an issue with the self hosted GitLab version.

          baymac Parichay Barpanda added a comment - Thanks for the pr in gitlab4j. Btw can you confirm the plugin worked with an earlier GitLab Server version? I am using GitLab Gold version - `GitLab Enterprise Edition 12.2.0-pre` and I do not have such issue. Although it could be an issue with the self hosted GitLab version.

          Yes it worked with GitLab 12.0.x. Anyway the ISO date "2018-03-12T10:16:46+07:00"  is valid and should be accepted.

          derkoe Christian Köberl added a comment - Yes it worked with GitLab 12.0.x. Anyway the ISO date "2018-03-12T10:16:46+07:00"  is valid and should be accepted.
          derkoe Christian Köberl added a comment - the fixed version is now released:  https://github.com/gitlab4j/gitlab4j-api/releases/tag/gitlab4j-api-4.12.1

          Thank you derkoe for the fix, I will make a new release of gitlab api plugin and also update the gitlab branch source plugin.

          baymac Parichay Barpanda added a comment - Thank you derkoe for the fix, I will make a new release of gitlab api plugin and also update the gitlab branch source plugin.

          People

            baymac Parichay Barpanda
            derkoe Christian Köberl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: