Open jamesdh opened 3 years ago
I am facing the same problem here.
My test fails only on GitHub Actions, but locally it works.
io.micronaut.context.exceptions.BeanInstantiationException:
Error instantiating bean of type [io.micronaut.http.server.RouteExecutor]
Message: brave/http/HttpClientHandler
Path Taken: NettyEmbeddedServer.buildDefaultServer(NettyHttpServerConfiguration configuration) --> new DefaultNettyEmbeddedServerFactory(ApplicationContext applicationContext,[RouteExecutor routeExecutor],MediaTypeCodecRegistry mediaTypeCodecRegistry,StaticResourceResolver staticResourceResolver,ThreadFactory nettyThreadFactory,HttpCompressionStrategy httpCompressionStrategy,EventLoopGroupFactory eventLoopGroupFactory,EventLoopGroupRegistry eventLoopGroupRegistry) --> new RouteExecutor([Router router],BeanContext beanContext,RequestArgumentSatisfier requestArgumentSatisfier,HttpServerConfiguration serverConfiguration,ErrorResponseProcessor errorResponseProcessor,ExecutorSelector executorSelector)
Caused by: java.lang.NoClassDefFoundError: brave/http/HttpClientHandler
Caused by: java.lang.ClassNotFoundException: brave.http.HttpClientHandler
I've just ran into this same problem. Unfortunately I can't add brave-instrumentation-http
to the classpath as it replaces the OpenTracingServerFilter
bean from micronaut-trace
.
Running locally is working as expected but fails on GCP.
Strangely it seems that enabling metrics in application.yml
fixes the issue.
Task List
Steps to Reproduce
I was working through the Micronaut GCP docs to get logging + tracing working correctly on an app deployed to a GKE Autopilot cluster. The logging I was able to get configured but have not had much luck getting tracing working correctly. When I eventually pushed my changes, my automated tests ran via GitHub Actions, at which point I would get a failure due to a ClassNotFoundException that appears to be related to brave:
But when running tests locally, I have no such issue. I tried disabling both zipkin tracing and gcp tracing in application.yml, but it made no difference.
However, after taking a look at the release notes, it appears beginning with Brave v5.13 they made some changes to their maven BOM which could be the cause of any such transitive dependency issues:
I'm afraid I'm too inexperienced with both GCP/GKE and Brave to understand what's going on here, but I'm guessing it's somehow related to the fact that GitHub Actions are themselves running in a cloud environment, which in turn is incorrectly being detected and thus it tries to run brave?
Manually adding
runtimeOnly("io.zipkin.brave:brave-instrumentation-http:5.13.3")
to build.gradle got around this testing quirk, but I'm guessing that isn't the expected behavior...Environment Information