Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ctubbsii opened this issue Mar 17, 2016 · 1 comment
Closed

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

ctubbsii opened this issue Mar 17, 2016 · 1 comment

Comments

@ctubbsii
Copy link

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.

@ctubbsii
Copy link
Author

What's worse... is that this appears to be wrapped in a java.lang.Error, which application code should never do, and that makes it hard to catch the exception in my client code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants