Initial setup failed on RasPi3B+ due to a Java - Zulu path error

I have the same problem when I try to install Openhabian version on the raspberry.
When will the problem be solved?
Can I install zulu (or copy the installation file) manually (where?) and after restart the automatic installation rebooting the system?
How?

I try with manual installation with openhabian-config but always error.
Thanks.

Ahh, Thank you. it works! I have been struggling on it for days.

Thx for that workaround! Is this reported already as an issue?

it is reported. but since it was a reoccurring issue, they merged it with a similar older issue, which is ā€œclosedā€

thnx ,did ur workaround and updated just fine to 1.8.0_222 using openhabian-config.Just one thingā€¦when i run packages update from openhabian-config it overwrites/updates java again.Why is that?

Well this looks to solve the problem after the raspberry is running (java is finally installed), however the java-jre.bash file is overwritten each time the raspberry is booting meaning the the fist-boot procedure is failing each time.
Which file should be updated to ensure the first boot template is updated?
Note tthat this issue is the same with version 1.4 and 1.5

Thanks
Robert

1 Like

OK here is the current workaround is after initial installation:

  1. Modify the java-jre.bash (take a backup copy)
    1.1 sudo cp java-jre.bash java-jre.bash-ori
    1.2 sudo nano java-jre.bash
    - Find (CtlW): jq -r ā€œ$filterā€
    - Add the following line (be careful for the quotes)
    downloadlink=ā€œhttps://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf.tar.gzā€
    1.3 Save the file (CtlX + Y)

  2. Avoid the boot script to get the template from github (take a backup copy )
    2.1 sudo cp first-boot.bash first-boot.bash-ori
    2.2 sudo nano first-boot.bash
    - Find (CtlW): Cloning Myself
    - Comment the line
    from:
    echo -n "$(timestamp) [openHABian] Cloning myselfā€¦ "
    to:
    ln -sfn /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config
    2.3 Save the file (CtlX + Y)

  3. Reboot the system and wait the full installation by monitoring the console terminalā€¦
    3.2 sudo reboot now
    3.3 ssh to the raspberry
    - You should now see the installed banner:

           Welcome to            __  _____    ____  _
         ____  ____  ___  ____  / / / /   |  / __ )(_)___ _____
        / __ \/ __ \/ _ \/ __ \/ /_/ / /| | / __  / / __ `/ __ \
       / /_/ / /_/ /  __/ / / / __  / ___ |/ /_/ / / /_/ / / / /
       \____/ .___/\___/_/ /_/_/ /_/_/  |_/_____/_/\__,_/_/ /_/
           /_/
               openHAB 2.4.0-1 (Release Build)
    
  4. You may now proceed with the other installation actions
    4.1. DONā€™T DO AN UPDATE , you will overwrite the Functions template again

Hi 4est, this workaround works, but after initial successful install each time the raspberry is booting, fist-boot procedure starting again and again. How to prevent doing this?
Anyway, it is far not hasle free. I am not a develloper, it takes days to me to find the solution. Dissapointedā€¦

It canā€™t be a solution if an update breaks the system. This is not your fault @tramlaan, but I donā€™t understand why Openhab developers donā€™t solve this issue.

It didnā€™t help to me. I still see the first-boot.log when I ssh to the raspberry. :frowning:

I guess for some reason your install does not fully complete.

for other it worked, so you must investigate why it does not for you

There isnā€™t a single entity that is the openHAB developers because openHAB is a open source community project. The error happens because Azul the Zulu provider changed something. But the maintainers of openhabian know about It as there is an issue for this on github you can find here:


Johannes

Didnā€™t you experience the same? It is weird, I did a completely new install without any modifications. As I can see @tramlaan had the same problem, see above.
I have been using Openhab for 3 ages, but I am not familiar with Linux. I just look for some tutorials and read them. This is how I develop, so such a bug can completely stop me. I am not able to investigate such an issue. I think I have to wait until the issue will be resolved. Thak you

If you havenā€™t found a solution yet, Ryan just posted his solution here:

Still no success in reinstallingā€¦

Did @4est changes, but gives error on installing Zulu:
gzip: stdin: unexpected end of file

Hi There. Iā€™m completely new to OpenHab, Pi and Linux ā€“ great combination right :slight_smile:
Iā€™ve download the openhub 1.5 image and am trying to install it on a brand new 4GB pi4 B. I run into the same problem as above.

Excerpt from the installation log:

2019-10-27_16:45:10_CET [openHABian] Downloading and setting up FireMotDā€¦ OK
2019-10-27_16:46:13_CET [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-27_16:46:18_CET [openHABian] Initial setup exiting with an error!

I have tried to fetch the package again, re-flashing the micro-SD card and rerun the installation several times. Have used openHab 1.5 (=latest) and BalenaEtcher 1.5.59 (=latest), running on a Win10 1909 system.

Is this a problem with the Java Zulu somehow, something wrong with the OpenHab 1.5 or something else?

Thanks for all suggestions on how to remedy this problem, so I can start using my Raspberry Pi4

//Nizque

The issue seems to lie with a change of API at Zulu. A capable developer of openHAB would need to adapt the installation script.

It seems like at the moment the error seems to prevent any new installations, especially by people who are not experienced with these things.

Fixes that in return disable the update process do not seem viable to me - thatā€™s something I donā€™t even want to try because I might forget down the road and run into follow-up issues.

I hope there is a fix for this, soon! Cheers and thanks!

1 Like

I agree that the main issue should have to be corrected by the developers and in this case it looks quite easy.
This is only a temporary workaround to finalize an installation

My explanation of the problem.

  1. Since a few days ā€¦ the OpenHAbain 1.x fails at the first installation because the reference to the java repository is missing
    During the first installation the script (/boot/first-boot.bash) gets a set of .bash template files to be executed at first start-up.
    These are copied from the github server and are finally located under /opt/openhabian/functions

ls /opt/openhabian/functions
backup.bash helpers.bats java-jre.bash-ori nodejs-apps.bats packages.bats system.bash-ori
config.bash influxdb+grafana.bash java-jre.bats openhab.bash passwords.bash wifi.bash
ext-storage.bash influxdb+grafana.bats menu.bash openhabian.bash README.md zram.bash
helpers.bash java-jre.bash nodejs-apps.bash packages.bash system.bash zram.bats

  1. The missing information is in the java-jre.bash file which should be corrected as mentioned above by adding the correct place to download the java version
    downloadlink=ā€œhttps://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf.tar.gzā€ (behing double quotes)

  2. Each time the raspberry is booting, and if the first boot was not successful (which is the case due to java), the first-boot.bash scripts download and overwrite the /opt/openhabian/functions
    and therefore the corrected java-jre.bash. Which cause the problem to loop again and again with the same error

  3. So to achieve a correct fist boot we have to avoid that the first-boot.bash from copying the files from the github site after having modify the java-jre.bash file.
    This is the reason of the second modification, which avoid to get the templates from github by commenting the following lines
    #echo -n "$(timestamp) [openHABian] Cloning myselfā€¦ "
    #[ -d /opt/openhabian/ ] && rm -rf /opt/openhabian/ # check if we have remnants of a previous installation attempt.
    #git clone -b master https://github.com/openhab/openhabian.git /opt/openhabian &>/dev/null

    #if [ $? -eq 0 ]; then echo ā€œOKā€; else echo ā€œFAILEDā€; fail_inprogress; fi
    #ln -sfn /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config

  4. You may now reboot the raspberry and the first installation shall be successful

  5. And be ready for the next issue (at my knowledge changing the host name)

Hello, im trying to follow these steps but when i open the file I canā€™t see a line:"# Fetch and copy new JAVA runtime". What should i replace?

This is my 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                                                                             
    if is_aarch64; then
      dpkg --add-architecture armhf
      cond_redirect apt-get update
      cond_redirect apt -y install libc6:armhf libncurses5:armhf libstdc++6:armhf
    fi

    if is_x86_64; then
      dpkg --add-architecture i386
      cond_redirect apt update
      cond_redirect apt -y install libc6:i386 libncurses5:i386 libstdc++6:i386
    fi
        

Thanks

I honestly think you refrained from scrolling down. use the down arrow on your keyboard:
image

Itā€™s there.