Dist-upgrade goes wrong

hello there,

first post & also new to icinga.
i have a setup consisting of:

icinga2 r2.10.5-1
icingaweb2 2.7.1

all running on debian 9 as a hyper v vm.

i tried to upgrade everything to the latest version by using

apt-get update && apt-get dist-upgrade

everything seems to work well until setup is trying to install icinga2-common. it crashes and i end up having an up to date icingaweb2 but no icinga2-common at all.

can anyone give me a little hint on what i did wrong?

thanks in advance!

> root@ICINGA2:/# apt-get -f install
> Paketlisten werden gelesen... Fertig
> Abhängigkeitsbaum wird aufgebaut.
> Statusinformationen werden eingelesen.... Fertig
> Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
>   dbconfig-common icinga2-doc libboost-atomic1.62.0 libboost-chrono1.62.0 libboost-date-time1.62.0 libboost-program-options1.62.0 libboost-regex1.62.0 libboost-system1.62.0 libboost-thread1.62.0 libyajl2
>   php-htmlpurifier
> Verwenden Sie »apt autoremove«, um sie zu entfernen.
> 0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
> 1 nicht vollständig installiert oder entfernt.
> Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
> icinga2-common (2.11.4-1.stretch) wird eingerichtet ...
> Job for icinga2.service failed because the control process exited with error code.
> See "systemctl status icinga2.service" and "journalctl -xe" for details.
> invoke-rc.d: initscript icinga2, action "start" failed.
> ● icinga2.service - Icinga host/service/network monitoring system
>    Loaded: loaded (/lib/systemd/system/icinga2.service; enabled; vendor preset: enabled)
>   Drop-In: /etc/systemd/system/icinga2.service.d
>            └─limits.conf
>    Active: failed (Result: exit-code) since Mon 2020-07-06 15:28:02 CEST; 4ms ago
>   Process: 46270 ExecStart=/usr/sbin/icinga2 daemon --close-stdio -e ${ICINGA2_ERROR_LOG} (code=exited, status=203/EXEC)
>   Process: 46263 ExecStartPre=/usr/lib/icinga2/prepare-dirs /etc/default/icinga2 (code=exited, status=0/SUCCESS)
>  Main PID: 46270 (code=exited, status=203/EXEC)
> 
> Jul 06 15:28:02 ICINGA2 systemd[1]: Starting Icinga host/service/network monitoring system...
> Jul 06 15:28:02 ICINGA2 systemd[1]: icinga2.service: Main process exited, code=exited, status=203/EXEC
> Jul 06 15:28:02 ICINGA2 systemd[1]: Failed to start Icinga host/service/network monitoring system.
> Jul 06 15:28:02 ICINGA2 systemd[1]: icinga2.service: Unit entered failed state.
> Jul 06 15:28:02 ICINGA2 systemd[1]: icinga2.service: Failed with result 'exit-code'.
> dpkg: Fehler beim Bearbeiten des Paketes icinga2-common (--configure):
>  Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
> Fehler traten auf beim Bearbeiten von:
>  icinga2-common
> E: Sub-process /usr/bin/dpkg returned an error code (1)

Hi & welcome,

dpkg: Fehler beim Bearbeiten des Paketes icinga2-common (–configure)

means you have an error in your config files (now). One typical issue is to have zone and endpoint definitions not stored in zones.conf only (which was allowed by V2.10).

Thanks for your reply, Roland!

I forgot to mention, that i am also using the Icinga Director 1.6.0.
Can this be part of the issue? As far as I know, all my zone and endpoint configuration is in
/etc/icinga2/zones.conf

What steps should i take to troubleshoot this further?

thanks for your help!

First step is to check your configuration with

icinga2 daemon -C

And this will tell you more about the root cause.

In general, defining zone and endpoint objects with director is wrong in case of master and satellites. Manually update zones.conf(s) and run kickstart wizard to import/update them in the direcotr. For agents you don’t need to do this manually as it will be completely handled by the director.

1 Like

i tried

icinga2 daemon -C

but i end up getting

>     root@ICINGA2:/# icinga2 daemon -C
>     -bash: icinga2: Kommando nicht gefunden.

when checking my installed versions i noticed, that icinga2-common is up to date, but icinga2-bin and icinga2-ido-mysql are not?

root@ICINGA2:/# dpkg -l | grep icinga
ii  icinga-l10n                          1.0.0-1.stretch                   all          l10n (short for Localization) provides all translations available for Icinga.
rc  icinga2-bin                          2.10.5-1.stretch                  amd64        host and network monitoring system - daemon
iF  icinga2-common                       2.11.4-1.stretch                  all          host and network monitoring system - common files
ii  icinga2-doc                          2.11.4-1.stretch                  all          host and network monitoring system - documentation
rc  icinga2-ido-mysql                    2.10.5-1.stretch                  amd64        host and network monitoring system - MySQL support
ii  icingacli                            2.8.1-1.stretch                   all          simple CLI tool for Icingaweb2 and its modules
ii  icingaweb2                           2.8.1-1.stretch                   all          simple and responsive web interface for Icinga
ii  icingaweb2-common                    2.8.1-1.stretch                   all          simple and responsive web interface for Icinga - common files
ii  icingaweb2-module-doc                2.8.1-1.stretch                   all          simple and responsive web interface for Icinga - documentation module
ii  icingaweb2-module-monitoring         2.8.1-1.stretch                   all          simple and responsive web interface for Icinga - monitoring module
ii  php-icinga

belongs to icinga2-common, means you have to fix that first. And icinga2-bin was removed (as well as icinga2-ido-mysql), means you need to reinstall it again.

i upgraded all the other stuff now first (icingaweb2, director and some other modules)

i still need to upgrade

icinga2 icinga2-bin icinga2-common icinga2-ido-mysql

so basically the whole icinga core - but i was not able to find the reason for the crashing yet.

> root@ICINGA2:/# apt-get dist-upgrade
> Paketlisten werden gelesen... Fertig
> Abhängigkeitsbaum wird aufgebaut.
> Statusinformationen werden eingelesen.... Fertig
> Paketaktualisierung (Upgrade) wird berechnet... Fertig
> Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
>   dbconfig-common icinga2-common icinga2-doc libboost-atomic1.62.0 libboost-chrono1.62.0 libboost-date-time1.62.0 libboost-program-options1.62.0 libboost-regex1.62.0 libboost-system1.62.0 libboost-thread1.62.0 libyajl2 php-htmlpurifier
> Verwenden Sie »apt autoremove«, um sie zu entfernen.
> Die folgenden Pakete werden ENTFERNT:
>   icinga2 icinga2-bin icinga2-ido-mysql
> Die folgenden NEUEN Pakete werden installiert:
>   firmware-linux-free irqbalance libnuma1 linux-image-4.9.0-12-amd64
> Die folgenden Pakete werden aktualisiert (Upgrade):
>   icinga2-common linux-image-amd64
> 2 aktualisiert, 4 neu installiert, 3 zu entfernen und 0 nicht aktualisiert.
> Es müssen 39,5 MB an Archiven heruntergeladen werden.
> Nach dieser Operation werden 179 MB Plattenplatz zusätzlich benutzt.
> Möchten Sie fortfahren? [J/n]

icinga2 icinga2-bin icinga2-ido-mysql are getting deleted but not updated or re-installed.

There is no need to run dist-upgrade it is enough to run apt upgrade. To repair broken packages you could try apt -f install.

apt-get upgrade says, that the packages are getting hold back:

> root@ICINGA2:/# apt-get upgrade
> Paketlisten werden gelesen... Fertig
> Abhängigkeitsbaum wird aufgebaut.
> Statusinformationen werden eingelesen.... Fertig
> Paketaktualisierung (Upgrade) wird berechnet... Fertig
> Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
>   icinga2-doc php-htmlpurifier
> Verwenden Sie »apt autoremove«, um sie zu entfernen.
> **Die folgenden Pakete sind zurückgehalten worden:**
>   **icinga2 icinga2-bin icinga2-common icinga2-ido-mysql linux-image-amd64**
> 0 aktualisiert, 0 neu installiert, 0 zu entfernen und 5 nicht aktualisiert.

You can find the output of apt -f install in my initial post, unfortunately it does not work as well.
Therefore, i tried using apt-get dist-upgrade but end up with deleted packages.

I’d then try to uninstall the whole staff and reinstall everything.

1 Like

Have you pinned anything in /etc/apt/preferences.d/* ?

Antony.

1 Like

there is nothing pinned in /etc/apt/preferences.d/
i will include the whole update terminal output as a .txt here:

update_log.txt (10.3 KB)

when I try to manually reinstall the missing packages after doing the dist-upgrade i get:

> root@ITSM-ICINGA2:~# apt-get install icinga2 icinga2-bin icinga2-common icinga2-ido-mysql linux-image-amd64
> Paketlisten werden gelesen... Fertig
> Abhängigkeitsbaum wird aufgebaut.
> Statusinformationen werden eingelesen.... Fertig
> linux-image-amd64 ist schon die neueste Version (4.9+80+deb9u10).
> icinga2-common ist schon die neueste Version (2.11.4-1.stretch).
> icinga2-common wurde als manuell installiert festgelegt.
> Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dass
> Sie eine unmögliche Situation angefordert haben oder, wenn Sie die
> Unstable-Distribution verwenden, dass einige erforderliche Pakete noch
> nicht erstellt wurden oder Incoming noch nicht verlassen haben.
> Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:
> 
> Die folgenden Pakete haben unerfüllte Abhängigkeiten:
>  icinga2-bin : Hängt ab von: libboost-context1.67.0 ist aber nicht installierbar
>                Hängt ab von: libboost-coroutine1.67.0 ist aber nicht installierbar
>                Hängt ab von: libboost-date-time1.67.0 ist aber nicht installierbar
>                Hängt ab von: libboost-filesystem1.67.0 ist aber nicht installierbar
>                Hängt ab von: libboost-program-options1.67.0 ist aber nicht installierbar
>                Hängt ab von: libboost-regex1.67.0 (>= 1.67.0-10) ist aber nicht installierbar
>                Hängt ab von: libboost-system1.67.0 ist aber nicht installierbar
>                Hängt ab von: libboost-thread1.67.0 ist aber nicht installierbar
> E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.

I found the reason for the issue now: i was missing the debian strecht backports repository.
After adding it and doing an apt-get update I was able to install everything.

1 Like