question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quay.io Swagger not right for pull_robot field

See original GitHub issue

Describe the bug Swagger defines pull_robot field as a string; in at least one case, it’s an object.

This causes refreshing Quay tools that have pull_robot set to a non-null value to fail.

To Reproduce curl -H "accept: application/json" https://quay.io/api/v1/repository/ucsc_cgl%2Fkallisto/build/?limit=1 > jq '.'

Notice pull_robot portion of response:

...
      "pull_robot": {
        "kind": "user",
        "name": "ucsc_cgl+robot",
        "is_robot": true
      },
...

But it is defined here as a string. When Swagger tries to deserialize the response, it gets an error:

ERROR [2020-06-09 00:55:16,153] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: f60cd43fa97ff34b
! com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token
!  at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 249] (through reference chain: io.swagger.quay.client.model.InlineResponse2001["builds"]->java.util.ArrayList[0]->io.swagger.quay.client.model.QuayBuild["pull_robot"])
! at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)

Expected behavior Should deserialize correctly.

Additional context

  • Webservice version: develop branch

I believe this hasn’t come up before because most other responses I see have the value set to null.

┆Issue is synchronized with this Jira Story ┆Fix Versions: Dockstore 1.9 ┆Issue Number: DOCK-1401 ┆Sprint: Sprint 40 Octopus ┆Issue Type: Story

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
coverbeckcommented, Jul 9, 2020

Getting an error when refreshing that tool in dev. See this in logs:

! at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 249] (through reference chain: io.swagger.quay.client.model.InlineResponse2001["builds"]->java.util.ArrayList[0]->io.swagger.quay.client.model.QuayBuild["pull_robot"])
! at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
! at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1442)
! at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1216)
! at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1126)
! at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:63)
! at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)
! at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
! at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
! at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
! at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
! at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
! at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
! at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
! at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
! at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
! at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1682)
! at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:977)
! at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:814)
! at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.invokeReadFrom(ReaderInterceptorExecutor.java:256)
! at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$TerminalReaderInterceptor.aroundReadFrom(ReaderInterceptorExecutor.java:235)
! at org.glassfish.jersey.message.internal.ReaderInterceptorExecutor.proceed(ReaderInterceptorExecutor.java:155)
! at org.glassfish.jersey.message.internal.MessageBodyFactory.readFrom(MessageBodyFactory.java:1085)
! at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:874)
! ... 83 common frames omitted
! Causing: javax.ws.rs.ProcessingException: Error reading entity from input stream.
! at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:889)
! at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:834)
! at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:368)
! at org.glassfish.jersey.client.InboundJaxrsResponse$2.call(InboundJaxrsResponse.java:126)
! at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
! at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
! at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
! at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:419)
! at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:267)
! at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:123)
! at io.swagger.quay.client.ApiClient.deserialize(ApiClient.java:568)
! at io.swagger.quay.client.ApiClient.invokeAPI(ApiClient.java:703)
! at io.swagger.quay.client.api.BuildApi.getRepoBuildsWithHttpInfo(BuildApi.java:337)
! at io.swagger.quay.client.api.BuildApi.getRepoBuilds(BuildApi.java:290)
! at io.dockstore.webservice.helpers.QuayImageRegistry.updateAPIToolsWithBuildInformation(QuayImageRegistry.java:286)
! at io.dockstore.webservice.helpers.AbstractImageRegistry.refreshTool(AbstractImageRegistry.java:301)
! at io.dockstore.webservice.resources.DockerRepoResource.refreshContainer(DockerRepoResource.java:310)
! at io.dockstore.webservice.resources.DockerRepoResource.refresh(DockerRepoResource.java:264)
0reactions
NatalieEOcommented, Aug 13, 2020

Wa able to refresh the tool mentioned in the ticket on develop API - 1.10.0-alpha.0-SNAPSHOT UI - 2.6.1-26-gb76540bb

Read more comments on GitHub >

github_iconTop Results From Across the Web

Red Hat Quay API Guide
https://docs.quay.io/api/swagger/. The API Explorer that appears shows Quay.io API endpoints. You will not see superuser API endpoints.
Read more >
Project Quay API Guide
Lets you connect to endpoints, via a browser, to get, delete, post, and put Project Quay settings by enabling the Swagger UI. Can...
Read more >
API Explorer - Quay Documentation
This API allows you to perform many of the operations required to work with Quay repositories, users, and organizations. You can find out...
Read more >
go-swagger/swagger.json at master - quay.io - GitHub
Swagger 2.0 implementation for go. Contribute to go-swagger/go-swagger development by creating an account on GitHub.
Read more >
Golang API Server - Building OpenAPIs
docker run --rm -v ${PWD}:/local -w /local quay.io/goswagger/swagger ... name field createTask 2017/10/06 02:05:24 package field operations 2017/10/06 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found