hyperledger / firefly-ethconnect

Ethereum connectivity bridge for Web Services & async Messaging APIs - familiar to Enterprise Apps
Apache License 2.0
75 stars 33 forks source link

Can't connect to kafka. #70

Closed Vasiliy-Bondarenko closed 4 years ago

Vasiliy-Bondarenko commented 4 years ago

ethconnect fails to connect to Kafka. kafka is working i can see it in Control Center. one-broker cluster.

startup log:

root@1bb3e09903ba:/app# ~/go/bin/ethconnect server -f config.yaml --debug 2
Copyright (C) 2018,2019 Kaleido
Licensed under the Apache License, Version 2.0
Version:  (Build Date: )

[2020-06-17T10:08:47.937Z] DEBUG Log level set to 2
[2020-06-17T10:08:47.942Z]  INFO Starting REST gateway 'example-webhoooksto-kafka'
[2020-06-17T10:08:47.942Z] DEBUG Kafka TLS Enabled=false Insecure=false MutualAuth=false ClientCertsFile= PrivateKeyFile= CACertsFile=
[2020-06-17T10:08:47.942Z]  INFO Starting Kafka->Ethereum bridge 'example-kafka-to-eth'
[2020-06-17T10:08:47.944Z]  INFO New JSON/RPC connection established
[2020-06-17T10:08:47.944Z] DEBUG JSON/RPC connected to https://e0u9yrfjnc-e0v6nvzwc3-rpc.de0-aws.kaleido.io:8545
[2020-06-17T10:08:47.945Z] DEBUG Kafka Bootstrap brokers: [broker:29092]
[2020-06-17T10:08:47.945Z] DEBUG Kafka TLS Enabled=true Insecure=false MutualAuth=false ClientCertsFile= PrivateKeyFile= CACertsFile=
[2020-06-17T10:08:47.945Z] DEBUG Kafka ClientID: 1851c49f-fff0-4197-5d99-4cf2b44fb717
[2020-06-17T10:08:47.945Z] DEBUG sarama: Initializing new client
[2020-06-17T10:08:47.945Z] DEBUG sarama: client/metadata fetching metadata for all topics from broker broker:29092
[2020-06-17T10:08:47.949Z] DEBUG sarama: Failed to connect to broker broker:29092: read tcp 172.18.0.7:59710->172.18.0.4:29092: read: connection reset by peer
[2020-06-17T10:08:47.949Z] DEBUG sarama: client/metadata got error from broker -1 while fetching metadata: read tcp 172.18.0.7:59710->172.18.0.4:29092: read: connection
 reset by peer
[2020-06-17T10:08:47.949Z] DEBUG sarama: client/metadata no available broker to send metadata request to
[2020-06-17T10:08:47.949Z] DEBUG sarama: client/brokers resurrecting 1 dead seed brokers
[2020-06-17T10:08:47.949Z] DEBUG sarama: client/metadata retrying after 2000ms... (3 attempts remaining)
[2020-06-17T10:08:47.960Z]  INFO MongoDB collection exists: %!s(<nil>)
[2020-06-17T10:08:47.960Z]  INFO Connected to MongoDB on mongoadmin:secret@mongo:27017/ethconnect?authSource=admin&gssapiServiceName=mongodb DB=ethconnect Collection=et
hconnect-replies
[2020-06-17T10:08:47.960Z] DEBUG Kafka Bootstrap brokers: [broker:29092]
[2020-06-17T10:08:47.960Z] DEBUG Kafka TLS Enabled=false Insecure=false MutualAuth=false ClientCertsFile= PrivateKeyFile= CACertsFile=
[2020-06-17T10:08:47.960Z] DEBUG Kafka ClientID: 4110e95f-f4ba-4914-786e-28f3bc9b1c70
[2020-06-17T10:08:47.960Z] DEBUG sarama: Initializing new client
[2020-06-17T10:08:47.961Z] DEBUG sarama: client/metadata fetching metadata for all topics from broker broker:29092
[2020-06-17T10:08:47.964Z] DEBUG sarama: Connected to broker at broker:29092 (unregistered)
[2020-06-17T10:08:47.970Z] DEBUG sarama: client/brokers registered new broker #1 at broker:29092
[2020-06-17T10:08:47.971Z] DEBUG sarama: Successfully initialized new client
[2020-06-17T10:08:47.972Z]  INFO Kafka Connected: [broker:29092]
[2020-06-17T10:08:47.972Z] DEBUG Kafka Consumer Topic=ethconnect-replies ConsumerGroup=ethconnect-webhoooksto-kafka-cg
[2020-06-17T10:08:47.972Z] DEBUG Kafka Producer Topic=ethconnect-requests
[2020-06-17T10:08:47.972Z]  INFO Kafka Created consumer
[2020-06-17T10:08:47.972Z]  INFO Kafka Created producer
[2020-06-17T10:08:47.972Z]  INFO Kafka consumer starting. Group: 'ethconnect-webhoooksto-kafka-cg' Topics: [ethconnect-replies]
[2020-06-17T10:08:47.973Z] DEBUG sarama: client/metadata fetching metadata for [ethconnect-replies] from broker broker:29092
[2020-06-17T10:08:47.972Z] DEBUG Kafka initialization complete
[2020-06-17T10:08:47.972Z] DEBUG Webhooks listening for successful sends to Kafka
[2020-06-17T10:08:47.972Z] DEBUG Webhooks listening for errors sending to Kafka
[2020-06-17T10:08:47.975Z] DEBUG sarama: client/coordinator requesting coordinator for consumergroup ethconnect-webhoooksto-kafka-cg from broker:29092
[2020-06-17T10:08:47.976Z] DEBUG sarama: client/coordinator coordinator for consumergroup ethconnect-webhoooksto-kafka-cg is #1 (broker:29092)
[2020-06-17T10:08:47.978Z] DEBUG sarama: Connected to broker at broker:29092 (registered as #1)
[2020-06-17T10:08:47.984Z] DEBUG sarama: client/coordinator requesting coordinator for consumergroup ethconnect-webhoooksto-kafka-cg from broker:29092
[2020-06-17T10:08:47.986Z] DEBUG sarama: client/coordinator coordinator for consumergroup ethconnect-webhoooksto-kafka-cg is #1 (broker:29092)
[2020-06-17T10:08:47.987Z]  INFO Consumer session setup. Claims=map[ethconnect-replies:[0]] Member=4110e95f-f4ba-4914-786e-28f3bc9b1c70-e0c21a68-364d-4d38-b93c-13a239b6
1ae1 Generation=1
[2020-06-17T10:08:47.987Z] DEBUG sarama: client/metadata fetching metadata for [ethconnect-replies] from broker broker:29092
[2020-06-17T10:08:47.988Z] DEBUG sarama: client/metadata fetching metadata for [ethconnect-replies] from broker broker:29092
[2020-06-17T10:08:47.988Z] DEBUG sarama: consumer/broker/1 added subscription to ethconnect-replies/0
[2020-06-17T10:08:48.211Z]  INFO HTTP server listening on :8001
[2020-06-17T10:08:49.950Z] DEBUG sarama: client/metadata fetching metadata for all topics from broker broker:29092
[2020-06-17T10:08:49.957Z] DEBUG sarama: Failed to connect to broker broker:29092: read tcp 172.18.0.7:59718->172.18.0.4:29092: read: connection reset by peer
[2020-06-17T10:08:49.958Z] DEBUG sarama: client/metadata got error from broker -1 while fetching metadata: read tcp 172.18.0.7:59718->172.18.0.4:29092: read: connection
 reset by peer
[2020-06-17T10:08:49.958Z] DEBUG sarama: client/metadata no available broker to send metadata request to
[2020-06-17T10:08:49.958Z] DEBUG sarama: client/brokers resurrecting 1 dead seed brokers
[2020-06-17T10:08:49.958Z] DEBUG sarama: client/metadata retrying after 2000ms... (2 attempts remaining)
[2020-06-17T10:08:51.959Z] DEBUG sarama: client/metadata fetching metadata for all topics from broker broker:29092
[2020-06-17T10:08:51.965Z] DEBUG sarama: Failed to connect to broker broker:29092: read tcp 172.18.0.7:59722->172.18.0.4:29092: read: connection reset by peer
[2020-06-17T10:08:51.965Z] DEBUG sarama: client/metadata got error from broker -1 while fetching metadata: read tcp 172.18.0.7:59722->172.18.0.4:29092: read: connection
 reset by peer
[2020-06-17T10:08:51.965Z] DEBUG sarama: client/metadata no available broker to send metadata request to
[2020-06-17T10:08:51.965Z] DEBUG sarama: client/brokers resurrecting 1 dead seed brokers
[2020-06-17T10:08:51.966Z] DEBUG sarama: client/metadata retrying after 2000ms... (1 attempts remaining)
[2020-06-17T10:08:53.966Z] DEBUG sarama: client/metadata fetching metadata for all topics from broker broker:29092
[2020-06-17T10:08:53.969Z] DEBUG sarama: Failed to connect to broker broker:29092: read tcp 172.18.0.7:59726->172.18.0.4:29092: read: connection reset by peer
[2020-06-17T10:08:53.969Z] DEBUG sarama: client/metadata got error from broker -1 while fetching metadata: read tcp 172.18.0.7:59726->172.18.0.4:29092: read: connection
 reset by peer
[2020-06-17T10:08:53.969Z] DEBUG sarama: client/metadata no available broker to send metadata request to
[2020-06-17T10:08:53.969Z] DEBUG sarama: client/brokers resurrecting 1 dead seed brokers
[2020-06-17T10:08:53.969Z] DEBUG sarama: Closing Client
[2020-06-17T10:08:53.970Z] ERROR Failed to create Kafka client: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
[2020-06-17T10:08:53.970Z] ERROR Kafka->Ethereum bridge failed: kafka: client has run out of available brokers to talk to (Is your cluster reachable?)
peterbroadhurst commented 4 years ago

read: connection reset by peer

Think you might want to look on the Kafka side to understand why it closed the connection. I don't think this represents an issue on ethconnect itself. The Go library used for connectivity to Kafka is called Sarama, if you're looking for more detail or to debug the Kafka connectivity layer in ethconnect.

Vasiliy-Bondarenko commented 4 years ago

found the issue. it was tls miss-confuguration. thanks.