You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@skywalking.apache.org by Sheng Wu <wu...@gmail.com> on 2021/08/16 13:57:30 UTC

Re: Java Agent unable to connect to APM server

Hi Prashant

First, recommend you to subscribe to our mail list, I added you as a
recipient manually, but it could be easily dropped.
>  Mail to dev-subscribe@skywalking.apache.org, follow the reply to subscribe to the mail list.

About your question, you opened the TLS on the agent side, so the
server-side reports an error.
We didn't implement TLS logic on the server-side, because once you
require TLS, you usually deploy the server on the internet, or at
least for out of VPC.
In this typical case, you need a Gateway to verify TLS. So, if you
have to test locally(reading your 127.0.0.1), add an Nginx/Envoy for
server TLS.

Sheng Wu 吴晟
Twitter, wusheng1108

Prashant Joshi <de...@gmail.com> 于2021年8月16日周一 下午9:52写道:
>
> Hi Team,
> I am new the skywalking and trying to configure the same on my local machine.
> Environment details:
> 1. OS : Window10
> 2. Skywalking version : 8.7
> 3. Java version 12:00
> 4. ElasticSearch 7.x
>
> Java Agent Configuration:
> agent.force_tls=${SW_AGENT_FORCE_TLS:true}
> collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800}
>
> Collector Configuration details:
> Core
>     restHost: ${SW_CORE_REST_HOST:127.0.0.1}
>     restPort: ${SW_CORE_REST_PORT:12800}
>     gRPCHost: ${SW_CORE_GRPC_HOST:127.0.0.1}
>     gRPCPort: ${SW_CORE_GRPC_PORT:11800}
>
> storage:
>   selector: ${SW_STORAGE:elasticsearch7}
>
> receiver-sharing-server:
>     # For Jetty server
>     restHost: ${SW_RECEIVER_SHARING_REST_HOST:127.0.0.1}
>     restPort: ${SW_RECEIVER_SHARING_REST_PORT:0}
>
>     # For gRPC server
>     gRPCHost: ${SW_RECEIVER_GRPC_HOST:127.0.0.1}
>     gRPCPort: ${SW_RECEIVER_GRPC_PORT:0}
>
> When my application starts it give following error when running my java application on windows machine:
> 2021-08-16 18:07:46:274 grpc-default-executor-1 EventReportServiceClient : Failed to report starting event.
> org.apache.skywalking.apm.dependencies.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
> Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
>         at org.apache.skywalking.apm.dependencies.io.grpc.Status.asRuntimeException(Status.java:533)
>         at org.apache.skywalking.apm.dependencies.io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478)
>         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:413)
>         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
>         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)
>         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:721)
>         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
>         at org.apache.skywalking.apm.dependencies.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
>         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>         at java.base/java.lang.Thread.run(Thread.java:835)
> Caused by: org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 000012040000000000000300000004000400100000000600002000000004080000000000000f0001
>         at org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1254)
>         at org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1322)
>         at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
>         at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
>         at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
>         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
>
> Kindly help
>
> Regards,
> Prashant Vijay Joshi
>
>
>

Re: Java Agent unable to connect to APM server

Posted by Sheng Wu <wu...@gmail.com>.
Forwarding the mail to the list.

Please don't send the mail to my personal mail directly. I send you
directly only because you haven't been on the list yet.

Your error log is not completed, I am not sure why it fails in
reporting. If gRPC fails, usually it is caused by the wrong IP or
port, even firewall, which has only to be checked locally.

Sheng Wu 吴晟
Twitter, wusheng1108

Prashant <de...@gmail.com> 于2021年8月17日周二 上午1:33写道:
>
> Hi Sheng,
>
> Thanks for your response. I disabled TLS from my agent side by setting agent.force_tls=${SW_AGENT_FORCE_TLS:false} and restarted my web-application.
>
> ERROR 2021-08-16 18:07:46:274 grpc-default-executor-1 EventReportServiceClient : Failed to report starting event.
>
> org.apache.skywalking.apm.dependencies.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
>
> Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.Status.asRuntimeException(Status.java:533)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:413)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:721)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
>
>               at org.apache.skywalking.apm.dependencies.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
>
>               at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>
>               at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>
>               at java.base/java.lang.Thread.run(Thread.java:835)
>
> Caused by: org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 000012040000000000000300000004000400100000000600002000000004080000000000000f0001
>
>               at org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1254)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1322)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
>
>               at org.apache.skywalking.apm.dependencies.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>
>               ... 1 more
>
> On my AOP server logs I can see : org.apache.skywalking.oap.server.library.server.grpc.GRPCServer - 117 [main] INFO  [] - Server started, host 127.0.0.1 listening on 11800
>
>
>
> Sent from Mail for Windows
>
>
>
> From: Sheng Wu
> Sent: Monday, August 16, 2021 7:27 PM
> To: dev; deals.prashant@gmail.com
> Subject: Re: Java Agent unable to connect to APM server
>
>
>
> Hi Prashant
>
>
>
> First, recommend you to subscribe to our mail list, I added you as a
>
> recipient manually, but it could be easily dropped.
>
> >  Mail to dev-subscribe@skywalking.apache.org, follow the reply to subscribe to the mail list.
>
>
>
> About your question, you opened the TLS on the agent side, so the
>
> server-side reports anI  error.
>
> We didn't implement TLS logic on the server-side, because once you
>
> require TLS, you usually deploy the server on the internet, or at
>
> least for out of VPC.
>
> In this typical case, you need a Gateway to verify TLS. So, if you
>
> have to test locally(reading your 127.0.0.1), add an Nginx/Envoy for
>
> server TLS.
>
>
>
> Sheng Wu 吴晟
>
> Twitter, wusheng1108
>
>
>
> Prashant Joshi <de...@gmail.com> 于2021年8月16日周一 下午9:52写道:
>
> >
>
> > Hi Team,
>
> > I am new the skywalking and trying to configure the same on my local machine.
>
> > Environment details:
>
> > 1. OS : Window10
>
> > 2. Skywalking version : 8.7
>
> > 3. Java version 12:00
>
> > 4. ElasticSearch 7.x
>
> >
>
> > Java Agent Configuration:
>
> > agent.force_tls=${SW_AGENT_FORCE_TLS:true}
>
> > collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800}
>
> >
>
> > Collector Configuration details:
>
> > Core
>
> >     restHost: ${SW_CORE_REST_HOST:127.0.0.1}
>
> >     restPort: ${SW_CORE_REST_PORT:12800}
>
> >     gRPCHost: ${SW_CORE_GRPC_HOST:127.0.0.1}
>
> >     gRPCPort: ${SW_CORE_GRPC_PORT:11800}
>
> >
>
> > storage:
>
> >   selector: ${SW_STORAGE:elasticsearch7}
>
> >
>
> > receiver-sharing-server:
>
> >     # For Jetty server
>
> >     restHost: ${SW_RECEIVER_SHARING_REST_HOST:127.0.0.1}
>
> >     restPort: ${SW_RECEIVER_SHARING_REST_PORT:0}
>
> >
>
> >     # For gRPC server
>
> >     gRPCHost: ${SW_RECEIVER_GRPC_HOST:127.0.0.1}
>
> >     gRPCPort: ${SW_RECEIVER_GRPC_PORT:0}
>
> >
>
> > When my application starts it give following error when running my java application on windows machine:
>
> > 2021-08-16 18:07:46:274 grpc-default-executor-1 EventReportServiceClient : Failed to report starting event.
>
> > org.apache.skywalking.apm.dependencies.io.grpc.StatusRuntimeException: UNAVAILABLE: io exception
>
> > Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.Status.asRuntimeException(Status.java:533)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:413)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:721)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
>
> >         at org.apache.skywalking.apm.dependencies.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
>
> >         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>
> >         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>
> >         at java.base/java.lang.Thread.run(Thread.java:835)
>
> > Caused by: org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 000012040000000000000300000004000400100000000600002000000004080000000000000f0001
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1254)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1322)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
>
> >         at org.apache.skywalking.apm.dependencies.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
>
> >
>
> > Kindly help
>
> >
>
> > Regards,
>
> > Prashant Vijay Joshi
>
> >
>
> >
>
> >
>
>