欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Skywalking Illegal character in hostname at index

程序员文章站 2024-02-14 17:06:28
...
ERROR 2020-07-02 14:04:09:379 SkywalkingAgent-5-GRPCChannelManager-0 GRPCChannelManager : Create channel to apm-skywalking_oap:11800 fail. 
java.lang.IllegalArgumentException: Invalid host or port: apm-skywalking_oap 11800
        at org.apache.skywalking.apm.dependencies.io.grpc.internal.GrpcUtil.authorityFromHostAndPort(GrpcUtil.java:488)
        at org.apache.skywalking.apm.dependencies.io.grpc.netty.NettyChannelBuilder.<init>(NettyChannelBuilder.java:133)
        at org.apache.skywalking.apm.dependencies.io.grpc.netty.NettyChannelBuilder.forAddress(NettyChannelBuilder.java:119)
        at org.apache.skywalking.apm.agent.core.remote.GRPCChannel.<init>(GRPCChannel.java:38)
        at org.apache.skywalking.apm.agent.core.remote.GRPCChannel.<init>(GRPCChannel.java:29)
        at org.apache.skywalking.apm.agent.core.remote.GRPCChannel$Builder.build(GRPCChannel.java:101)
        at org.apache.skywalking.apm.agent.core.remote.GRPCChannelManager.run(GRPCChannelManager.java:115)
        at org.apache.skywalking.apm.util.RunnableWithExceptionProtection.run(RunnableWithExceptionProtection.java:33)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        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:834)
Caused by: java.net.URISyntaxException: Illegal character in hostname at index 16: //apm-skywalking_oap:11800
        at java.base/java.net.URI$Parser.fail(URI.java:2913)
        at java.base/java.net.URI$Parser.parseHostname(URI.java:3448)
        at java.base/java.net.URI$Parser.parseServer(URI.java:3297)
        at java.base/java.net.URI$Parser.parseAuthority(URI.java:3216)
        at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3158)
        at java.base/java.net.URI$Parser.parse(URI.java:3125)
        at java.base/java.net.URI.<init>(URI.java:685)
        at org.apache.skywalking.apm.dependencies.io.grpc.internal.GrpcUtil.authorityFromHostAndPort(GrpcUtil.java:486)
        ... 13 more

该问题是由于Skywalking agent连接到 oap-server,对于oap-server的主机名或者域名不能带有 _ 下划线,比较扯,docker swarm中生成的全名为 stack_servicename,对于swarm service直接使用servicename即可,总之skywalking不支持 _ 下划线的服务地址。需要避免该问题