openhab / openhabian

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

openHABian v1.7.4 32bit/64bit install fails... because of Keyboard attached #1702

Closed krikk closed 1 year ago

krikk commented 1 year ago

Issue information:

Fresh install of openHABian v1.7.4 64bit (flashed via etcher to ssd, and booted directly via usb-sata cable) on a raspberry pi 4 8GB. Install fails, with lots of failures, nearly nothing is installed...

the raspi boots fine until i get this screen on the attached screen: image i do not think that this screen is normal? ...i did not press anything, and let it run, i created a maximum debug log

this error seems strange:

+ dpkg-reconfigure --frontend=noninteractive locales
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
+ return 1
+ echo 'FAILED (reconfigure locales)'
FAILED (reconfigure locales)

had a very similar issue when first tried to install "Raspberry Pi OS lite 64bit" ...could not install anything via ssh session until i saw that is was stuck in the locale screen whick locked apt database, and because of that i could not install anything...

Debug information:

first-boot.log openhabian.conf.txt apt_list.txt

System information:

Raspberry Pi 4 8gb 64bit

root@openhabian:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

root@openhabian:~# uname -m
aarch64
krikk commented 1 year ago

i think i found the issue: the new username/password change wizard seems to cause the problem: https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/

after adding an userconf.txt to the /boot partition to omit the wizard it starts to work as it should:

content of userconf.txt for user openhabian and password openhabian (created according to the linked article:) openhabian:$6$3ni4LHlxgHsWvgj5$UgWlWXa2H1n5zJVX.C.Zz34tlkWX3TPA8V87x0k23AyPECdAd4nrTA/ee8GBUyiC1FFImbPCqGGs9LbTL3KYj/

and the working first-boot.log:

first-boot.log

Nykaer commented 1 year ago

Confirmed on rpi4: openhabian@openhabian:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" NAME="Raspbian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye 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

mstormi commented 1 year ago

Fresh install of openHABian v1.7.4 64bit (flashed via etcher to ssd, and booted directly via usb-sata cable)

Flashing to/Booting from anything other than SD is not supported, as aren't problems specific to 64bit or the user wizard (must not use that in openHABian). So don't expect me to debug that for you. If you believe it's a generic problem to affect supported setups too please come up with a PR.

krikk commented 1 year ago

...it would be nice if you at least would read what i wrote, then you would have known that this has nothing to to with the boot medium.... but to make sure i just tried it with a microSD card (on the same raspi, with same os), and as i expected: completely the same BROKEN behaviour... PLEASE read what i wrote in my second comment...

...the install is broken, because of the new keyboard/user change wizard, which is locking the APT database, and because of this all of the openhab installations fail...

...i provided a fix already, but i do not have the knowledge to integrate this in you image... the errors are exactly the same, so i do not provide new logs... (can do this is needed)

...yes i know, supporting novice users sucks... :)

Nykaer commented 1 year ago

...the install is broken, because of the new keyboard/user change wizard, which is locking the APT database, and because of this all of the openhab installations fail...

@krikk is correct. This is the installer that is broken due to upstream changes..

mstormi commented 1 year ago

If the problem is with the upstream then there's nothing we can do about it anyway but wait for the upstream (the foundation) to release a new image or pkg with a fix. And as I said issues specific to 64bit are not supported, that image is just provided as-is. So if you want to use openHAB go for the 32 bit image. I'm not seeing this issue with that image.

krikk commented 1 year ago

the issue also happens with the 32 bit image!! (raspi 4b first revision, 4 gb)

...and this probably won't be fixed upstream, because they did this to strenghen security of the images!! ...read the statement of the raspberry pi OS developers!

the maximum debug log from my test-run with the 32bit image... first-boot_32bit.log

...so plz reopen this issue...

mstormi commented 1 year ago

There actually is no problem with user auth/password setting. Both of your logs show it's passed fine. So the reason your installations fail is unrelated, possibly due to some problem with package dependencies it shows, but that can be due to 64 bit, some upstream packaging issue, or anything you changed. Also, I cannot reproduce that: a fresh install using an unmodified 1.7.4 image works just fine, I can login afterwards with default openhabian credentials. I think you have a misunderstanding. If you had read the docs you would have noticed that openHABian is built to run headless. It is not supposed to be used from the console. You should be able to login from remote. There's nothing wrong with whatever wizard to run on login, working or not. That's just not relevant to the openHABian use case. I do not see any no openHABian problem here so I don't reopen.

krikk commented 1 year ago

1.i know that openhabian is headless.. i only looked on the console after the install progress in webbroswer said finish...

  1. my test was with a unmodified 32 bit image (only modification was to enable max debug)

the problem is that on first boot the dpkg process to reconfigure locales gets started, which causes the apt-database to be locked, which causes the install failures...

the question is why do @Nykaer and me get the error and you do not??

my complete hardware setup: Raspi 4 1. revision, 4gb Sandisk Extrem 64 gb micro SD Logitech Unifiy Adapter for Keyboard+Mouse Dell 24" Monitor

...on which hardware do you test??

...will try to test this on my spare raspi3b+ in the evening...

krikk commented 1 year ago

did the test with the 32bit image on my spare raspberry pi 3b+ and once again it FAILED!

latest openhabian image openhabian-pi-raspios32-202206272122-git852c09c-crced70fd0c.img.xz only modification debug=maximum

my complete hardware setup: Raspi 3b+ 1gb Sandisk Extrem 64 gb micro SD Logitech Unifiy Adapter for Keyboard+Mouse Dell 24" Monitor

first-boot_rpi3plus.log

still no issue??

Larsen-Locke commented 1 year ago

I tried to reproduce but installation worked without problems. (Raspi 4, 8gb, 32bit openhabian, 32gb sd-card)

krikk commented 1 year ago

@Larsen-Locke: which tool did you use to write the image? balenaEtcher or the official Raspberry Pi Imager or something else?

mstormi commented 1 year ago

I tried to reproduce but installation worked without problems. (Raspi 4, 8gb, 32bit openhabian, 32gb sd-card)

just like it did for all those that successfully installed openhabian since the image was released.

@krikk I'm also using a RPi3 for my testing and use the same image. Logs start to differ when apt-get purge --yes raspi-config fails for you due to bad dependencies, this then repeats with OpenJDK and the remainders are follow up problems. Have you tried to unplug the keyboard ? Use Raspi imager ? Maybe some bad apt data cache ? Clean your DNS cache.

I have no idea why.

krikk commented 1 year ago

i suspected that "raspi imager" did something to the image, but just tried it with with belean etcher and the same error... so next try without the keyboard... thats the only thing i did not change...

krikk commented 1 year ago

for hell's sake it's the keyboard... the keyboard breaks the setup, because it somehow detects it, and then it asks the user to configure the keyboard, which is nothing else then running dkpk reconfigure-keyboard ...and this locks the apt database and cause of this nothing is installed...

the used keyboard: ...it's an completly common logitech unifying receiver and an logitech k400+ keyboard...

so DO NOT ATTACH A KEYBOARD! (will try to add this to the docs later)

...i think i owe you a beer, big sorry, but even after 20 years in IT, once again learned something new...

Larsen-Locke commented 1 year ago

@Larsen-Locke: which tool did you use to write the image? balenaEtcher or the official Raspberry Pi Imager or something else?

I used the latest Raspberry Pi imager (but the issue seems to be solved anyway).

@mstormi : In the Raspi Imager you can directly select quite a few Home Automation images but not openhabian. Shouldn't we ask to add the best one? If you agree (and have not tried before) I would try to find out how.

Nykaer commented 1 year ago

for hell's sake it's the keyboard... the keyboard breaks the setup, because it somehow detects it, and then it asks the

This is odd. I did not have a keyboard connected.. I'll dig up a RPI 3B, an have a try as well.

mstormi commented 1 year ago

In the Raspi Imager you can directly select quite a few Home Automation images but not openhabian. Shouldn't we ask to add the best one? If you agree (and have not tried before) I would try to find out how.

@Larsen-Locke yes please. I haven't tried so far.

Larsen-Locke commented 1 year ago

@mstormi It's finished. I just need your help to put the json file online (rpi-imager.json). The issue with the solution is here: https://github.com/openhab/openhabian/issues/1703