openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
821 stars 252 forks source link

Java uninstalled by openhabian-config #1609

Closed marcusb closed 2 years ago

marcusb commented 2 years ago

Issue information:

After running openhabian-config and selecting menu option "02 Upgrade System", it offered to update Java, and I accepted. This led to it removing the JRE and failing to install the new Zulu version. I am left with a non-functional system without a JRE.

2021-10-30_21:59:03_EDT [openHABian] Installing Java Zulu prerequisites (libc, libstdc++, zlib1g)... OK                                                                                             
2021-10-30_21:59:08_EDT [openHABian] Downloading Java Zulu 11 32-Bit OpenJDK... FAILED (download)
find: ‘/opt/jdk/*/bin’: No such file or directory
find: ‘...’: No such file or directory
find: ‘/opt/jdk/*/lib’: No such file or directory
find: ‘...’: No such file or directory
2021-10-30_21:59:11_EDT [openHABian] Installing Java Zulu 11 32-Bit OpenJDK... OK
2021-10-30_21:59:11_EDT [openHABian] Installing Java Zulu CEK to enable unlimited cipher strength... FAILED (download)                                                                              
2021-10-30_21:59:12_EDT [openHABian] Somewhere, somehow, something went wrong and Java has not been installed. Until resolved, openHAB will be broken.                                              
OK

System information:

Raspberry Pi 4 openHABian 3.1.0

openhabian@habpi:~ $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
marcusb commented 2 years ago

Looking into this, the problem is that the Java package it's trying to download returns a 502 response:

openhabian@habpi:~ $ wget 'https://cdn.azul.com/zulu-embedded/bin/zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf.tar.gz'
--2021-10-30 22:11:06--  https://cdn.azul.com/zulu-embedded/bin/zulu11.52.13-ca-jdk11.0.13-linux_aarch32hf.tar.gz
Resolving cdn.azul.com (cdn.azul.com)... 104.18.20.159, 104.18.21.159
Connecting to cdn.azul.com (cdn.azul.com)|104.18.20.159|:443... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2021-10-30 22:11:06 ERROR 502: Bad Gateway.

However by then the script has already deleted the previous Java version. It would be safer to delete it only after a successful download.

marcusb commented 2 years ago

(For those affected, a workaround is to switch to AdoptOpenJDK - menu option "40 openHAB related".)

ecdye commented 2 years ago

You are correct that it would probably be safer to wait to remove until after successful download, I will try and see if that can be arranged. However, I believe that the issue is primarily caused by Azul in this case as it is their API/CDN that is failing not openHABian's code.