io.grpc.StatusRuntimeException: UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol - While Trying to connect to Dialog Flow from Java

56 views
Skip to first unread message

suraj D K

unread,
Apr 29, 2020, 7:09:06 AM4/29/20
to grpc.io

Hi, 

I'm facing the above exception when trying to connect to dialogflow from my Spring Boot Application.
I'm using Java 8 and google-cloud-dialogflow v1.0.0 java client library.  The code i'm using is available here - https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/dialogflow/cloud-client/src/main/java/com/example/dialogflow/DetectIntentTexts.java

The same code works absolutely fine in my personal network but fails in enterprise network. I have tried everything i can find on the internet nothing seems to work..

Please Help me fix this issue

Trace - 
io.grpc.StatusRuntimeException: UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
at io.grpc.Status.asRuntimeException(Status.java:533) ~[grpc-api-1.27.2.jar:1.27.2]
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:497) ~[grpc-stub-1.27.2.jar:1.27.2]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:689) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$900(ClientCallImpl.java:577) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:751) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:740) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.27.2.jar:1.27.2]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.27.2.jar:1.27.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_91]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_91]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_91]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_91]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]

Chengyuan Zhang

unread,
Apr 29, 2020, 2:53:43 PM4/29/20
to grpc.io
The TLS handshake failed, but we are not able to know the reason just based on the above stacktrace. What is the TLS provider you are using in enterprise environment? It might be your enterprise environment where your server is running does snot support ALPN and HTTP2. There is more information in gRPC's SECURITY.md.

suraj D K

unread,
Apr 30, 2020, 12:32:00 AM4/30/20
to grpc.io
Hi,

yes as you said it is something to do with the enterprise environment .
i'm trying to connect to Dialogflow from Spring-boot app. I have enabled http2 and netty servers in my application it has everything it needs to work but still it's failing so the only reason can be the enterprise network. 
i'm not aware of the TLS provider used by the enterprise network. However i have noticed that all the requests from browser and Postman work.Even the Http2 requests.So not sure why it's working from JAVA
Reply all
Reply to author
Forward
0 new messages