I’m having issues connecting to Karaf console. Everything was working correctly in OH 2.1, but when I switched to snapshot I can no longer connect to Karaf console.
If I try ssh -p 8101 openhab@localhost, I get ssh: connect to host localhost port 8101: Connection refused.
I see from nmap localhost that port 8101 is not shown at all.
If I run /usr/share/openhab2/runtime/bin/client I get the following:
mkdir: cannot create directory â/usr/share/openhab2/userdata/tmpâ: No such file or directory
client: Ignoring predefined value for KARAF_HOME
client: KARAF_BASE is not valid: /usr/share/openhab2/userdata
Otherwise, OH is running just fine, status shows Active and all functionality running as normal.
Running Openhabian on an RPi3. Any suggestions on what to try next?
you could try:
shutdown OH2, clear /var/lib/openhab2/tmp/* and /var/lib/openhab2/cache/* and try again
…but… this: client: KARAF_BASE is not valid: /usr/share/openhab2/userdata is not a good message…
somehow the environment variables are not loaded correctly… I don’t know if this will be resolved by clearing tmp & cache… doubtful…
The correct KARAF_BASE = OPENHAB_USERDATA = /var/lib/openhab2/
I doubt deleting cache and tmp will do anything, but you’re welcome to give it a go.
Running the client manually won’t work on an automatic install unless you set OPENHAB_* environments, there’s a new version of /etc/default/openhab2 which shows you what these should be, export them first before trying the client file again to see any possible errors.
Same here with todays snapshot_
> root@pi3:/usr/share/openhab2# ./start_debug.sh
> Launching the openHAB runtime…
> Listening for transport dt_socket at address: 5005
> WARN: file:/usr/share/openhab2/userdata/etc/config.properties is not found, so not loaded
> null
> WARN: file:/usr/share/openhab2/userdata/etc/config.properties is not found, so not loaded
> Error occurred shutting down framework: java.lang.NumberFormatException: null
> java.lang.NumberFormatException: null
> at java.lang.Integer.parseInt(Integer.java:542)
> at java.lang.Integer.parseInt(Integer.java:615)
> at org.apache.karaf.main.ConfigProperties.(ConfigProperties.java:208)
> at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:226)
> at org.apache.karaf.main.Main.main(Main.java:191)
Ben - with the environment variables set, I can now get into Karaf using /client. Thanks!
Any ideas on how to get the service at an open port. There’s no port conflict (at one point I tried to change the port) and no firewall, just not offered at any available ports.
Ok, that’s odd. After connecting using ./client, I went back and tried SSH - both local and remote - and it’s working fine. Not sure what changed, but thanks everyone for their quick responses!!
But I’ll fix that soon, environment variables are being set for the service, but not for the user. To be clear /etc/default/openhab2 is not (and should not be) necessary and you should usually leave it as it is. It’s only there for custom modifications. This is also unrelated to connecting via SSH, which is the main problem in this thread.
@kjunker,I wouldn’t be able to say what happened for sure, the console may have got stuck and using the client may have prompted an unstick. Glad you have it working
After installing the latest snapshot from this point of time, these environment variables will be available to you automatically when you next log on. This will allow you to quickly jump to a path of openHAB without remembering specifics, eg:
just did an apt-get upgrade from 2.1 to the 2.2 stable release. I cannot reach the karaf console via direct ssh anymore. If I ssh on the pi and then go in the console there it is working. Before with 2.1 the karaf console worked fine.
Result for a ssh is “connection refused”. Is it still that problem? Can anyone tell?
set it there (in runtime.cfg) and the setting will propagate to /var/lib/openhab2/etc/org.apache.karaf.shell.cfg
In principle (and as a rule…but there are exceptions): You shouldn’t directly modify files in /var/lib/openhab2/
First time posting anything on this forum. I too get “Connection refused” trying to run ssh -p 8101 openhab@localhost.
When I try to run /usr/share/openhab2/runtime/bin/client I get “Incompatible magic value 3271473854 in class file sun/security/jca/JCAUtil”
I’ve checked/changed sshhost = 0.0.0.0 in …shell.cfg.
Any ideas of what to do ???