Openhabian config error on upgrade system

Is there a way to solve the problem of reinstalling the image on a RasPi4?

Thx, @SibasishPasupalak

This worked for me:

1 Like

Dan, on Githunb you wrote:

change the middle line. this will skip the java selection

But where exactly is ā€œthe middle lineā€ in my bash file?:

#!/usr/bin/env bash
# shellcheck disable=SC2181

## Install best suitible java version depending on platform.
## Valid argument choose between: 64-bit, 32-bit
##
##    java_install_and_update(String arch)
##
java_install_or_update(){
  # Make sure we don't overwrite existing none Java Zulu installations
  if ! [ -x "$(command -v java)" ] || [[ ! "$(java -version)" == *"Zulu"* ]]; then
    cond_redirect systemctl stop openhab2.service

    if [ "$1" == "64-bit" ]; then
      if is_x86_64; then
        java_zulu_enterprise_8_apt
      else
        if java_zulu_tar_update_available; then
          java_zulu_8_tar 64-bit
        fi
      fi

    else # Default to 32-bit installation
      if java_zulu_tar_update_available; then
          java_zulu_8_tar 32-bit
      fi
    fi
    cond_redirect systemctl start openhab2.service
  fi
}

## Install Java Zulu 8 from direct from fetched .TAR file
## Valid argument choose between: 64-bit, 32-bit
##
##    java_zulu_8_tar(String arch)
##
java_zulu_8_tar(){
  local link
  local jdkTempLocation
  local jdkInstallLocation
  local jdkBin
  local jdkLib
  local jdkArch
  local jdkSecurity
  if [ "$1" == "32-bit" ]; then
    echo -n "$(timestamp) [openHABian] Installing Java Zulu 32-Bit OpenJDK... "
    if is_arm; then
      link="$(fetch_zulu_tar_url "arm-32-bit-hf")";
      jdkArch="aarch32"
    else
      link="$(fetch_zulu_tar_url "x86-32-bit")";
      jdkArch="i386"
    fi

A Big Thanx @4est! That was a quick Fix !

1 Like

Thanx To @4est

I posted 3 lines. you only have to change the middle one. I only posted the lines before & after so you can search for it.

Ahh ofcouseā€¦ Sorry I misunderstoodā€¦ Have changed it now.
Unfortunaly it doesnt seem I have a /boot/first-boot.bash (neither a first-boot.sh).
So IĀ“m a bit stuck here.

@Kim_Andersen, best is to start over from a fresh image. Boot the rasp and wait until the first time install stopped. SSH into your rasp and the you will see that both files are still there. Change both files and reboot. That worked for me!

If you would off rebooted after the first unsuccesfull install, without changing the first-boot.bash, the first-boot.bash will be gone. That was at least my experience.

Succes,
Mario

I took the chance - Without editing the first-boot.bash I entered openhabian-config and ran the #02. It succeded installing openhab 2.5M4 without any problems, (beside quite a few errors and warning when starting openhab again, but that seems to be common).
After a empty cache/tmp and a few restarts, everything seems to be working.

Hello Kim,
Iā€™m complete new in openhab. And also it is more or less my first time working with an raspi. I could not find the mentioned code lines in the bash file. There is nothing mentioned from java.

Iā€™m now trying to setup the openhab on a raspi 4.

Could you give me any further support how to find.

Would be great

Thx

Jochen

Maybe post your bash file in here. IĀ“m sure we can find what youĀ“re looking forā€¦

In the meanwile I found the code lines in the bashfile.
After the first failed setup of openhab i put in

sudo nano /opt/openhabian/functions/java-jre.bash

to open the file.

Then I changed


filter='.[] | select(.category_slug == "java-8-lts") | select(.latest == 1) | select(.packaging_slug == "jdk") | select(.arch_slug == "'$1'") | .["bundles"] | .[] | select(.extension == "tar.gz") | .["link"]$

into

filter='.[] | select(.category_slug == "java-8-lts") | select(.packaging_slug == "jdk")|  select(.arch_slug == "arm-32-bit-hf") | .["bundles"] | .[] | select(.extension == "tar.gz") | .["link"]'

and safe the file.

The I checkt the file if the line is still there.

In the next step I reboot the raspberry. again with a fail.

After reopen the file. It is again the original version.

I believe this is due to the step 2 you have to do, (remark the 3 lines in first-boot.bash from this link:)

Same problem for me after doing the openhabian-config upgrade

$ systemctl stop openhab2.service
openjdk version ā€œ1.8.0_222ā€
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)
2019-10-22_15:27:09_CEST [openHABian] Installing Java Zulu 32-Bit OpenJDKā€¦
$ wget -nv -O /tmp/openhabian.3NOg4/zulu8.tar.gz
http://: Invalid host name.

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
FAILED

Maybe iā€™ll wait for the v1.5.1 and try again with a fresh image

Same here as OP, was following a tutoring off YT so none of the ā€œfixesā€ on here make sense to me lol

2019-10-20_14:15:24_AEST [openHABian] Installing Java Zulu 32-Bit OpenJDKā€¦
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
FAILED
2019-10-20_14:15:28_AEST [openHABian] Initial setup exiting with an error!

2019-10-20_14:15:24_AEST [openHABian] Installing Java Zulu 32-Bit OpenJDKā€¦
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
FAILED
2019-10-20_14:15:28_AEST [openHABian] Initial setup exiting with an error!

Same here.

Hi all.
Thanks for the nice piece of software !!!

Sadly I get the same error:
$ wget -nv -O /tmp/openhabian.nIg7D/zulu8.tar.gz
http://: Invalid host name.

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
FAILED

I guess I once had it run through with the upper tips, however the automatic reset to FAILED is quite de-motivating.

An extremely important point here is the the /boot/first-boot.bash file will attempt to re-clone the git image on top of the changes when you do the reboot. If you complete the installation in openhabian-setup and reboot, the system will fail on the zulu java step (at least it does for me). Therefore, I completed the install in openhabian-setup after making the change above (downloadlink=ā€¦) and prior to the reboot, I altered the /boot/first-boot.bash commenting out the line starting with ā€œgit cloneā€. Since the install was completed by the openhabian-setup, thereā€™s no need to git clone again. None of this is permanent if thereā€™s a new distribution released but hopefully by then the zulu install will be repaired. Thanks for the post John.

I hade the same Zulu update problem. I changed the files as described and documented what I changed. However I missed to document the what I had before :frowning:

Each update via openhab-config is updating Zulu again. What I need to change in the setting to get a normal behavior again?

Thx Martin

$ java_install_or_update
openjdk version ā€œ1.8.0_222ā€
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)

$ systemctl stop openhab2.service

openjdk version ā€œ1.8.0_222ā€
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)
2019-12-17_10:01:17_CET [openHABian] Installing Java Zulu 32-Bit OpenJDKā€¦

$ wget -nv -O /tmp/openhabian.0KZZU/zulu8.tar.gz https://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf.tar.gz

2019-12-17 10:02:11 URL:https://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf.tar.gz [175560479/175560479] -> ā€œ/tmp/openhabian.0KZZU/zulu8.tar.gzā€ [1]
$ update-alternatives --remove-all java
$ update-alternatives --remove-all javac
$ update-alternatives --install /usr/bin/java java /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/java 1083000
update-alternatives: /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/java wird verwendet, um /usr/bin/java (java) im automatischen Modus bereitzustellen
$ update-alternatives --install /usr/bin/javac javac /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/javac 1083000
update-alternatives: /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/javac wird verwendet, um /usr/bin/javac (javac) im automatischen Modus bereitzustellen

$ wget -nv -O /tmp/openhabian.9g2b4/crypto.zip http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip
2019-12-17 10:03:08 URL:http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip [12181/12181] -> ā€œ/tmp/openhabian.9g2b4/crypto.zipā€ [1]
$ unzip /tmp/openhabian.9g2b4/crypto.zip -d /tmp/openhabian.9g2b4

Archive: /tmp/openhabian.9g2b4/crypto.zip
creating: /tmp/openhabian.9g2b4/ZuluJCEPolicies/
inflating: /tmp/openhabian.9g2b4/ZuluJCEPolicies/LICENSE
inflating: /tmp/openhabian.9g2b4/ZuluJCEPolicies/README.txt
inflating: /tmp/openhabian.9g2b4/ZuluJCEPolicies/DISCLAIMER
inflating: /tmp/openhabian.9g2b4/ZuluJCEPolicies/local_policy.jar
inflating: /tmp/openhabian.9g2b4/ZuluJCEPolicies/US_export_policy.jar
OK
$ systemctl start openhab2.service

@marker I have the same issue too.Did u find a solution?