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

firemotd update fails from openhabian-config #1612

Closed wrosenauer closed 2 years ago

wrosenauer commented 2 years ago

Issue information:

While trying to update/upgrade my openhabian I also tried to "apply improvements". This includes an update of firemotd but this fails with an error.

Debug information:

The relevant information seems to be

$ FireMotD -G Gray 
+ FireMotD -G Gray
You specified a non-existant option: -G
+ return 2
+ echo FAILED
FAILED
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "10 | Apply Improvements"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80

System information:

openhabian@smart-controller:~ $ 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"

ecdye commented 2 years ago

Please set the debugmode in /etc/openhabian.conf to maximum and try to run it again. Then report back and share the full log so I can understand why it is failing because the -G flag is a supported FireMotD option.

wrosenauer commented 2 years ago
+ firemotd_setup
+ running_in_docker
+ [[ -n '' ]]
+ grep -qs 'docker\|lxc' /proc/1/cgroup
+ [[ -f /.dockerenv ]]
+ return 1
+ running_on_github
+ [[ -n '' ]]
+ return 1
+ local firemotdDir=/opt/FireMotD
+ dpkg -s bc sysstat jq moreutils make
+ firemotd_download /opt
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-11-08_16:19:17_CET [openHABian] Downloading FireMotD... '
2021-11-08_16:19:17_CET [openHABian] Downloading FireMotD... + [[ -d /opt/FireMotD ]]
+ cond_echo '\nUpdate... '
+ [[ -z '' ]]
+ echo -e '\033[33;01m\nUpdate... \033[39;49;00m'

Update... 
+ cond_redirect update_git_repo /opt/FireMotD master
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ update_git_repo /opt/FireMotD master \033[39;49;00m'

$ update_git_repo /opt/FireMotD master 
+ update_git_repo /opt/FireMotD master
+ local branch
+ local path
+ branch=master
+ path=/opt/FireMotD
++ timestamp
++ date +%F_%T_%Z
++ basename /opt/FireMotD
+ echo -n '2021-11-08_16:19:17_CET [openHABian] Updating FireMotD, master branch from git... '
2021-11-08_16:19:17_CET [openHABian] Updating FireMotD, master branch from git... + cond_redirect git -C /opt/FireMotD fetch origin
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ git -C /opt/FireMotD fetch origin \033[39;49;00m'

$ git -C /opt/FireMotD fetch origin 
+ git -C /opt/FireMotD fetch origin
+ return 0
+ cond_redirect git -C /opt/FireMotD fetch --tags --force --prune
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ git -C /opt/FireMotD fetch --tags --force --prune \033[39;49;00m'

$ git -C /opt/FireMotD fetch --tags --force --prune 
+ git -C /opt/FireMotD fetch --tags --force --prune
+ return 0
+ cond_redirect git -C /opt/FireMotD reset --hard origin/master
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ git -C /opt/FireMotD reset --hard origin/master \033[39;49;00m'

$ git -C /opt/FireMotD reset --hard origin/master 
+ git -C /opt/FireMotD reset --hard origin/master
HEAD is now at b203d61 PhpMaxMemory check
+ return 0
+ cond_redirect git -C /opt/FireMotD clean --force -x -d
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ git -C /opt/FireMotD clean --force -x -d \033[39;49;00m'

$ git -C /opt/FireMotD clean --force -x -d 
+ git -C /opt/FireMotD clean --force -x -d
+ return 0
+ cond_redirect git -C /opt/FireMotD checkout master
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ git -C /opt/FireMotD checkout master \033[39;49;00m'

$ git -C /opt/FireMotD checkout master 
+ git -C /opt/FireMotD checkout master
Already on 'master'
Your branch is up to date with 'origin/master'.
+ return 0
+ echo OK
OK
+ return 0
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-11-08_16:19:20_CET [openHABian] Installing FireMotD... '
2021-11-08_16:19:20_CET [openHABian] Installing FireMotD... + cond_redirect make --always-make --directory=/opt/FireMotD install
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ make --always-make --directory=/opt/FireMotD install \033[39;49;00m'

$ make --always-make --directory=/opt/FireMotD install 
+ make --always-make --directory=/opt/FireMotD install
make: Entering directory '/opt/FireMotD'
cp FireMotD /usr/local/bin/FireMotD
chmod 755 /usr/local/bin/FireMotD
make: Leaving directory '/opt/FireMotD'
+ return 0
+ cond_redirect make --always-make --directory=/opt/FireMotD bash_completion
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ make --always-make --directory=/opt/FireMotD bash_completion \033[39;49;00m'

$ make --always-make --directory=/opt/FireMotD bash_completion 
+ make --always-make --directory=/opt/FireMotD bash_completion
make: Entering directory '/opt/FireMotD'
cp bash_completion.d/FireMotD /etc/bash_completion.d/FireMotD
make: Leaving directory '/opt/FireMotD'
+ return 0
+ echo OK
OK
++ timestamp
++ date +%F_%T_%Z
+ echo -n '2021-11-08_16:19:20_CET [openHABian] Generating FireMotD theme... '
2021-11-08_16:19:20_CET [openHABian] Generating FireMotD theme... + cond_redirect FireMotD -S -d -D all
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ FireMotD -S -d -D all \033[39;49;00m'

$ FireMotD -S -d -D all 
+ FireMotD -S -d -D all
+ return 0
+ cond_redirect FireMotD -G Gray
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ FireMotD -G Gray \033[39;49;00m'

$ FireMotD -G Gray 
+ FireMotD -G Gray
You specified a non-existant option: -G
+ return 2
+ echo FAILED
FAILED
+ return 1
+ '[' 1 -ne 0 ']'
+ whiptail --msgbox 'There was an error or interruption during the execution of:\n  "10 | Apply Improvements"\n\nPlease try again. If the error persists, please read /opt/openhabian/docs/openhabian-DEBUG.md or https://github.com/openhab/openhabian/blob/main/docs/openhabian-DEBUG.md how to proceed.' 14 80
+ return 0
wrosenauer commented 2 years ago

I do not see any -G option in the version of FireMotD installed on my system

ecdye commented 2 years ago

I don't know why, but your system is pulling a commit from OutsideIT/FireMotD from several years ago https://github.com/OutsideIT/FireMotD/commit/b203d61a5d9381c832366a183e863214fac4a614. Try completely deleting /opt/FireMotD and installing again.

wrosenauer commented 2 years ago

[17:29:19] root@smart-controller:/opt/FireMotD# git remote -v origin https://github.com/ThomDietrich/FireMotD.git (fetch) origin https://github.com/ThomDietrich/FireMotD.git (push)

wrosenauer commented 2 years ago

Ok, my openhabian installation is older and I guess when I installed it years ago it was fetching that one. The update case in firemotd_download does not check the origin but just only tries to update apparently.

wrosenauer commented 2 years ago

Removed and reinstalled. The error is gone. Not sure if you want to deal with such an update case. If not, please feel free to close.

ecdye commented 2 years ago

Yeah, it was intentional. I'll just dismiss this edge case as it was from a very old installation.