openhab / openhabian

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

clonebranch=stable install into OH2 fails #1628

Closed mstormi closed 2 years ago

mstormi commented 3 years ago

first-boot.log of my reproduction: first-boot.log

Installer stops on samba but already fails for openhab2 packages. Probably related to the repo in use. @BClark09 is openhab2.list from your package ?

+ ohPkgName=openhab2
+ [[ stable == \u\n\s\t\a\b\l\e ]]
+ [[ stable == \s\t\a\b\l\e ]]
+ introText='You are about to install or change to the latest stable openHAB2 release.\n\nPlease be aware that downgrading from a newer un
stable snapshot build is not officially supported. Please consult with the documentation or community forum and be sure to take a full ope
nHAB configuration backup first!'
+ successText='The stable release of openHAB2 is now installed on your system.\n\nPlease test the correct behavior of your setup. You migh
t need to adapt your configuration, if available. If you made changes to the files in '\''/var/lib/openhab2'\'' they were replaced, but yo
u can restore them from backup files next to the originals.\n\nCheck the "openHAB Release Notes" and the official announcements to learn a
bout additons, fixes and changes.'
+ repo='deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main'
+ [[ stable == \u\n\s\t\a\b\l\e ]]
+ [[ stable == \s\t\a\b\l\e ]]
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-12-02_17:37:49_CET [openHABian] Beginning install of latest openHAB2 release (stable)... '
2021-12-02_17:37:49_CET [openHABian] Beginning install of latest openHAB2 release (stable)... + [[ -n '' ]]
+ echo OK
OK
+ running_in_docker
+ grep -qs 'docker\|lxc' /proc/1/cgroup
+ [[ -f /.dockerenv ]]
+ return 1
+ [[ -z '' ]]
+ add_keys https://openhab.jfrog.io/artifactory/api/gpg/key/public
+ local repoKey
++ mktemp /tmp/openhabian.XXXXX
+ repoKey=/tmp/openhabian.T9YGZ
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-12-02_17:37:49_CET [openHABian] Adding required keys to apt... '
2021-12-02_17:37:49_CET [openHABian] Adding required keys to apt... + cond_redirect wget -qO /tmp/openhabian.T9YGZ https://openhab.jfrog.i
o/artifactory/api/gpg/key/public
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ wget -qO /tmp/openhabian.T9YGZ https://openhab.jfrog.io/artifactory/api/gpg/key/public \033[39;49;00m'

$ wget -qO /tmp/openhabian.T9YGZ https://openhab.jfrog.io/artifactory/api/gpg/key/public
+ wget -qO /tmp/openhabian.T9YGZ https://openhab.jfrog.io/artifactory/api/gpg/key/public
+ return 0
+ cond_redirect apt-key add /tmp/openhabian.T9YGZ
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ apt-key add /tmp/openhabian.T9YGZ \033[39;49;00m'

$ apt-key add /tmp/openhabian.T9YGZ
+ apt-key add /tmp/openhabian.T9YGZ
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
+ return 0
+ echo OK
OK
+ rm -f /tmp/openhabian.T9YGZ
+ rm -f '/etc/apt/sources.list.d/openhab2*.list'
+ echo 'deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main'
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-12-02_17:37:51_CET [openHABian] Installing selected openHAB version... '
2021-12-02_17:37:51_CET [openHABian] Installing selected openHAB version... + cond_redirect apt-get update
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ apt-get update \033[39;49;00m'

$ apt-get update
+ apt-get update
E: Conflicting values set for option Signed-By regarding source https://openhab.jfrog.io/artifactory/openhab-linuxpkg/ stable: /usr/share/
keyrings/openhab.gpg !=
E: The list of sources could not be read.
+ return 100
+ echo 'FAILED (update apt lists)'
FAILED (update apt lists)
+ return 1
ecdye commented 3 years ago

Are you using a recent image or an old one? Also is it because of the repo change?

mstormi commented 3 years ago

1.7.1 Build #784 clonebranch=stable (obviously) or what do you mean by "repo change" ?

mstormi commented 3 years ago

So where is openhab2.list from ?

[18:40:23] root@openhabian:/var/lib/openhab2# apt-get update
E: Conflicting values set for option Signed-By regarding source https://openhab.jfrog.io/artifactory/openhab-linuxpkg/ stable: /usr/share/keyrings/openhab.gpg !=
E: The list of sources could not be read.
[18:40:27] root@openhabian:/var/lib/openhab2# cd /etc/apt/sources.list.d/
[18:40:35] root@openhabian:/etc/apt/sources.list.d# ls
comitup.list  nodesource.list  openhab2.list  openhab.list  raspi.list  vscode.list
[18:40:35] root@openhabian:/etc/apt/sources.list.d# ls -l op*
-rw-r--r-- 1 root root  70 Dec  2 17:37 openhab2.list
-rw-r--r-- 1 root root 114 Dec  1 18:34 openhab.list
[18:40:43] root@openhabian:/etc/apt/sources.list.d# cat openhab2.list
deb https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main
[18:40:47] root@openhabian:/etc/apt/sources.list.d# cat openhab.list
deb [signed-by=/usr/share/keyrings/openhab.gpg] https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main
[18:40:51] root@openhabian:/etc/apt/sources.list.d# mv openhab2.list /var/tmp
[18:41:00] root@openhabian:/etc/apt/sources.list.d# !ap
apt-get update
Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:3 http://davesteele.github.io/comitup/repo comitup InRelease
Get:4 https://deb.nodesource.com/node_12.x bullseye InRelease [4,586 B]
Hit:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Get:6 https://deb.nodesource.com/node_12.x bullseye/main armhf Packages [777 B]
Fetched 5,363 B in 4s (1,473 B/s)
Reading package lists... Done
[18:41:17] root@openhabian:/etc/apt/sources.list.d#
ecdye commented 3 years ago

Furthermore, does it matter, we don't support new OH2 installs do we?

mstormi commented 3 years ago

Furthermore, does it matter, we don't support new OH2 installs do we?

yeah but if fixing is as easy as that I would

mstormi commented 2 years ago

I also noticed

sed: can't read /opt/openhabian/includes/webserver/install-complete.html: No such file or directory

Trouble is that the first-boot.bash code executed for clonebranch=stable is part of the image hence contains what main (not stable) contained at the time of build (it doesn't get overwritten by stable repo contents before it is executed). Ethan you once introduced includes/* subdirectories (like "webserver") to main/openHAB3 in commit 288de33d8f9c92967206c576ef20a74709b83d1f (tag: v1.6.5)

Could you replay that commit against stable ?

ecdye commented 2 years ago

Not sure, I made that change a while back it may be difficult to apply now.

mstormi commented 2 years ago

did you have a look and tried?

ecdye commented 2 years ago

Sorry I completely forgot about this. I'll try to get to it next week and report back

ecdye commented 2 years ago

Should be fixed now, I didn't move all the directories but I moved the web server ones as they should be the only ones affected

mstormi commented 2 years ago

test install went fine, web server was available during install