Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected the service ProducerImpl-0 [FAILED] to be RUNNING, but the service has FAILED #6015

Open
DJuR opened this issue Feb 8, 2023 · 24 comments

Comments

@DJuR
Copy link

DJuR commented Feb 8, 2023

code:

 public static void main(String[] args) throws ClientException {
        String endpoint = "localhost:9876";
        String topic = "TopicTest";

        ClientServiceProvider clientServiceProvider = ClientServiceProvider.loadService();
        ClientConfigurationBuilder clientConfigurationBuilder = ClientConfiguration.newBuilder().setEndpoints(endpoint);
        ClientConfiguration build = clientConfigurationBuilder.build();
        Producer producer = clientServiceProvider.newProducerBuilder().setTopics(topic)
                .setClientConfiguration(build)
                .build();

        Message message = clientServiceProvider.newMessageBuilder()
                .setTag(topic)
                .setKeys("messageKey")
                .setTag("messageTag")
                .setBody("messageBody".getBytes(StandardCharsets.UTF_8))
                .build();

        SendReceipt send = producer.send(message);
        System.out.println(send.getMessageId());

    }

Caused by: java.util.concurrent.ExecutionException: org.apache.rocketmq.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0]

@Guts17
Copy link

Guts17 commented Feb 9, 2023

I have got the same problem.

@Guts17
Copy link

Guts17 commented Feb 9, 2023

It seems to be a common problem on windows.

@aaron-ai
Copy link
Member

aaron-ai commented Feb 9, 2023

ALPN negotiation is not successful in some platform, it is related to the TLS part of gRPC.

we plan to provide the TLS options recently so that you could turn it off.

@jiangyklala
Copy link

Is there some advice ? I have the problem too.

@aaron-ai
Copy link
Member

aaron-ai commented Mar 31, 2023

Is there some advice ? I have the problem too.

@jiangyklala This issue is actually caused by SSL compatibility problems on some Windows platforms. Please disable ssl by ClientConfigurationBuilder#enableSsl(false).

Here is the related link.

@gongzh021
Copy link

package org.apache.rocketmq.client.apis.ClientConfigurationBuilder

Which version of SDK is this class under?

I'm using "rocketmq-client-java-5.0.4.jar"

@aaron-ai
Copy link
Member

package org.apache.rocketmq.client.apis.ClientConfigurationBuilder

Which version of SDK is this class under?

I'm using "rocketmq-client-java-5.0.4.jar"

5.0.5

@gongzh021
Copy link

package org.apache.rocketmq.client.apis.ClientConfigurationBuilder
Which version of SDK is this class under?
I'm using "rocketmq-client-java-5.0.4.jar"

5.0.5

I still can't seem to use the SDK of 5.0.5.

ERROR:

Exception in thread "main" java.lang.IllegalStateException: Expected the service ProducerImpl-0 [FAILED] to be RUNNING, but the service has FAILED
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService.awaitRunning(AbstractIdleService.java:165)
at org.apache.rocketmq.client.java.impl.producer.ProducerBuilderImpl.build(ProducerBuilderImpl.java:93)
at rocketmq_0415.ProducerExample.main(ProducerExample.java:29)
Caused by: java.util.concurrent.ExecutionException: org.apache.rocketmq.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:588)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:567)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
at org.apache.rocketmq.client.java.impl.ClientImpl.startUp(ClientImpl.java:188)
at org.apache.rocketmq.client.java.impl.producer.ProducerImpl.startUp(ProducerImpl.java:114)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.Callables.lambda$threadRenaming$3(Callables.java:103)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.rocketmq.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: Network closed for unknown reason
at org.apache.rocketmq.shaded.io.grpc.Status.asRuntimeException(Status.java:539)
at org.apache.rocketmq.shaded.io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:544)
at org.apache.rocketmq.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
at org.apache.rocketmq.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
at org.apache.rocketmq.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723)
at org.apache.rocketmq.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at org.apache.rocketmq.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
... 1 more

@aaron-ai
Copy link
Member

@gongzh021 You may need to upgrade to the latest server version, as not all server versions support disabling SSL.

@gongzh021
Copy link

@gongzh021 You may need to upgrade to the latest server version, as not all server versions support disabling SSL.

I would like to ask, is this a problem only in the new version, or is this a problem in all versions?

@aaron-ai
Copy link
Member

aaron-ai commented Apr 15, 2023

@gongzh021 You may need to upgrade to the latest server version, as not all server versions support disabling SSL.

I would like to ask, is this a problem only in the new version, or is this a problem in all versions?

This is theoretically an issue that only appears in relatively old server and client versions, and currently most of them are seen on Windows platforms.

@KevinWang12138
Copy link

I meet this problem too, but my situtation is the broker and nameServer run on my Cloud Server, and Client run on my MAC. The problem appear beacuse the broker send the intranet address to nameServer, so my MAC cannot connect it.

The way I solve the problem is I add these to the 'broker.conf'--
brokerIP1=...
brokerIP2=...
namesrvAddr=localhost:9876

and you should change ... to your public address.

To know more detail infomation, please check this blog from chinese website:https://blog.csdn.net/jpf254/article/details/80748021

I dont know the final reason why that can solve the problem, I need to see the source code!

@plutoyty
Copy link

I have got the same problem.

@plutoyty
Copy link

I have got the same problem.

Exception in thread "main" java.lang.IllegalStateException: Expected the service ProducerImpl-0 [FAILED] to be RUNNING, but the service has FAILED
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService.awaitRunning(AbstractIdleService.java:165)
at org.apache.rocketmq.client.java.impl.producer.ProducerBuilderImpl.build(ProducerBuilderImpl.java:93)
at RocketMQ.ProducerExample.main(ProducerExample.java:31)
Caused by: java.util.concurrent.ExecutionException: org.apache.rocketmq.shaded.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 org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:588)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:567)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:91)
at org.apache.rocketmq.client.java.impl.ClientImpl.startUp(ClientImpl.java:188)
at org.apache.rocketmq.client.java.impl.producer.ProducerImpl.startUp(ProducerImpl.java:114)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.Callables.lambda$threadRenaming$3(Callables.java:103)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.rocketmq.shaded.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 org.apache.rocketmq.shaded.io.grpc.Status.asRuntimeException(Status.java:539)
at org.apache.rocketmq.shaded.io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:544)
at org.apache.rocketmq.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)
at org.apache.rocketmq.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)
at org.apache.rocketmq.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:563)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:70)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:744)
at org.apache.rocketmq.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723)
at org.apache.rocketmq.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at org.apache.rocketmq.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
... 1 more

@lipeimin
Copy link

lipeimin commented Jun 7, 2023

我们项目中使用canal监听binlog,当数据写入rocket后, 消费时项目无法启动,报错如下:
image
目前rocket安装在测试机上,配置文件没有限制http或https请求方式,我们使用的rocket版本是5.0.4,无法设置enablessl选项,请教大佬目前情况该怎么解决,谢谢

@jc0803kevin
Copy link

rocket版本是升级到 5.0.5

@AI1186780944
Copy link

AI1186780944 commented Jul 31, 2023

Is there some advice ? I have the problem too.

@jiangyklala This issue is actually caused by SSL compatibility problems on some Windows platforms. Please disable ssl by ClientConfigurationBuilder#enableSsl(false).

Here is the related link.

按照你的解决方案进行了处理,但是错误变成了”UNAVAILABLE: Network closed for unknown reason“。如果不设置enableSsl=false,这错误是”UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol“。
SDK版本是rocketmq-client-java 5.0.5。服务器端是5.1.3的。
<dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-client-java</artifactId> <version>5.0.5</version> </dependency>

image
image
image

服务器是Ubuntu虚拟机搭建的。url是虚拟机IP:9876。在SpringCloud项目启动注册消费者Bean的时候,报的错误。

@jc0803kevin
Copy link

jc0803kevin commented Aug 1, 2023 via email

@jc0803kevin
Copy link

Is there some advice ? I have the problem too.

@jiangyklala This issue is actually caused by SSL compatibility problems on some Windows platforms. Please disable ssl by ClientConfigurationBuilder#enableSsl(false).
Here is the related link.

按照你的解决方案进行了处理,但是错误变成了”UNAVAILABLE: Network closed for unknown reason“。如果不设置enableSsl=false,这错误是”UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol“。 SDK版本是rocketmq-client-java 5.0.5。服务器端是5.1.3的。 <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-client-java</artifactId> <version>5.0.5</version> </dependency>

image image image

服务器是Ubuntu虚拟机搭建的。url是虚拟机IP:9876。在SpringCloud项目启动注册消费者Bean的时候,报的错误。

rocketmq 5.x 需要使用 proxy 的的方式启动。然后enableSsl=false, 加上对应的账户密码。就可以连接。

@AI1186780944
Copy link

AI1186780944 commented Aug 1, 2023

Is there some advice ? I have the problem too.

@jiangyklala This issue is actually caused by SSL compatibility problems on some Windows platforms. Please disable ssl by ClientConfigurationBuilder#enableSsl(false).
Here is the related link.

按照你的解决方案进行了处理,但是错误变成了”UNAVAILABLE: Network closed for unknown reason“。如果不设置enableSsl=false,这错误是”UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol“。 SDK版本是rocketmq-client-java 5.0.5。服务器端是5.1.3的。 <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-client-java</artifactId> <version>5.0.5</version> </dependency>
image image image
服务器是Ubuntu虚拟机搭建的。url是虚拟机IP:9876。在SpringCloud项目启动注册消费者Bean的时候,报的错误。

rocketmq 5.x 需要使用 proxy 的的方式启动。然后enableSsl=false, 加上对应的账户密码。就可以连接。

我使用的是Local模式启动的。并且日志显示proxy启动是成功的。就是没有使用账户和密码。这个账户和密码是必须的么?正常来说内网环境不是无需设置ACL么?我的JDK环境版本是20.x。之前使用Remoting协议的SDK是链接正常的。可以正常收发消息。但是gRPC协议的不行。
image
是否需要我提供我的测试代码来方便你们测试?

@jc0803kevin
Copy link

Is there some advice ? I have the problem too.

@jiangyklala This issue is actually caused by SSL compatibility problems on some Windows platforms. Please disable ssl by ClientConfigurationBuilder#enableSsl(false).
Here is the related link.

按照你的解决方案进行了处理,但是错误变成了”UNAVAILABLE: Network closed for unknown reason“。如果不设置enableSsl=false,这错误是”UNAVAILABLE: Failed ALPN negotiation: Unable to find compatible protocol“。 SDK版本是rocketmq-client-java 5.0.5。服务器端是5.1.3的。 <dependency> <groupId>org.apache.rocketmq</groupId> <artifactId>rocketmq-client-java</artifactId> <version>5.0.5</version> </dependency>
image image image
服务器是Ubuntu虚拟机搭建的。url是虚拟机IP:9876。在SpringCloud项目启动注册消费者Bean的时候,报的错误。

rocketmq 5.x 需要使用 proxy 的的方式启动。然后enableSsl=false, 加上对应的账户密码。就可以连接。

我使用的是Local模式启动的。并且日志显示proxy启动是成功的。就是没有使用账户和密码。这个账户和密码是必须的么?正常来说内网环境不是无需设置ACL么?我的JDK环境版本是20.x。之前使用Remoting协议的SDK是链接正常的。可以正常收发消息。但是gRPC协议的不行。 image 是否需要我提供我的测试代码来方便你们测试?

没有设置账户密码,是可以不填的。连接使用的端口是proxy的端口,不是9876.
例如proxy.json配置为
{ "grpcServerPort": 18081, "remotingListenPort":18082, "rocketMQClusterName": "DefaultCluster" }

那连接的 endpoints = "localhost:18082"

@AI1186780944
Copy link

grpcServerPort

非常感谢。按照您的方案,已经解决了这个问题。

@01codingworld
Copy link

我的代码经过验证发现与 enableSsl=false 无关,主要是 endpoint 指定了错误的地址 nameserver(localhost:9876), 把 endpoint 指定为 proxy 地址端口,以上两个报错都解决了
另外,rocketmq 5.x 需要使用 proxy 的的方式启动, 希望文档能更细化完善

@ipyton
Copy link

ipyton commented Mar 9, 2024

我的代码经过验证发现与 enableSsl=false 无关,主要是 endpoint 指定了错误的地址 nameserver(localhost:9876), 把 endpoint 指定为 proxy 地址端口,以上两个报错都解决了 另外,rocketmq 5.x 需要使用 proxy 的的方式启动, 希望文档能更细化完善

麻烦死了,我去用Kafka了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests