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

DateTimeParseException on MR web hook

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      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

          Activity

          derkoe Christian Köberl created issue -
          derkoe Christian Köberl made changes -
          Field Original Value New Value
          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:

          {noformat}
          java.time.format.DateTimeParseException: Text '2019-08-12T17:08:14+02:00' could not be parsed, unparsed text found at index 22java.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){noformat}

          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".
          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:

          {noformat}
          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)
          {noformat}

          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".
          Hide
          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

          Show
          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
          derkoe Christian Köberl made changes -
          Attachment full-error.html [ 48330 ]
          Hide
          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.

          Show
          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.
          Hide
          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.

          Show
          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.
          baymac Parichay Barpanda made changes -
          Epic Link JENKINS-57538 [ 199446 ]
          baymac Parichay Barpanda made changes -
          Sprint GSoC 2019. Coding Phase 3 [ 696 ]
          Labels gsoc-2019
          baymac Parichay Barpanda made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          derkoe Christian Köberl added a comment -
          Show
          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
          Hide
          baymac Parichay Barpanda added a comment -

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

          Show
          baymac Parichay Barpanda added a comment - Thank you Christian Köberl for the fix, I will make a new release of gitlab api plugin and also update the gitlab branch source plugin.
          baymac Parichay Barpanda made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          baymac Parichay Barpanda made changes -
          Resolution Fixed [ 1 ]
          Status In Review [ 10005 ] Resolved [ 5 ]

            People

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

              Dates

              Created:
              Updated:
              Resolved: