[SOLVED] (Raspberry Pi 4) openHABian v1.5.0 Error w/ Installing Zulu Embedded OpenJDK

*** Platform information:**

  • Hardware: *Rapberry Pi 4
    *openHABian v1.5.0
    Issue of the topic: Since the release of v1.5.0, I have been excited to install openHAB onto my Raspberry Pi 4. Upon startup, I keep running into the error of:

[FAILED] Failed to Start /etc /rc.local Compatability

Upon further examination, I find that the root of the problem is:

Installing Zulu Embedded OpenJDK…FAILED

I have scoured the repositories for solutions. I found that the Raspberry Pi 3B+ also faced similar issues, which I thought I could apply to my dilemma, to no avail.

Things I have tried:

  1. ‘sudo apt-get update’ and ‘sudo apt-get upgrade’
  2. rebooting several times
  3. reinstalling openHABian v1.5.0 (using Balena Etcher, and a fresh .img.xz file for each reinstall)
  4. Ensured that I was using the official power supply.
  5. Ensured that the SD card was not faulty.
  6. Attempted to use sudo /boot/first-boot.sh

Additional Information: I have not attempted a “headless” setup. I have connected a display, keyboard, the necessary ethernet cable, and the appropriate power cable.

Any and all help is appreciated. I am at the point of desperation now.:sob:

1 Like

Are you sure that’s the exact error message?
Open a GitHub issue and upload /boot/first-boot.log please.

Hi,

I might have similar issues since yesterday.

I’m completely new to openhabian and after a few succesfull installs suddenly i get this error ( whilereinstalling for a fresh start):

[openHABian] Installing Zulu Embedded OpenJDK… FAILED

Looking for information i found it might have to do something with dns.
I have tried just about anything to fix any DNS issues without any luck.

Now at work, i thought i would try it again but i got the same issue. So i thing DNS is not the culprit here. Also considering i have installed it successfully about 3 times at home with the same SD and PI.

I have ran a setup with debugging uncommented and this is what i got from it.

2019-08-06_09:54:06_CEST [openHABian] Installing Zulu Embedded OpenJDK...
$ mkdir -p /var/tmp/jdk-new

$ mkdir -p /opt/jdk

$ wget -nv -O /var/tmp/.zulu.10514
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

$ tar -xpzf /var/tmp/.zulu.10514 -C /var/tmp/jdk-new
tar (child): /var/tmp/.zulu.10514: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
FAILED
2019-08-06_09:54:07_CEST [openHABian] Initial setup exiting with an error!

Perhaps one of the sources is unavailable?

If you think this is unrelated, please let me know, i will open another thread.

My actions:

-Clean SD card.
-Download most recent image: openhabian-pi-raspbian-201908050414-gitca0976f-crc6a66b5a1.img.xz
-Flash to SD with Etcher
-Start setup
-Setup fails with above reasons.

What i tried:

-Setting static ip and DNS servers on the PI.
-Remove /opt/openhab folder (otherwise it would fail on the cloning step)
-Restart setup /boot/first-boot.sh or .bash (most recent image has .bash version)
This results in the same error.

-Starting the Zulu install from the openhabian-config manually, which fails with the above error.

-Updating and upgrading the system does not seem to make a difference in any way.

My hardware: RPI3B with 16gb sd card. (this exact setup worked fine 2 days ago when installing)

Thank you for your time. If you need any more info, i’ll be happy to provide.

  • Jeroen

Hello,

I have the same problem on a Raspberry Pi 3B+ with the lastest openHABian v1.5 release.
Tried with different SD-cards, on different Raspberry Pi’s on different networks, but no solution.
My log with debug info enabled.

$ FireMotD -S
/opt/openhabian/functions/packages.bash: line 44: [: -eq: unary operator expected
OK
$ systemctl stop openhab2.service
Failed to stop openhab2.service: Unit openhab2.service not loaded.
2019-08-06_10:15:57_CEST [openHABian] Installing Zulu Embedded OpenJDK...
$ mkdir -p /var/tmp/jdk-new

$ mkdir -p /opt/jdk

$ wget -nv -O /var/tmp/.zulu.1022
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

$ tar -xpzf /var/tmp/.zulu.1022 -C /var/tmp/jdk-new
tar (child): /var/tmp/.zulu.1022: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
FAILED
2019-08-06_10:15:58_CEST [openHABian] Initial setup exiting with an error!

Looks like more people have this problem? I am happy to provide more data or try things.

Thank you!
Brent

Solution!

Thank you!

I have fixed? my broken install by downloading the tar file from the new source and placing it in /var/tmp then renaming it to .zulu.XXXX found in the log files.

x64: https://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch64.tar.gz

After restarting first-boot the setup continued.

With the fix being merged, is there any way to download a new image with the fix applied?

3 Likes

@Xanox Nice temporary fix!
I saw on GitHub that EliasGabrielsson will make another release (v1.5.1) tonight with the patch implemented.

@Xanox , a newbie question: I hit this issue as well installing the latest openhabian image (downloaded yesterday) on my Raspberry Pi B+. What is the best way for me and others to apply this fix?

Thanks

1 Like

Hello. I think the issue is in the committed file openhabian/functions/java-jre.bash.

line 49

javaPath=$(echo $downloadPath|sed ‘s|http://cdn.azul.com/zulu-embedded/bin/||’)
should be
javaPath=$(echo $downloadPath|sed ‘s|https://cdn.azul.com/zulu-embedded/bin/||’)

cause the url where the zulu package is downloaded is not http but https.

This also prevent on a fresh install to have openhab2 starting (since java is not correctly installed).

Best Regards.

Chic

1 Like

Thank you, @chic. That did it–got past the error and am up and running!
Many Thanks!

1 Like

Just to confirm.

I have just done a fresh install (with the previously failing image) and everything went fine without any special actions required.

Thanks for the quick fix!

3 Likes

Hello. I still have this problem when using the latest image (1.5.0).

I am a total noob when it comes to code (have never even used GitHub, nor have I ever worked with Linux). Yesterday I received my first rpi and thus I am still learning the basics.

After reading this thread I understand that in the file openhabian/functions/java-jre.bash. an “http” should be changed into “https”, but I am totally lost in how to achieve this.

Can anyone give me some pointers, given my 0 experience?

Would be greatly appreciated

Om_ni

1 Like

Hello Koen,

If you download the latest release, it should already be fixed

If not:
Via the command line you have to go to this directory. (cd openhabian/functions/)
Then you have to open the file with a text editor (sudo nano java-jre.bash)
With the arrows of your keyboard, you go to the desired line and change what you need go change.
Press ctrl-X to save and exit.

I recommend doing some tutorials on how to get started with Linux and Raspberry Pi. You’ll learn a lot and make better use of the device.

Hi guys - i have the same problem. Tryed to upgrade my openhab yesterday and it failed and the service stopped working. Because I am not a Linux expert, I did a clean reinstall with Openhabian 1.5.0 and ended up at the same problem everyone here has:

> 2019-10-19_07:49:38_CEST [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-19_07:49:41_CEST [openHABian] Initial setup exiting with an error!

I tried to edit the java-jre.bash file, but mine looks completely different like the one in chic’s post.

Then I went to the Azul website and followed their instructions for installing the Java-JRE manually but that also didn’nt work:

[08:12:35] openhabian@openhab:/opt/openhabian/functions$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
Executing: /tmp/apt-key-gpghome.9wEZbsW7SV/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
gpg: key B1998361219BD9C9: public key "Azul Systems, Inc. (Package signing key.) <pki-signing@azulsystems.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
[08:14:36] openhabian@openhab:/opt/openhabian/functions$ sudo apt-add-repository 'deb http://repos.azulsystems.com/debian stable main'
Traceback (most recent call last):
  File "/usr/bin/apt-add-repository", line 95, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster

I am really confused. Why is it so hard on Linux to install something? And most important… how do I get my openhab working again?

@BrentV thank you for the help, however I have found a different fix.

Multiple people seem to have encountered this very same problem the last couple of days.
The fix can be found here:

This did it for me

Om-ni

1 Like

Same issue for my. Fresh install of openhabian v1.5 on a brand new pi 4. Fix described to far doesn’t work. File looks different and anyways - direct download of java distribution won’t work. So that’s probably the real reason behind that. Sorry to say that - but that’s far away from a “hassle free setup” :frowning_face: I’ve myself some linux experience but my understanding was that openhabian was meant to be an installation for guys how don’t necessarily have (or even want) that.

What a useless pejorative comment as your very first post.
Great start - welcome to openHAB!
You’re free to automate all the stuff yourself to get just a tiny idea of how many efforts are involved in doing so, and maybe - just maybe - come to value developers doing this stuff for free in their spare time.

Yes it’s annoying but that doesn’t make it any easier or quicker to solve.
The problem is not with openHABian but with Azul to change their website very often (maybe because they don’t want anyone to automate downloads?).
We’re working on a solution that is to last. In the meantime see how others work around it.

Hi Ole
I too struggled with this installation on my RaspberryPi.
I was frustrated at first, but realised that this system is far superior to others in the open source space and that there are many dedicated and competent contributors willing to spend their time and effort making this system better.
While it is intended to be as easy as possible to install, this software has to work with many different OS, many different end-user hardware items and many different control software implementations.
See https://www.openhab.org/docs/installation/linux.html
You will see what I mean.
This problem is one small install issue caused by a third party java solution that occurs only on RaspberryPis (I think).
It is fantastic that there are ready and willing helpers out there to assist in solving these problems.
The temporary solution is to edit two files.
As mentioned in other posts on this topic, the long term solution is to update the Java code to use the new APIs.
I am sure that the community would welcome any assistance doing that and providing and arrgh-free install system.

Hi Markus,

no offense meant! I clearly see that there is a lot of work in projects like this - all done by nice people in there sparse free time. I’ve openhab running for serveral years now based on a manual install and wanted to switch to openhabian now for easier maintenance while switching from pi 3 to pi 4.

A small hint on the openhabian download page for raspberry, that installation currently is broken would have helped me (and probably others) a lot in this case, spared some frustration and time on trying to install while it’s currently not possible with the file provided for download. It’s quite clear that openhabian project can’t help it, if external links are broken for whatever reason. Being an IT guy my own I know that even such a small change needs some work (and time) to get properly integrated in a distribution like openhabian, so maybe such a comment on the page is a good idea. After all other people like me might give openhabian a first try (and fails) at the moment and they will definitely get the wrong impression of the whole project by that.

A work around would be nice. And if it’s just a broken link issue that shouldn’t be do difficult - even for linux newbies. However - the workaround I’ve seen so far seems to be based on a different file version of java-jre.bash. Maybe that file is different in the openhabian version for raspbian? Any hint here would be greatly appreciated.

As a workaround I tried to install zulu manually following some other post. That worked only partially. Installation was successful, but the openhabian setup obviously wanted to check for updates first and failed with the same reasons as before.

Ole

1 Like

@mstormi Workaround from danpadure worked for me, too. Openhabian installation now finishes without further issues, and openhab is starting successfully. Awesome! Haven’t noticed the matching lines in java-jre.bash before, but was able to find’em now using search. Further configuration steps will have to wait for the next weekend, but at least the base installation is now finished.

thx
Ole