After upgrade to OH4 -remote connection refused

Hello Community,

I have been using openhab 3.x (installed via openhabian) since a while now. For testing purposes I have the port 8000 open on my router for easy remote access for testing. So far so good,

Yesterday my raspberry upgraded to openhan 4.0, and since then I can not access the openhab GUI anymore remotely as I used to, also no connection via the Android app.

Any advice?
Thanks!

check the openhab.log file.
check if the port you redirect port 8000 to is open and accepting connections.

You shouldn’t do that without having security measures in place.
Also non standard ports will be found very fast and misused by others to play around with your equipment.

Thanks for your reply.

I am aware that the remote connection via port 8000 is not recommended, I just havnt had the time to change this.

Either way, the only difference from yesterday was nothing else than upgrading to openhab 4, and since then I can not get an remote connection anymore.
Current logfile is showing this:

at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
… 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.openhab.core/4.0.0: missing requirement [org.openhab.core/4.0.0] osgi.ee; filter:=“(&(osgi.ee=JavaSE)(version=17))”
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341) ~[org.eclipse.osgi-3.18.0.jar:?]

Sure that Java 17 is being found as active version ?

I do not have Java 17 as active version, its still trying to install java 11 over and over again.

I spent already quiet some time reading through many many threads of how to set Java 17 as the active version. I tried a lot but nothing has worked so far. I was upgrading from Openhab 3.3, I am unable to wipe the sd card and install openhab 4 from scratch.

So please, if there is someone out there who can provide me with the main steps of how to install and set Java 17 as the active version, would be very very much appreciated.

Thanks Community

According to your first post you are using openhabian.
Have a look at menu entry 45.

You did not state anything about the underlying OS. Which version do you use ( cat /etc/os-release ) ?

In case Java 17 fails to install. The output in the linux console should help. In case it does not provide enough information you need to follow the debug guide of openhabian ( openHABian | openHAB ). Rerunning the menu entry that did not work before should increase the debug messages in the console then.

Underlying OS:

PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster

Using menu 45 shows the following error:
jdk17

My current branch settings
branch

Thank you so much Wolfgang for all your time spent.

same issue, only it went one level worse for me and after asking the system to update it completely doesnt boot now. means i cant access openhabian any more (i lost about 6months of rule and item/thing updates. :frowning: - Java also failing to fetch.

Set
debugmode=maximum
in /etc/openhabian.conf.

Then open openhabian-config again and try to install Java again.
The output should show more verbose information about why the package cannot be installed.
It seems to fail already during download.
Are there any other errrors before this one like an expired server key ?

not even using keyboard and monitor ?

hmmm - good (smarter than me) question. havent tried because i always use it with remote access as it is in a rack - will try but that would mean the network went down. (thanks for tip will revert)

do you by any chance know which folders i would have to tranfer to keep rules and items etc updated across?

The logfile when trying to install Java 17:

  • systemctl stop openhab.service
  • return 0
  • [[ -d /opt/jdk ]]
  • openjdk_install_apt 17
  • dpkg -s openjdk-17-jre-headless
  • openjdk_fetch_apt 17
  • apt-cache show openjdk-17-jre-headless
    ++ timestamp
    ++ printf ‘%(%F_%T_%Z)T\n’ -1
  • echo -n '2023-07-26_16:31:52_CEST [openHABian] Fetching OpenJDK 17… ’
    2023-07-26_16:31:52_CEST [openHABian] Fetching OpenJDK 17… + cond_redirect apt-get install --download-only --yes openjdk-17-jre-headless
  • [[ -n ‘’ ]]
  • echo -e ‘\n\033[90;01m$ apt-get install --download-only --yes openjdk-17-jre-headless \033[39;49;00m’

$ apt-get install --download-only --yes openjdk-17-jre-headless

  • apt-get install --download-only --yes openjdk-17-jre-headless
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

The following packages have unmet dependencies:
openjdk-17-jre-headless : Depends: libc6 (>= 2.29) but 2.28-10+rpt2+rpi1+deb10u2 is to be installed
Depends: libgcc-s1 (>= 3.5) but it is not installable
E: Unable to correct problems, you have held broken packages.

  • return 100
  • echo FAILED
    FAILED
  • return 1
    ++ timestamp
    ++ printf ‘%(%F_%T_%Z)T\n’ -1
  • echo -n '2023-07-26_16:31:55_CEST [openHABian] Installing OpenJDK 17… ’
    2023-07-26_16:31:55_CEST [openHABian] Installing OpenJDK 17… + cond_redirect java_alternatives_reset
  • [[ -n ‘’ ]]
  • echo -e ‘\n\033[90;01m$ java_alternatives_reset \033[39;49;00m’

$ java_alternatives_reset

  • java_alternatives_reset
  • local jdkBin
    ++ find '/opt/jdk//bin’ … -print -quit
    find: ‘/opt/jdk/
    /bin’: No such file or directory
    find: ‘…’: No such file or directory
  • jdkBin=
  • cond_redirect find ‘’ -maxdepth 1 -perm -111 -type f -exec bash -c ‘update-alternatives --quiet --remove-all $(basename {})’ ‘;’
  • [[ -n ‘’ ]]
  • echo -e ‘\n\033[90;01m$ find -maxdepth 1 -perm -111 -type f -exec bash -c update-alternatives --quiet --remove-all $(basename {}) ; \033[39;49;00m’

$ find -maxdepth 1 -perm -111 -type f -exec bash -c update-alternatives --quiet --remove-all $(basename {}) ;

  • find ‘’ -maxdepth 1 -perm -111 -type f -exec bash -c ‘update-alternatives --quiet --remove-all $(basename {})’ ‘;’
    find: ‘’: No such file or directory
  • return 1
  • return 1
  • cond_redirect apt-get install --yes -o DPkg::lock::Timeout= openjdk-17-jre-headless
  • [[ -n ‘’ ]]
  • echo -e ‘\n\033[90;01m$ apt-get install --yes -o DPkg::lock::Timeout= openjdk-17-jre-headless \033[39;49;00m’

$ apt-get install --yes -o DPkg::lock::Timeout= openjdk-17-jre-headless

  • apt-get install --yes -o DPkg::lock::Timeout= openjdk-17-jre-headless
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

The following packages have unmet dependencies:
openjdk-17-jre-headless : Depends: libc6 (>= 2.29) but 2.28-10+rpt2+rpi1+deb10u2 is to be installed
Depends: libgcc-s1 (>= 3.5) but it is not installable
E: Unable to correct problems, you have held broken packages.

  • return 100
  • echo FAILED
    FAILED

/etc/openhab/ contains sub directories with configuration files.
/var/lib/openhab/jsondb/backup should contain backups of json files ( e.g. when setup is done via MainUI )

1 Like

Problem is :

That java version ( openjdk-17 ) is not compatible with your os ( buster ).
openjdk-17 requires Debian 11 / Bullseye.

What hardware do you use ?
In case cat /proc/cpuinfo reports ARMv7 or ARMv8 you should be able to use Azuls java package ( OpenJDK Runtime Environment Zulu17.42+19-CA (build 17.0.7+7 ) )
But as this is deviating from openhabian-config defaults in case of further questions supporter may say that your install is not supported.

yep you are right… the dhcp demon failed for some reason. (this is new for me) - any ideas how to recover it/fix it?

and yes i am on the wrong linux version also just like borchertax so i need to either update the java to the one you mention or do a clean install? what would be the best approach to tranfer everything? backup cli and then clean install and transfer?

does it work after a reboot ? If keyboard is connected you can restart the server.

See Best way to upgrade to bullseye for openhabian

1 Like

It’s port 8080.
Your dependencies issue is because you did not upgrade your OS to buster in time to run openHABian.
There’s more threads on this

dist-upgrade or start over with a fresh install.

1 Like