Unable to send out metrics // "Jetty ALPN/NPN has not been properly configured"

223 views
Skip to first unread message

Niko Schmuck

unread,
Feb 25, 2018, 2:35:25 PM2/25/18
to Google Stackdriver Discussion Forum
Hello,

When trying to create a metric descriptor resp. sending out metric time series from an kubernetes Java/gradle/fatjar based pod using the Google library:

com.google.cloud:google-cloud-monitoring:0.32.0-beta

(which itself has a transitive dependency to io.netty:netty-tcnative-boringssl-static:2.0.6.Final) I get a stacktrace as listed below.

I have tried Docker images based on standard "openjdk:8-jdk-alpine" as well as "gcr.io/google-appengine/openjdk:8"

Please advise on how to circumvent this? Do I need an additional library or to base it on a different Docker image?

Thanks in advance,
Niko

java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been properly configured.
        at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:162)
        at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:136)
        at io.grpc.netty.GrpcSslContexts.configure(GrpcSslContexts.java:124)
        at io.grpc.netty.GrpcSslContexts.forClient(GrpcSslContexts.java:94)
        at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory$DefaultNettyTransportCreationParamsFilterFactory.<init>(NettyChannelBuilder.java:521)
        at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory$DefaultNettyTransportCreationParamsFilterFactory.<init>(NettyChannelBuilder.java:514)
        at io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.<init>(NettyChannelBuilder.java:453)
        at io.grpc.netty.NettyChannelBuilder.buildTransportFactory(NettyChannelBuilder.java:312)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:324)
        at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:165)
        at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:130)
        at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:122)
        at com.google.cloud.monitoring.v3.stub.GrpcMetricServiceStub.create(GrpcMetricServiceStub.java:172)
        at com.google.cloud.monitoring.v3.MetricServiceSettings.createStub(MetricServiceSettings.java:194)
        at com.google.cloud.monitoring.v3.MetricServiceClient.<init>(MetricServiceClient.java:154)
        at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:135)
        at com.google.cloud.monitoring.v3.MetricServiceClient.create(MetricServiceClient.java:126)
        at com.chainvest.prototype.monitor.GcpCustomMetric.<init>(GcpCustomMetric.kt:23)
        at com.chainvest.prototype.monitor.TradeSignalMonitoringSink.open(TradeSignalMonitoringSink.kt:20)
        at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36)
        at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
        at org.apache.flink.streaming.api.operators.StreamSink.open(StreamSink.java:48)
        at org.apache.flink.streaming.runtime.tasks.StreamTask.openAllOperators(StreamTask.java:393)
        at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:254)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:718)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org/eclipse/jetty/alpn/ALPN
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at io.grpc.netty.JettyTlsUtil.isJettyAlpnConfigured(JettyTlsUtil.java:34)
        at io.grpc.netty.GrpcSslContexts.selectApplicationProtocolConfig(GrpcSslContexts.java:153)
        ... 25 common frames omitted

Igor Peshansky

unread,
Feb 25, 2018, 2:58:00 PM2/25/18
to niko.s...@gmail.com, Google Stackdriver Discussion Forum
Hi. Googling for the exact error you got finds https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2483, which links to https://github.com/grpc/grpc-java/issues/3025. Looks like there's a fix already; not clear if it's been released.
        Igor


--
© 2016 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Stackdriver Discussion Google Group (google-stackdr...@googlegroups.com) to participate in discussions with other members of the GoogleStackdriver community.
---
You received this message because you are subscribed to the Google Groups "Google Stackdriver Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-stackdriver-d...@googlegroups.com.
To post to this group, send email to google-stackdr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-stackdriver-discussion/3ecb5e7b-1afe-4885-8a98-89ae7918bf42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Niko Schmuck

unread,
Feb 26, 2018, 5:40:53 PM2/26/18
to Igor Peshansky, Google Stackdriver Discussion Forum
Thanks, Igor. 

...from the error description and the grpc issue (which I indeed found already earlier through fantastic means of search engines ;) it wasn't clear wether it was an issue with an outdated grpc version (since the "older" google cloud monitoring lib 0.32.0-beta linked to  io.netty:netty-tcnative-boringssl-static:2.0.6.Final and google-cloud-core-grpc:1.14.0).

Anyways, when updating to google cloud monitoring 0.35.0-beta, the dependency to netty-tcnative-boringssl-static is gone, and grpc is used in version 1.17.0 and now my Alpine based image is able to communicate with Stackdriver API flawlessly.

-- Niko


Email preferences: You received this email because you signed up for the Google Stackdriver Discussion Google Group (google-stackdriver-discu...@googlegroups.com) to participate in discussions with other members of the GoogleStackdriver community.
---
You received this message because you are subscribed to the Google Groups "Google Stackdriver Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-stackdriver-discussion+unsub...@googlegroups.com.
To post to this group, send email to google-stackdriver-discussion@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages