gitlab4j-api icon indicating copy to clipboard operation
gitlab4j-api copied to clipboard

org.gitlab4j.api.JobApi.getJobsForPipeline throw unexpected ProcessingException

Open NightXlt opened this issue 2 years ago • 3 comments

Background

We are getting jobs from pipeline, but it often throw ProcessingException. I think this is not expected exception which you design. I read part of your source code, and the expected exception is GitlabApiException.

SDK Version: 5.0.1

What I want to know and resolve

I want to resolve this exception to assure request is almost steady. I want to know what corner case it trigger.

Details

Full stacktrace:

javax.ws.rs.ProcessingException: Error reading entity from input stream.
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:900)
	at org.glassfish.jersey.message.internal.InboundMessageContext.readEntity(InboundMessageContext.java:845)
	at org.glassfish.jersey.client.ClientResponse.readEntity(ClientResponse.java:340)
	at org.glassfish.jersey.client.InboundJaxrsResponse$2.call(InboundJaxrsResponse.java:104)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:365)
	at org.glassfish.jersey.client.InboundJaxrsResponse.runInScopeIfPossible(InboundJaxrsResponse.java:244)
	at org.glassfish.jersey.client.InboundJaxrsResponse.readEntity(InboundJaxrsResponse.java:101)
	at org.gitlab4j.api.JobApi.getJobsForPipeline(JobApi.java:[145](https://git.bilibili.co/android/andruid/-/jobs/11255779#L145))

NightXlt avatar Feb 22 '23 07:02 NightXlt

In version 4.14.22, this exception occurs when the branch information of the code repository is obtained.

yuanxiaohua1 avatar Feb 28 '23 12:02 yuanxiaohua1

In version 4.14.22, this exception occurs when the branch information of the code repository is obtained.

My current sdk version is 5.0.1. I have also doubted version issue, and upgrade from 4.x to latest version.

NightXlt avatar Mar 02 '23 06:03 NightXlt

The method in question:

https://github.com/gitlab4j/gitlab4j-api/blob/2f584fb781a7492013c26fa11df19fea7574cf47/src/main/java/org/gitlab4j/api/JobApi.java#L131-L145

When you have a failing case with this lib, can you use an other tool (curl or postman) and redo the same HTTP call:

GET /projects/:id/pipelines/:pipeline_id/jobs

And share the returned JSON?

jmini avatar Apr 13 '23 12:04 jmini