Hono CLI start issue

206 Views Asked by At

I recently deployed hono using Minikube. I followed the instructions, tunneled the cluster so it is available through localhost. I also successfully set up a tenant and I would like to test the MQTT Adapter with Mosquitto.

I tried to start the CLI to connect to the Northbound API as shown in the tutorial and I got the following error:

23:25:23.718 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [127.0.0.1:15672, role: unknown] have been made, giving up
23:25:23.746 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Receiver - Error occurred during initialization of receiver: failed to connect

The command I tried to use:

java -jar hono-cli-*-exec.jar --hono.client.host=127.0.0.1 --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$TENANT

I tried both 15672 and 15671 ports but none of them worked. Here is a log of the hono service:

NAME                                            TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                           AGE
eclipse-hono-adapter-amqp-vertx                 LoadBalancer   10.99.195.237    127.0.0.1     5672:32672/TCP,5671:32671/TCP     36h
eclipse-hono-adapter-http-vertx                 LoadBalancer   10.97.63.200     127.0.0.1     8080:30080/TCP,8443:30443/TCP     36h
eclipse-hono-adapter-mqtt-vertx                 LoadBalancer   10.100.216.206   127.0.0.1     1883:31883/TCP,8883:30883/TCP     36h
eclipse-hono-artemis                            ClusterIP      10.104.81.61     <none>        5671/TCP                          36h
eclipse-hono-dispatch-router                    ClusterIP      10.104.214.176   <none>        5673/TCP                          36h
eclipse-hono-dispatch-router-ext                LoadBalancer   10.100.97.6      127.0.0.1     15671:30671/TCP,15672:30672/TCP   36h
eclipse-hono-service-auth                       ClusterIP      10.99.59.114     <none>        5671/TCP                          36h
eclipse-hono-service-command-router             ClusterIP      10.104.190.85    <none>        5671/TCP                          36h
eclipse-hono-service-device-registry            ClusterIP      10.111.164.103   <none>        5671/TCP,8080/TCP,8443/TCP        36h
eclipse-hono-service-device-registry-ext        LoadBalancer   10.109.24.98     127.0.0.1     28080:31080/TCP,28443:31443/TCP   36h
eclipse-hono-service-device-registry-headless   ClusterIP      None             <none>        <none>                            36h

I appreciate any advise. Thanks!

Update:

nano@dhcp-646 hono % java -jar hono-cli-*-exec.jar --hono.client.host=127.0.0.1 --spring.profiles.active=receiver,local --hono.client.port=15672 --hono.client.username=consumer@HONO --hono.client.password=verysecret --tenant.id=$TENANT


  ______     _ _                  _    _                   
 |  ____|   | (_)                | |  | |                  
 | |__   ___| |_ _ __  ___  ___  | |__| | ___  _ __   ___  
 |  __| / __| | | '_ \/ __|/ _ \ |  __  |/ _ \| '_ \ / _ \ 
 | |___| (__| | | |_) \__ \  __/ | |  | | (_) | | | | (_) |
 |______\___|_|_| .__/|___/\___| |_|  |_|\___/|_| |_|\___/ 
                | |                                        
                |_|                                        

Eclipse Hono Example Client  (v1.12.1)
using Spring Boot  (v2.5.9)

Go to https://www.eclipse.org/hono for more information.


12:26:58.881 [main] INFO  org.eclipse.hono.cli.Application - Starting Application v1.12.1 using Java 17.0.2 on dhcp-646.q.wlan.net.bme.hu with PID 22476 (/Users/nano/Documents/hono/hono-cli-1.12.1-exec.jar started by nano in /Users/nano/Documents/hono)
12:26:58.882 [main] INFO  org.eclipse.hono.cli.Application - The following profiles are active: receiver,local
12:26:59.122 [main] INFO  org.eclipse.hono.cli.Application - running command line client in role(s): receiver,local
12:26:59.273 [main] INFO  o.e.h.a.c.a.ProtonBasedApplicationClient - connecting to Hono endpoint
12:26:59.320 [main] INFO  org.eclipse.hono.cli.Application - Started Application in 0.744 seconds (JVM running for 1.079)
12:26:59.338 [vert.x-eventloop-thread-0] WARN  i.n.r.d.DnsServerAddressStreamProviders - Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.
12:27:10.457 [vert.x-eventloop-thread-0] INFO  o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [127.0.0.1:15672, role: unknown] have been made, giving up
12:27:10.465 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Receiver - Error occurred during initialization of receiver: failed to connect

Update: Minikube service list -n hono

NAMESPACE NAME TARGET PORT URL
hono eclipse-hono-adapter-amqp-vertx amqp/5672
amqps/5671
hono eclipse-hono-adapter-http-vertx http/8080
https/8443
hono eclipse-hono-adapter-mqtt-vertx mqtt/1883
secure-mqtt/8883
hono eclipse-hono-artemis No node port
hono eclipse-hono-dispatch-router No node port
hono eclipse-hono-dispatch-router-ext amqps/15671
amqp/15672
hono eclipse-hono-service-auth No node port
hono eclipse-hono-service-command-router No node port
hono eclipse-hono-service-device-registry No node port
hono eclipse-hono-service-device-registry-ext http/28080
https/28443
hono eclipse-hono-service-device-registry-headless No node port
----------- ----------------------------------------------- ------------------ -----

Update: Kubernetes services:

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   8d
0

There are 0 best solutions below