You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/06/15 10:17:35 UTC

[GitHub] [pulsar] 97arushisharma opened a new issue #7277: Getting org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651

97arushisharma opened a new issue #7277:
URL: https://github.com/apache/pulsar/issues/7277


   **Description**
   I am trying to run a pulsar producer using java client that writes data to the standalone pulsar. I have run the pulsar using the following command:
   ```
   bin/pulsar standalone
   ```
   When I was writing the data without TLS encryption, it was working fine. But after I tried the TLS configuration, I am getting the following error in my client logs:
   
   ```
   org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   java.net.ConnectException: Connection refused WARNING [147 2020-06-15 09:27:10.157]: com.sqlstream.aspen.namespace.common.OutputUdx convertAllRows java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   	at org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:717)
   	at org.apache.pulsar.client.impl.ProducerBuilderImpl.create(ProducerBuilderImpl.java:93)
   	at com.sqlstream.aspen.namespace.pulsar.PulsarOutputSink.open(PulsarOutputSink.java:196)
   	at com.sqlstream.aspen.namespace.common.OutputUdx.convertAllRows(OutputUdx.java:228)
   	at com.sqlstream.aspen.namespace.common.OutputUdx.writeRowsToSink(OutputUdx.java:216)
   	at com.sqlstream.aspen.namespace.common.OutputUdx.writeRows(OutputUdx.java:176)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at net.sf.farrago.runtime.FarragoTransformUdx.executeUdx(FarragoTransformUdx.java:364)
   	at net.sf.farrago.runtime.FarragoTransformUdx.run(FarragoTransformUdx.java:403)
   	at java.lang.Thread.run(Thread.java:748)
   Caused by: java.util.concurrent.ExecutionException: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
   	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
   	at org.apache.pulsar.client.impl.ProducerBuilderImpl.create(ProducerBuilderImpl.java:91)
   	... 11 more
   Caused by: org.apache.pulsar.client.api.PulsarClientException: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   	at org.apache.pulsar.client.impl.ConnectionPool.lambda$null$9(ConnectionPool.java:203)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
   	at org.apache.pulsar.shade.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	... 1 more
   Caused by: java.util.concurrent.CompletionException: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
   	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
   	at java.util.concurrent.CompletableFuture.uniAccept(CompletableFuture.java:661)
   	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:646)
   	at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488)
   	at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1990)
   	at org.apache.pulsar.client.impl.ConnectionPool.lambda$connectToAddress$17(ConnectionPool.java:276)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
   	at org.apache.pulsar.shade.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:321)
   	at org.apache.pulsar.shade.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:337)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:688)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514)
   	... 4 more
   Caused by: org.apache.pulsar.shade.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /127.0.0.1:6651
   Caused by: java.net.ConnectException: Connection refused
   	at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
   	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:714)
   	at org.apache.pulsar.shade.io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330)
   	at org.apache.pulsar.shade.io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:688)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552)
   	at org.apache.pulsar.shade.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050)
   	at org.apache.pulsar.shade.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at org.apache.pulsar.shade.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   
   **To Reproduce**
   
   I have followed the following link for creating tls certificates(only upto BrokerConfiguration) : [http://pulsar.apache.org/docs/en/security-tls-transport/](http://pulsar.apache.org/docs/en/security-tls-transport/)
   
   Here are the producer client configurations: 
   Configs are: my-topic - pulsar+ssl://127.0.0.1:6651 
   ClientConfigs : {tlsTrustCertsFilePath=/home/Downloads/my-ca/certs/ca.cert.pem, serviceUrl=pulsar+ssl://127.0.0.1:6651, useTls=true} 
   ProducerConfigs : {producerName=ABCProducer, topicName=my-topic}
   
   I am using the Java Client and passing the configs using `loadConf` function.
   I have also set the following properties in `broker.conf` file:
   ```
   tlsEnabled=true
   tlsCertificateFilePath=/path/to/broker.cert.pem
   tlsKeyFilePath=/path/to/broker.key-pk8.pem
   tlsTrustCertsFilePath=/home/Downloads/my-ca/certs/ca.cert.pem
   brokerServicePortTls=6651
   ```
   
   I am doing everything within an **Ubuntu 18.04.4 LTS** VM with **Pulsar 2.5.0**. Following are the VM network settings:
   Attached to : NAT
   Advance:
   Promiscuous Mode: Deny
   
   **Expected behavior**
   Successfully transfer data to the topic using TLS encryption.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] freadaiz commented on issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
freadaiz commented on issue #7277:
URL: https://github.com/apache/pulsar/issues/7277#issuecomment-702533819


   So in my case i missed to define the tls protocol in my conf.
   Thanks for your prompt reply @97arushisharma .


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 97arushisharma closed issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
97arushisharma closed issue #7277:
URL: https://github.com/apache/pulsar/issues/7277


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 97arushisharma edited a comment on issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
97arushisharma edited a comment on issue #7277:
URL: https://github.com/apache/pulsar/issues/7277#issuecomment-701890401


   Hi @freadaiz , I added the following configs to the standalone.conf:
   
   ```
   brokerServicePortTls=6651
   webServicePortTls=8443
   functionsWorkerEnabled=true
   tlsEnabled=true
   tlsCertRefreshCheckDurationSec=300
   tlsCertificateFilePath=/home/Downloads/my-ca/broker.cert.pem
   tlsKeyFilePath=/home/Downloads/my-ca/broker.key-pk8.pem
   tlsTrustCertsFilePath=/home/Downloads/my-ca/certs/ca.cert.pem
   ```
   These are the same configs that we add to `broker.conf` but incase of standalone I had to add them to my `standalone.conf`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] freadaiz commented on issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
freadaiz commented on issue #7277:
URL: https://github.com/apache/pulsar/issues/7277#issuecomment-701883109


   Hi Arushi, i'm facing the same problem right now.
   could you explain what extra configurations was added in standalone.conf ?
   Actually i doesn't see port 6651 listening.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 97arushisharma edited a comment on issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
97arushisharma edited a comment on issue #7277:
URL: https://github.com/apache/pulsar/issues/7277#issuecomment-701890401


   Hi @freadaiz , I added the following configs to the standalone.conf:
   
   ```
   brokerServicePortTls=6651
   webServicePortTls=8443
   functionsWorkerEnabled=true
   tlsEnabled=true
   tlsCertRefreshCheckDurationSec=300
   tlsCertificateFilePath=/home/Downloads/my-ca/broker.cert.pem
   tlsKeyFilePath=/home/Downloads/my-ca/broker.key-pk8.pem
   tlsTrustCertsFilePath=/home/Downloads/my-ca/certs/ca.cert.pem
   ```
   These are the same configs that we add to `broker.conf` but incase of standalone I had to add them to my standalone.conf.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 97arushisharma commented on issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
97arushisharma commented on issue #7277:
URL: https://github.com/apache/pulsar/issues/7277#issuecomment-701890401


   Hi @freadaiz , I added the following configs to the standalone.conf:
   
   ```
   brokerServicePortTls=6651
   webServicePortTls=8443
   functionsWorkerEnabled=true
   tlsEnabled=true
   tlsCertRefreshCheckDurationSec=300
   tlsCertificateFilePath=/home/Downloads/my-ca/broker.cert.pem
   tlsKeyFilePath=/home/Downloads/my-ca/broker.key-pk8.pem
   tlsTrustCertsFilePath=/home/Downloads/my-ca/certs/ca.cert.pem
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [pulsar] 97arushisharma commented on issue #7277: Getting Connection refused: /127.0.0.1:6651 error on trying TLS encryption

Posted by GitBox <gi...@apache.org>.
97arushisharma commented on issue #7277:
URL: https://github.com/apache/pulsar/issues/7277#issuecomment-644055713


   Sorry for the issue. I realised that we need to add extra configurations in standalone.conf file for tls. After adding those configurations, the TLS encryption worked.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org