Eclipse Hono - ConnectTimeoutException when starting the Command Line Client in the terminal for sending commands - eclipse-hono

I am following the Eclipse Hono getting started guide and using the sandbox environment.
I opened git bash terminal and used this command for starting the device to receive commands:
mosquitto_sub -v -h $MQTT_ADAPTER_IP -u $MY_DEVICE#$MY_TENANT -P $MY_PWD -t command/+/+/req/#
I opened another git bash terminal and used this command for the application client to send commands to the device:
java -jar hono-cli-*-exec.jar --hono.client.host=$AMQP_NETWORK_IP --hono.client.port=15672 --hono.client.username=consumer#HONO --hono.client.password=verysecret --tenant.id=$MY_TENANT --device.id=$MY_DEVICE --spring.profiles.active=command
But I get this exception when I use the above command:
21:41:45.504 [main] INFO org.eclipse.hono.cli.Application - Starting Application v1.3.0 on DESKTOP-4SV0QNN with PID 9768 (C:\Users\HP\hono-cli-1.3.0-exec.jar started by HP in C:\Users\HP)
21:41:45.509 [main] INFO org.eclipse.hono.cli.Application - The following profiles are active: command
21:41:47.092 [main] INFO org.eclipse.hono.cli.Application - running command line client in role(s): command
21:41:50.249 [main] INFO org.eclipse.hono.cli.Application - Started Application in 7.064 seconds (JVM running for 10.127)
21:42:17.462 [vert.x-eventloop-thread-0] INFO o.e.h.client.impl.HonoConnectionImpl - max number of attempts [5] to re-connect to server [hono.eclipseprojects.io:15672, role: unknown] have been made, giving up
21:42:17.595 [vert.x-eventloop-thread-0] INFO o.e.h.client.impl.HonoConnectionImpl - stopping connection attempt to server [hono.eclipseprojects.io:15672, role: unknown] due to terminal error
org.eclipse.hono.connection.ConnectTimeoutException: connection attempt timed out after 5000ms
at org.eclipse.hono.connection.impl.ConnectionFactoryImpl.lambda$connect$0(ConnectionFactoryImpl.java:153)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:923)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:887)
at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
at io.vertx.core.impl.EventLoopContext.execute(EventLoopContext.java:43)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:229)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:221)
at io.vertx.core.impl.VertxImpl$InternalTimerHandler.run(VertxImpl.java:913)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
21:42:17.602 [vert.x-eventloop-thread-0] ERROR org.eclipse.hono.cli.app.Commander - Error: failed to connect
I have set the environment variables MQTT_ADAPTER_IP, MY_TENANT, MY_DEVICE in the application client terminal and MY_TENANT, MY_DEVICE, MY_PWD, MQTT_ADAPTER_IP in the device terminal.
This is the jdk version in my system:
C:\Users\HP>java -version
java version "11.0.7" 2020-04-14 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.7+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.7+8-LTS, mixed mode)
Please let know how can I fix this.

Related

Error While configuring Jenkins Controller and Agent using amazon EC2 instance

I'm trying to configure Jenkins Controller and Agent (maven server as agent node), but I'm getting an error while launching my node.
This is the error
"Error: A JNI error has occurred, please check your installation and try again"
I have double-checked my configurations. created new user in maven and given it sudo access, configured ssh to allow password based authentication.
I dont know what to do as I'm new to this concept. Please help me out.**
[09/24/22 16:28:17] [SSH] Opening SSH connection to 172.31.31.40:22.
[09/24/22 16:28:17] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
[09/24/22 16:28:17] [SSH] Authentication successful.
[09/24/22 16:28:17] [SSH] The remote user's environment is:
BASH=/usr/bin/bash
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_EXECUTION_STRING=set
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="2" [4]="release" [5]="x86_64-koji-linux-gnu")
BASH_VERSION='4.2.46(2)-release'
DIRSTACK=()
EUID=1001
GROUPS=()
HOME=/home/jenkins
HOSTNAME=ip-172-31-31-40.ec2.internal
HOSTTYPE=x86_64
IFS=$' \t\n'
LANG=en_US.UTF-8
LESSOPEN='||/usr/bin/lesspipe.sh %s'
LOGNAME=jenkins
MACHTYPE=x86_64-koji-linux-gnu
MAIL=/var/mail/jenkins
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/bin:/usr/bin
PIPESTATUS=([0]="0")
PPID=22937
PS4='+ '
PWD=/home/jenkins
SHELL=/bin/bash
SHELLOPTS=braceexpand:hashall:interactive-comments
SHLVL=1
SSH_CLIENT='172.31.93.109 40612 22'
SSH_CONNECTION='172.31.93.109 40612 172.31.31.40 22'
TERM=dumb
UID=1001
USER=jenkins
XDG_RUNTIME_DIR=/run/user/1001
XDG_SESSION_ID=56
_=/etc/bashrc
Checking Java version in the PATH
openjdk version "1.8.0_342"
OpenJDK Runtime Environment (build 1.8.0_342-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)
[09/24/22 16:28:17] [SSH] Checking java version of /home/jenkins/jdk/bin/java
Couldn't figure out the Java version of /home/jenkins/jdk/bin/java
bash: /home/jenkins/jdk/bin/java: No such file or directory
[09/24/22 16:28:17] [SSH] Checking java version of java
[09/24/22 16:28:17] [SSH] java -version returned 1.8.0_342.
[09/24/22 16:28:17] [SSH] Starting sftp client.
[09/24/22 16:28:17] [SSH] Copying latest remoting.jar...
Source agent hash is 8D575C4C8219E6AB2039295EC545C6C3. Installed agent hash is 8D575C4C8219E6AB2039295EC545C6C3
Verified agent jar. No update is necessary.
Expanded the channel window size to 4MB
[09/24/22 16:28:18] [SSH] Starting agent process: cd "/home/jenkins" && java -jar remoting.jar -workDir /home/jenkins -jar-cache /home/jenkins/remoting/jarCache
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
Agent JVM has terminated. Exit code=1
[09/24/22 16:28:18] Launch failed - cleaning up connection
[09/24/22 16:28:18] [SSH] Connection closed.```
The core error is pretty clear ...
You have no JAVA_HOME defined as shown in the env dump, log shows: Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
In English, that means you are trying to run the agent on Java 8 (ie: java -version returned 1.8.0_342) , when Java 11 is the required minimum for Jenkins 2.357+ / LTS 2.361.1+: Blog post, Enhancement Proposal, Upgrade Guide, Change Log, Community post w/upgrade instructions
ps: you should also address: WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection

Thingsboard application run failed

I'm installing thingsboard on ubuntu 20.04LTS. I followed the installation guides on the thingsboard website. After all done, i entered this address "http://localhost:8081" (i changed the http_bind_port to 8081) but my browser can not reach this address. I checked for the error and received this report:
~$ cat /var/log/thingsboard/thingsboard.log | grep ERROR
2022-03-22 09:58:19,873 [main] ERROR o.s.boot.SpringApplication - Application run failed
2022-03-22 10:05:01,668 [main] ERROR o.s.boot.SpringApplication - Application run failed
Binary file (standard input) matches
Hope anybody can help me. Thank you all.

Setting up a Selenium node on Linux

I am currently trying to set up a Selenium node on a Linux VM (headless). The hub is being run from a Windows device on port 5786 (4444 was in use).
I initiate the hub using the following code:
java -jar selenium-server-standalone-
2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558
When i execute this, it returns the following error messages:
13:42:12.765 INFO - Launching a Selenium Grid node
13:42:13.435 WARN - error getting the parameters from the hub. The node may
end up with wrong timeouts.Connect to 10.146.48.80:4444 [/10.146.48.80]
failed: Connection refused
13:42:13.445 INFO - Java: Oracle Corporation 24.60-b09
13:42:13.445 INFO - OS: Linux 3.10.0-514.21.1.el7.x86_64 amd64
13:42:13.450 INFO - v2.53.0, with Core v2.53.0. Built from revision 35ae25b
13:42:13.521 INFO - Driver provider
org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS,
ensureCleanSession=true, browserName=internet explorer, version=}] does not
match the current platform LINUX
13:42:13.521 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver
registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS,
browserName=MicrosoftEdge, version=}] does not match the current platform
LINUX
13:42:13.521 INFO - Driver class not found:
com.opera.core.systems.OperaDriver
13:42:13.521 INFO - Driver provider com.opera.core.systems.OperaDriver is not
registered
13:42:13.522 INFO - Driver provider org.openqa.selenium.safari.SafariDriver
registration is skipped:
registration capabilities Capabilities [{platform=MAC, browserName=safari,
version=}] does not match the current platform LINUX
13:42:13.523 INFO - Driver class not found:
org.openqa.selenium.htmlunit.HtmlUnitDriver
13:42:13.523 INFO - Driver provider
org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
13:42:13.552 INFO - Version Jetty/5.1.x
13:42:13.553 INFO - Started HttpContext[/selenium-server/driver,/selenium-
server/driver]
13:42:13.553 INFO - Started HttpContext[/selenium-server,/selenium-server]
13:42:13.553 INFO - Started HttpContext[/,/]
13:44:03.596 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler#188fd321
13:44:03.596 INFO - Started HttpContext[/wd,/wd]
13:44:03.599 INFO - Started SocketListener on 0.0.0.0:5555
13:44:03.599 INFO - Started org.openqa.jetty.jetty.Server#a01330f
13:44:03.599 INFO - Selenium Grid node is up and ready to register to the hub
13:44:03.630 INFO - Starting auto registration thread. Will try to register
every 5000 ms.
13:44:03.630 INFO - Registering the node to the hub:
http://10.146.48.80:4444/grid/register
13:44:03.638 INFO - Couldn't register this node: Error sending the
registration request: Connect to 10.146.48.80:4444 [/10.146.48.80] failed:
Connection refused
In the command that you shared viz.,
java -jar selenium-server-standalone-2.53.0.jar -role node –hub http://<myIP>:5786/grid/register -port 5558
You have a copy paste problem. The - before the parameter hub doesn't seem to be a hyphen character.
I was able to deduce this as a possible root cause because the value of -hub is completely being ignored and the default hub port of 4444 is being attempted to use. The stacktrace that you shared re-iterates this
13:42:13.435 WARN - error getting the parameters from the hub. The node may
end up with wrong timeouts.Connect to 10.146.48.80:4444 [/10.146.48.80]
failed: Connection refused
As you can see, even though you are providing your Hub's registration URL to include a port number of 5786, its still picking up 4444 and complaining Connection refused.
Please try typing out the entire command for starting the hub and try again. That should work.

Chrome or Firefox fails to start on selenium node machine if the node is started from a shell script at the startup

I have a shell script to register the node machine to hub at startup.
The script contains:
java -jar ~/selenium/selenium-server.jar -role node -hub http://HUB_IP:4444/grid/register -browser browserName="firefox",maxInstances=5,Platform="LINUX",applicationName="VM_NAME" -browser browserName="chrome",maxInstances=5,Platform="LINUX",applicationName="VM_NAME" -Dwebdriver.chrome.driver=~/selenium/chromedriver
The script starts fine in the startup and even the node gets registered to hub, but, when I start a job from Jenkins its gives below error in case of Firefox:
FAILED CONFIGURATION: #BeforeClass setup
org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
When I start a job from Jenkins its gives below error in case of Chrome:
FAILED CONFIGURATION: #BeforeClass setup
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.13.0-68-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Note:
1. Using later version of chrome, firefox & Selenium jar files
2. When the script is run manually, everything works fine.
3. Start up batch file in windows works fine without any problem.

Internal error occured during launch of waveform

I am running redhawk 1.9 and am trying to lauch a waveform. I get the following error: An internal error occurred during: "Launching FM_Radio_Example".
org.jacorb.orb.ORB cannot be cast to com.sun.corba.se.spi.orb.ORB
The error panel shows the following:
java.lang.ClassCastException: org.jacorb.orb.ORB cannot be cast to com.sun.corba.se.spi.orb.ORB
at com.sun.corba.se.impl.corba.TypeCodeImpl.copy(TypeCodeImpl.java:2017)
at com.sun.corba.se.impl.corba.TypeCodeImpl.copy(TypeCodeImpl.java:2054)
at com.sun.corba.se.impl.corba.TypeCodeImpl.copy(TypeCodeImpl.java:2222)
at com.sun.corba.se.impl.corba.TypeCodeImpl.copy(TypeCodeImpl.java:2234)
at com.sun.corba.se.impl.corba.AnyImpl.write_value(AnyImpl.java:608)
at org.jacorb.orb.CDROutputStream.write_any(CDROutputStream.java:743)
at CF.DataTypeHelper.write(DataTypeHelper.java:79)
at CF.PropertiesHelper.write(PropertiesHelper.java:61)
at CF._ResourceStub.configure(_ResourceStub.java:189)
at gov.redhawk.model.sca.impl.ScaAbstractComponentImpl.configure(ScaAbstractComponentImpl.java:680)
at gov.redhawk.ide.debug.internal.LocalApplicationFactory.configureComponent(LocalApplicationFactory.java:297)
at gov.redhawk.ide.debug.internal.LocalApplicationFactory.configureComponents(LocalApplicationFactory.java:199)
at gov.redhawk.ide.debug.internal.LocalApplicationFactory.create(LocalApplicationFactory.java:158)
at gov.redhawk.ide.debug.internal.ui.LocalWaveformLaunchDelegate.launch(LocalWaveformLaunchDelegate.java:98)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at gov.redhawk.ide.debug.ui.LaunchUtil$1.run(LaunchUtil.java:213)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
I have a device mananger node that when launched I get the following error. It may be related but I am not sure. The library in question is at /root/src/redhawk-src-1.9.0/redhawk/src/base/framework/.libs. I set the environment variable PKG_CONFIG_PATH to this path but that did not help.
INFO:DeviceManager - Starting Device Manager with /nodes/SI9138_Node/DeviceManager.dcd.xml
INFO:DeviceManager_impl - Connecting to Domain Manager REDHAWK_root/REDHAWK_root
INFO:DeviceManager_impl - Child process SI9138_1 (pid 24915) has exited with status 127
/var/redhawk/sdr/dev/devices/SI9138/cpp/SI9138: error while loading shared libraries: libossieidl.so.3: cannot open shared object file: No such file or directory
WARN:DeviceManager_impl - skipping exec param with null value
INFO:DeviceManager - Starting ORB!
INFO:SI9138_Node:GPP_1:Registering Device
INFO:DeviceManager_impl - Registering device GPP_1 on Device Manager SI9138_Node
INFO:DeviceManager_impl - Initializing device GPP_1 on Device Manager SI9138_Node
INFO:DeviceManager_impl - Registering device GPP_1 on Domain Manager
Here is the eclipse/java information:
eclipse.buildId=1.9.0.R201309261648
java.version=1.6.0_30
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86_64
The latest version of openjdk has caused some problems with jacorb. Below are two ways to get around the problem:
Downgrade openjdk and openjdk-devel
$ sudo yum downgrade java-1.6.0-openjdk-devel java-1.6.0-openjdk
Install REDHAWK 1.8.7+ or REDHAWK 1.10+ and launch the IDE at /usr/local/redhawk/ide/1.10/eclipse.

Resources