Skip to content

Failed to deserialize list of contributors when repo is empty #261

@ctubbsii

Description

@ctubbsii

Saw the following error when iterating over a list of contributors on a repository. My guess is that there's a user whose username isn't compatible with whatever encoding is being used here, because it's 100% reproducible at the exact same point in the iteration.

Exception in thread "main" java.lang.Error: java.io.IOException: Failed to deserialize 
  at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:422)
  at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:389)
  at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44)
  at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32)
  at java.lang.Iterable.forEach(Iterable.java:74)
  ...
Caused by: java.io.IOException: Failed to deserialize 
  at org.kohsuke.github.Requester.parse(Requester.java:489)
  at org.kohsuke.github.Requester.access$200(Requester.java:65)
  at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:413)
  ... 7 more
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
 at [Source: java.io.StringReader@4f51b3e0; line: 1, column: 1]
  at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
  at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:2931)
  at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2873)
  at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2034)
  at org.kohsuke.github.Requester.parse(Requester.java:487)
  ... 9 more

It looks like the problem is when the PagedIterator.hasNext() is called when the repo is empty and you try to list its contributors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions