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

json parsing error when fetching branches from github

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When fetching branches from the github repository, having the following error.

      ERROR: [Wed Apr 15 18:09:01 EDT 2020] Could not fetch branches from source if this isn't set then all branches will be rebuilt on refCreated and refDeleted events
      com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
       at [Source: (StringReader); line: 1, column: 2]
      	at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
      	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
      	at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
      	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1916)
      	at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:772)
      	at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:357)
      	at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1704)
      	at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261)
      	at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:85)
      	at org.kohsuke.github.GitHubPageIterator.lambda$fetch$0(GitHubPageIterator.java:145)
      	at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:406)
      	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:360)
      Caused: org.kohsuke.github.HttpException: Server returned HTTP response code: 200, message: '304 Not Modified' for URL
      

       

        Attachments

          Activity

          Hide
          merickso Mike Erickson added a comment - - edited

          I have the same problem for 1 repo (others work)

          Jenkins 2.232
          git 4.2.2
          git-client 3.2.1
          git-server 1.9
          github 1.29.5
          github-api 1.111
          github-branch-source 2.6.0
          github-organization-folder 1.6

           ERROR: [Fri Apr 17 15:03:39 PDT 2020] Could not fetch sources from navigator org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator@21f39e43
          com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
          at [Source: (StringReader); line: 1, column: 2]
          at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840)
          at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712)
          at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637)
          at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1916)
          at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:772)
          at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:357)
          at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1704)
          at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261)
          at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:85)
          at org.kohsuke.github.GitHubPageIterator.lambda$fetch$0(GitHubPageIterator.java:145)
          at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:406)
          at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:360)
          Caused: org.kohsuke.github.HttpException: Server returned HTTP response code: 200, message: '304 Not Modified' for URL: https://github.xxx/api/v3/repos/xxx/contents/?ref=refs%2Fheads%2Fmaster
          at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:445)

           

           Edit: 

          I tried this but no luck https://superuser.com/questions/1459241/jenkins-and-github-enterprise-2-17-failing-pull-request-builds-only

          I made a commit on the repo (just changed a readme file) and it re-scanned and it worked. 

           

          Show
          merickso Mike Erickson added a comment - - edited I have the same problem for 1 repo (others work) Jenkins 2.232 git 4.2.2 git-client 3.2.1 git-server 1.9 github 1.29.5 github-api 1.111 github-branch-source 2.6.0 github-organization-folder 1.6  ERROR: [Fri Apr 17 15:03:39 PDT 2020] Could not fetch sources from navigator org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator@21f39e43 com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false') at [Source: (StringReader); line: 1, column: 2] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._handleOddValue(ReaderBasedJsonParser.java:1916) at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:772) at com.fasterxml.jackson.databind.ObjectReader._initForReading(ObjectReader.java:357) at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1704) at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1261) at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:85) at org.kohsuke.github.GitHubPageIterator.lambda$fetch$0(GitHubPageIterator.java:145) at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:406) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:360) Caused: org.kohsuke.github.HttpException: Server returned HTTP response code: 200, message: '304 Not Modified' for URL: https://github.xxx/api/v3/repos/xxx/contents/?ref=refs%2Fheads%2Fmaster at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:445)    Edit:  I tried this but no luck  https://superuser.com/questions/1459241/jenkins-and-github-enterprise-2-17-failing-pull-request-builds-only I made a commit on the repo (just changed a readme file) and it re-scanned and it worked.   
          Hide
          bitwiseman Liam Newman added a comment - - edited

          Mike Erickson sean qian
          So, this is an intermittent failure? 

          Could one of you file this as an issue for that github-api library (https://github.com/github-api/github-api) .  It is something that will need to be worked on there. 

           

          Show
          bitwiseman Liam Newman added a comment - - edited Mike Erickson sean qian So, this is an intermittent failure?  Could one of you file this as an issue for that github-api library ( https://github.com/github-api/github-api ) .  It is something that will need to be worked on there.   
          Hide
          bitwiseman Liam Newman added a comment - - edited

          I think I found the source of this problem.

          There is bug in Push event payloads that returns the wrong url.
          All other occurrences of "url" take the form "https://api.github.com/repos/[fullName]".
          For Push event repository records, they take the form "https://github.com/[fullName]".

          https://github.com/hub4j/github-api/blob/66f22de90fd0d53de4d9e79b8fa202fb0af8310f/src/main/java/org/kohsuke/github/GHRepository.java#L2842-L2853

          This is consistent with this issue not reproducing when scanning.

          Fix should be in the next version of the github-api.

          Show
          bitwiseman Liam Newman added a comment - - edited I think I found the source of this problem. There is bug in Push event payloads that returns the wrong url. All other occurrences of "url" take the form "https://api.github.com/repos/[fullName]". For Push event repository records, they take the form "https://github.com/[fullName]". https://github.com/hub4j/github-api/blob/66f22de90fd0d53de4d9e79b8fa202fb0af8310f/src/main/java/org/kohsuke/github/GHRepository.java#L2842-L2853 This is consistent with this issue not reproducing when scanning. Fix should be in the next version of the github-api.

            People

            Assignee:
            bitwiseman Liam Newman
            Reporter:
            parabird sean qian
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: