EventHub connect fails "An established connection was aborted by the software in host machine"

Viewed 106

In the following code snippet I try to set up my event hub:

Properties peerProperties = getPeerProperties();
Peer peer = client.newPeer(config.getPeerName(), config.getPeerGrpcURL(), peerProperties);
Properties ordererProperties = getOrdererProperties();
Orderer orderer = client.newOrderer(config.getOrdererName(), config.getOrdererGrpcURL(), ordererProperties);

// TODO: does EventHub need properties?
EventHub ehub = client.newEventHub(config.getEhubName(), config.getEhubGrpcURL());

channel = client.newChannel(config.getChannelName());
channel.addPeer(peer);
channel.addOrderer(orderer);
channel.addEventHub(ehub);
channel.initialize();

showProperties(peer, orderer);
System.out.println(ehub.getName() + " ... " + ehub.getUrl());
if (!ehub.isConnected()) {
    System.out.println("Event hub is not connected!");
}

I get the following output:

-----start of showProperties()-----
Peer properties
negotiationType ==> TLS
sslProvider ==> openSSL
Orderer properties
negotiationType ==> TLS
sslProvider ==> openSSL
-----end of showProperties()-----
peer1.org1.isprint.com ... grpcs://127.0.0.1:7053
Event hub is not connected!

This is what I see in my debug logs when I try to set up my event hub:

2020-05-14 02:37:37 DEBUG EventHub:212 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} is connecting.
2020-05-14 02:37:37 DEBUG EventHub:341 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} connect is done with connect status: false 
2020-05-14 02:37:37 WARN  EventHub:280 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} terminated is false shutdown is false, retry count 1  has error UNAVAILABLE: io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0].
2020-05-14 02:37:37 WARN  EventHub:294 - EventHub{id: 3, name: peer1.org1.isprint.com, channelName: isprintchannel, url: grpcs://127.0.0.1:7053} :StatusRuntimeException Status Status{code=UNAVAILABLE, description=io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0], cause=java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(Unknown Source)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
    at sun.nio.ch.IOUtil.read(Unknown Source)
    at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1140)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Unknown Source)
}.  Description io exception
Channel Pipeline: [SslHandler#0, ProtocolNegotiators$ClientTlsHandler#0, WriteBufferingAndExceptionHandler#0, DefaultChannelPipeline$TailContext#0] 

Am I missing any settings in my peer/orderer/eventhub which is preventing my EventHub connection from being established?

0 Answers
Related