NCPA 3.0.1 on Debian Linux – update/re-install issue

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
madmachinery
Posts: 10
Joined: Wed Jan 31, 2024 1:07 pm

NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by madmachinery »

I'm running this build of Debian 10:
4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_64 GNU/Linux

We were running 'apt upgrade' and NCPA got stuck indefinitely:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  ncpa
1 upgraded, 0 newly installed, 0 to remove and 56 not upgraded.
1 not fully installed or removed.
Need to get 26.2 MB of archives.
After this operation, 75.7 MB of additional disk space will be used.
Get:1 https://repo.nagios.com/deb/buster  ncpa 3.0.1-latest-1 [26.2 MB]
Fetched 26.2 MB in 3s (7,678 kB/s)
Reading changelogs... Done
(Reading database ... 174392 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.1-latest-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service

Progress: [ 20%] [####################..................................................................................]
No change after 24 hours, so I killed the apt process as well as the following command which also seemed stuck:
grep -Fq ncpa_listener
Based on some other threads in this forum, I tried the following troubleshooting steps:
# apt install --reinstall ncpa
The output and result were identical; got stuck and had to kill processes again.
Some other commands and outputs:
# dpkg -s ncpa

Code: Select all

Package: ncpa
Status: purge reinstreq half-installed
Priority: extra
Section: alien
Architecture: amd64
Version: 3.0.1-latest-1
# dpkg -C ncpa

Code: Select all

The following packages are in a mess due to serious problems during
installation.  They must be reinstalled for them (and any packages
that depend on them) to function properly:
 ncpa                 (no description available)

The following packages are missing the list control file in the
database, they need to be reinstalled:
 ncpa                 (no description available)

The following packages are missing the md5sums control file in the
database, they need to be reinstalled:
 ncpa                 (no description available)
The following one got me stuck yet again:
# dpkg -i --force-overwrite /var/cache/apt/archives/ncpa_3.0.1-latest-1_amd64.deb

Code: Select all

(Reading database ... 174392 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.1-latest-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service
Next I removed and purged the package:
# apt remove --purge ncpa

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  ncpa
0 upgraded, 0 newly installed, 1 to remove and 56 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 174391 files and directories currently installed.)
Removing ncpa (3.0.1-latest-1) ...
Then I tried to install the package again and I'm back at the start with the same issue:
# apt install ncpa

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ncpa
0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.
Need to get 26.2 MB of archives.
After this operation, 75.7 MB of additional disk space will be used.
Get:1 https://repo.nagios.com/deb/buster  ncpa 3.0.1-latest-1 [26.2 MB]
Fetched 26.2 MB in 4s (6,371 kB/s)
Selecting previously unselected package ncpa.
(Reading database ... 174392 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.1-latest-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service
No matter what, it seems like the package installer is trying to find and kill the ncpa_listener process, which is not running, and remains grepping indefinitely.
Last edited by madmachinery on Mon Mar 04, 2024 4:50 pm, edited 1 time in total.
bbahn
Posts: 112
Joined: Thu Jan 12, 2023 5:42 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by bbahn »

Hello @madmachinery,

Sorry to hear that you are having this issue. I have filed a bug report on the NCPA github and will take a look when I get a chance.

https://github.com/NagiosEnterprises/ncpa/issues/1103
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
madmachinery
Posts: 10
Joined: Wed Jan 31, 2024 1:07 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by madmachinery »

Thank you!
bbahn
Posts: 112
Joined: Thu Jan 12, 2023 5:42 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by bbahn »

If this is still an issue for you, you can use dpkg --audit to find what errors are occurring with dpkg.

You can also try to automatically fix apt using apt --fix-broken install. The --fix-missing tag might also be useful.
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
madmachinery
Posts: 10
Joined: Wed Jan 31, 2024 1:07 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by madmachinery »

Hello @bbahn,

I tried your suggestions but unfortunately I'm still stuck.

% sudo dpkg --audit
This seemed to have the same results as when I previously ran 'dpkg -C ncpa'.

Code: Select all

The following packages are in a mess due to serious problems during
installation.  They must be reinstalled for them (and any packages
that depend on them) to function properly:
 ncpa                 (no description available)

The following packages have been triggered, but the trigger processing
has not yet been done.  Trigger processing can be requested using
dselect or dpkg --configure --pending (or dpkg --triggers-only):
 libc-bin             GNU C Library: Binaries

The following packages are missing the list control file in the
database, they need to be reinstalled:
 ncpa                 (no description available)

The following packages are missing the md5sums control file in the
database, they need to be reinstalled:
 ncpa                 (no description available)
% sudo apt --fix-broken install

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ncpa
The following packages will be upgraded:
  ncpa
1 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.
1 not fully installed or removed.
Need to get 0 B/26.2 MB of archives.
After this operation, 75.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 174392 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.1-latest-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service

Progress: [ 20%] [####################..................................................................................]
% sudo apt --fix-missing install

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  ncpa
The following packages will be upgraded:
  ncpa
1 upgraded, 0 newly installed, 0 to remove and 89 not upgraded.
1 not fully installed or removed.
Need to get 0 B/26.2 MB of archives.
After this operation, 75.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 174392 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.1-latest-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service

Progress: [ 20%] [####################..................................................................................]
Checking running processes always reveals a 'grep' process that is running in perpetuity.
bbahn
Posts: 112
Joined: Thu Jan 12, 2023 5:42 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by bbahn »

It seems you're encountering issues around these lines:

Code: Select all

    service --status-all 2>&1 | grep -Fq 'ncpa_listener' && service ncpa_listener stop &> /dev/null || true
    service --status-all 2>&1 | grep -Fq 'ncpa_passive' && service ncpa_passive stop &> /dev/null || true
Could you try running

Code: Select all

service --status-all 2>&1 | grep -Fq 'ncpa_listener'
to see what it returns?
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
madmachinery
Posts: 10
Joined: Wed Jan 31, 2024 1:07 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by madmachinery »

bbahn wrote: Tue Mar 05, 2024 11:38 am Could you try running

Code: Select all

service --status-all 2>&1 | grep -Fq 'ncpa_listener'
to see what it returns?
Unfortunately, this command also seems to 'hang' indefinitely.

I thought I finally had some success here with the following:
apt remove --purge ncpa

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  ncpa*
0 upgraded, 0 newly installed, 1 to remove and 46 not upgraded.
After this operation, 75.9 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 174118 files and directories currently installed.)
Removing ncpa (3.0.2-1) ...
Processing triggers for libc-bin (2.28-10+deb10u2) ...
(Reading database ... 173931 files and directories currently installed.)
Purging configuration files for ncpa (3.0.2-1) ...
dpkg: warning: while removing ncpa, directory '/usr/local/ncpa/var' not empty so not removed
dpkg: warning: while removing ncpa, directory '/usr/lib/systemd/system' not empty so not removed
Processing triggers for systemd (241-7~deb10u10) ...
apt install ncpa

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ncpa
0 upgraded, 1 newly installed, 0 to remove and 46 not upgraded.
Need to get 0 B/26.4 MB of archives.
After this operation, 75.9 MB of additional disk space will be used.
Selecting previously unselected package ncpa.
(Reading database ... 173923 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.2-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service
Went back to hanging indefinitely on this.

I killed all related processes and I'm now running your command in screen so that I can come back to it later. I'll reply with any updates.
bbahn
Posts: 112
Joined: Thu Jan 12, 2023 5:42 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by bbahn »

Try running apt with verbose output, so we can get some more information on where things are failing instead of just a vague idea of where things are getting stuck.

Code: Select all

sudo apt-get -o Debug::pkgProblemResolver=yes -o Debug::Acquire::http=yes install ncpa
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
madmachinery
Posts: 10
Joined: Wed Jan 31, 2024 1:07 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by madmachinery »

bbahn wrote: Fri Mar 29, 2024 1:22 pm Try running apt with verbose output, so we can get some more information on where things are failing instead of just a vague idea of where things are getting stuck.
apt-get -o Debug::pkgProblemResolver=yes -o Debug::Acquire::http=yes install ncpa

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following packages will be upgraded:
  ncpa
1 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.
1 not fully installed or removed.
Need to get 0 B/26.4 MB of archives.
After this operation, 75.9 MB of additional disk space will be used.
Reading changelogs... Done
(Reading database ... 173923 files and directories currently installed.)
Preparing to unpack .../ncpa_3.0.2-1_amd64.deb ...
Try to stop services with systemctl
Try to stop services with service
:(
ps auxw | grep ncpa

Code: Select all

root      3797  0.3  0.1  69016 59436 pts/11   S+   14:50   0:00 apt-get -o Debug::pkgProblemResolver=yes -o Debug::Acquire::http=yes install ncpa
root      3839  0.1  0.1  45624 39892 pts/19   Ss+  14:50   0:00 /usr/bin/dpkg --status-fd 39 --no-triggers --unpack --auto-deconfigure /var/cache/apt/archives/ncpa_3.0.2-1_amd64.deb
root      4069  0.0  0.0   6072   764 pts/19   S+   14:50   0:00 grep -Fq ncpa_listener
kg2857
Posts: 237
Joined: Wed Apr 12, 2023 5:48 pm

Re: NCPA 3.0.1 on Debian Linux – update/re-install issue

Post by kg2857 »

Maybe kill the ncpa service processes and rerun the upgrade.
Post Reply