cryostat-legacy icon indicating copy to clipboard operation
cryostat-legacy copied to clipboard

HTTP 500: ClassCastException during report generation

Open andrewazores opened this issue 3 years ago • 3 comments

https://github.com/cryostatio/cryostat/runs/4388180314?check_suite_focus=true#step:9:1081

SEVERE: HTTP 500: class java.io.IOException cannot be cast to class io.cryostat.net.reports.SubprocessReportGenerator$ReportGenerationException (java.io.IOException is in module java.base of loader 'bootstrap'; io.cryostat.net.reports.SubprocessReportGenerator$ReportGenerationException is in unnamed module of loader 'app')
io.vertx.ext.web.handler.impl.HttpStatusException: Internal Server Error
Caused by: java.lang.ClassCastException: class java.io.IOException cannot be cast to class io.cryostat.net.reports.SubprocessReportGenerator$ReportGenerationException (java.io.IOException is in module java.base of loader 'bootstrap'; io.cryostat.net.reports.SubprocessReportGenerator$ReportGenerationException is in unnamed module of loader 'app')
	at io.cryostat.net.web.http.api.v1.TargetReportGetHandler.targetRecordingNotFound(TargetReportGetHandler.java:134)
	at io.cryostat.net.web.http.api.v1.TargetReportGetHandler.handleAuthenticated(TargetReportGetHandler.java:124)
	at io.cryostat.net.web.http.AbstractAuthenticatedRequestHandler.handle(AbstractAuthenticatedRequestHandler.java:90)
	at io.cryostat.net.web.http.AbstractAuthenticatedRequestHandler.handle(AbstractAuthenticatedRequestHandler.java:65)
	at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48)
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:313)
	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)
[INFO] Running itest.ReportJwtDownloadIT
Error:  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 10.388 s <<< FAILURE! - in itest.ReportJwtDownloadIT
Error:  testDownloadRecordingUsingJwt  Time elapsed: 10.387 s  <<< ERROR!
java.util.concurrent.ExecutionException: java.lang.Exception: HTTP 500
	at itest.ReportJwtDownloadIT.testDownloadRecordingUsingJwt(ReportJwtDownloadIT.java:68)
Caused by: java.lang.Exception: HTTP 500

https://github.com/cryostatio/cryostat/blob/d486871f35479b18c1a44360fe4e18697bee58ff/src/main/java/io/cryostat/net/web/http/api/v1/TargetReportGetHandler.java#L132 / https://github.com/cryostatio/cryostat/blob/d486871f35479b18c1a44360fe4e18697bee58ff/src/main/java/io/cryostat/net/web/http/api/beta/TargetReportGetHandler.java#L139

This log seems strange. The itest client-side logs show that it was ReportJwtDownloadIT that failed, which should be calling through the beta JWT asset download path, so perhaps this test is written incorrectly and is making the request through the original /api/v1 handler.

Either way, the ClassCastException on the server-side logs reveal a problem that appears to be present in both the v1 and beta handlers since the beta implementation here is a copy-paste of the v1 implementation.

andrewazores avatar Dec 01 '21 22:12 andrewazores

Could this be caused by #758? Only thing that went in recently that seems like it might affect this.

andrewazores avatar Dec 02 '21 20:12 andrewazores

Funny that this happens to occur so often in CI right now. I can't get it to happen locally at all.

andrewazores avatar Dec 02 '21 21:12 andrewazores

That's been my experience with #666 as well, have yet to see that error happen locally.

hareetd avatar Dec 02 '21 21:12 hareetd

Haven't seen this in a long time.

andrewazores avatar Apr 25 '23 19:04 andrewazores