ovh / beamium

Prometheus to Warp10 metrics forwarder
Other
84 stars 21 forks source link

dpkg configure failed on Debian 10 #114

Open AvailCat opened 5 years ago

AvailCat commented 5 years ago
$ sudo apt install beamium
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libsensors-config libsensors5 libsgutils2-2 lsscsi noderig ovh-rtm-binaries sg3-utils sysstat
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  beamium
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,986 kB of archives.
After this operation, 6,824 kB of additional disk space will be used.
Selecting previously unselected package beamium.
(Reading database ... 56694 files and directories currently installed.)
Preparing to unpack .../beamium_2.0.5-buster_amd64.deb ...
Warning: The home dir /opt/beamium you specified can't be accessed: No such file or directory
Adding system user `beamium' (UID 103) ...
Adding new group `beamium' (GID 112) ...
Adding new user `beamium' (UID 103) with group `beamium' ...
Not creating home directory `/opt/beamium'.
Unpacking beamium (2.0.5-buster) ...
Setting up beamium (2.0.5-buster) ...
Unit beamium.service could not be found.
Failed to start beamium.service: Unit beamium.service not found.
dpkg: error processing package beamium (--configure):
 installed beamium package post-installation script subprocess returned error exit status 5
Processing triggers for systemd (241-7~deb10u1) ...
Errors were encountered while processing:
 beamium
E: Sub-process /usr/bin/dpkg returned an error code (1)

I see it says "/opt/beamium can't be accessed", and "not creating home directory /opt/beamium", but it was here. And beamium.service really doesn't exist.

$ ls -lah /opt/
total 16K
drwxr-xr-x 1 root    root     48 Sep 29 11:29 .
drwxr-xr-x 1 root    root    216 Sep 28 02:46 ..
drwxr-xr-x 1 beamium beamium   0 Feb 11  2018 beamium
drwx--x--x 1 root    root     12 Sep 29 01:36 containerd
drwxr-xr-x 1 root    root     18 Sep 29 11:10 noderig
AvailCat commented 5 years ago

Install successes after manual create a systemd service file in /etc/systemd/system/beamium.service, it looks like this file is missing or miss configure in package?

There still more issue was shown in the logs, but maybe it's rtm tool's issue...

# apt install ovh-rtm-metrics-toolkit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  beamium libsensors-config libsensors5 libsgutils2-2 lsscsi noderig ovh-rtm-binaries sg3-utils sysstat
Suggested packages:
  lm-sensors isag
The following NEW packages will be installed:
  beamium libsensors-config libsensors5 libsgutils2-2 lsscsi noderig ovh-rtm-binaries ovh-rtm-metrics-toolkit sg3-utils sysstat
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.2 MB/12.2 MB of archives.
After this operation, 35.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://debian.mirrors.ovh.net/debian buster/main amd64 libsensors-config all 1:3.5.0-3 [31.6 kB]
Get:2 http://debian.mirrors.ovh.net/debian buster/main amd64 libsensors5 amd64 1:3.5.0-3 [52.6 kB]        
Get:3 http://debian.mirrors.ovh.net/debian buster/main amd64 libsgutils2-2 amd64 1.44-1 [112 kB]
Get:4 http://debian.mirrors.ovh.net/debian buster/main amd64 lsscsi amd64 0.30-0.1 [49.7 kB]         
Get:5 http://debian.mirrors.ovh.net/debian buster/main amd64 sg3-utils amd64 1.44-1 [837 kB]               
Get:6 http://debian.mirrors.ovh.net/debian buster/main amd64 sysstat amd64 12.0.3-2 [562 kB]                
Get:7 https://last-public-ovh-metrics.snap.mirrors.ovh.net/debian buster/main amd64 noderig all 2.5.3-buster.117 [3,696 kB]          
Get:8 https://last-public-ovh-rtm.snap.mirrors.ovh.net/debian buster/main amd64 ovh-rtm-binaries all 1.0.4-buster [4,844 kB]         
Get:9 https://last-public-ovh-rtm.snap.mirrors.ovh.net/debian buster/main amd64 ovh-rtm-metrics-toolkit all 1.0.7 [4,214 B]
Fetched 10.2 MB in 1s (8,610 kB/s)                  
Preconfiguring packages ...
Selecting previously unselected package libsensors-config.
(Reading database ... 56407 files and directories currently installed.)
Preparing to unpack .../0-libsensors-config_1%3a3.5.0-3_all.deb ...
Unpacking libsensors-config (1:3.5.0-3) ...
Selecting previously unselected package libsensors5:amd64.
Preparing to unpack .../1-libsensors5_1%3a3.5.0-3_amd64.deb ...
Unpacking libsensors5:amd64 (1:3.5.0-3) ...
Selecting previously unselected package libsgutils2-2.
Preparing to unpack .../2-libsgutils2-2_1.44-1_amd64.deb ...
Unpacking libsgutils2-2 (1.44-1) ...
Selecting previously unselected package lsscsi.
Preparing to unpack .../3-lsscsi_0.30-0.1_amd64.deb ...
Unpacking lsscsi (0.30-0.1) ...
Selecting previously unselected package sg3-utils.
Preparing to unpack .../4-sg3-utils_1.44-1_amd64.deb ...
Unpacking sg3-utils (1.44-1) ...
Selecting previously unselected package sysstat.
Preparing to unpack .../5-sysstat_12.0.3-2_amd64.deb ...
Unpacking sysstat (12.0.3-2) ...
Selecting previously unselected package beamium.
Preparing to unpack .../6-beamium_2.0.5-buster_amd64.deb ...
Warning: The home dir /opt/beamium you specified can't be accessed: No such file or directory
Adding system user `beamium' (UID 103) ...
Adding new group `beamium' (GID 112) ...
Adding new user `beamium' (UID 103) with group `beamium' ...
Not creating home directory `/opt/beamium'.
Unpacking beamium (2.0.5-buster) ...
Selecting previously unselected package noderig.
Preparing to unpack .../7-noderig_2.5.3-buster.117_all.deb ...
Unpacking noderig (2.5.3-buster.117) ...
Selecting previously unselected package ovh-rtm-binaries.
Preparing to unpack .../8-ovh-rtm-binaries_1.0.4-buster_all.deb ...
Unpacking ovh-rtm-binaries (1.0.4-buster) ...
Selecting previously unselected package ovh-rtm-metrics-toolkit.
Preparing to unpack .../9-ovh-rtm-metrics-toolkit_1.0.7_all.deb ...
Unpacking ovh-rtm-metrics-toolkit (1.0.7) ...
Setting up libsgutils2-2 (1.44-1) ...
Setting up libsensors-config (1:3.5.0-3) ...
Setting up beamium (2.0.5-buster) ...
Setting up noderig (2.5.3-buster.117) ...
Setting up lsscsi (0.30-0.1) ...
Setting up libsensors5:amd64 (1:3.5.0-3) ...
Setting up sysstat (12.0.3-2) ...
update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode
Setting up sg3-utils (1.44-1) ...
Setting up ovh-rtm-binaries (1.0.4-buster) ...
Checking for lsiutil ...
Checking for mpt-status ...
Setting up ovh-rtm-metrics-toolkit (1.0.7) ...
Checking and removing legacy rtm crontab
Checking and removing legacy rtm directory
deploy rtm script to noderig external collector directory
Configuring noderig
noderig configuration done
Not running
Starting noderig
Started
Configuring beamium
beamium have no sinks
beamium configuration done
[ ok ] Restarting beamium (via systemctl): beamium.service.
Init RTM ...
Processing triggers for systemd (241-7~deb10u1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10) ...
root@box:/etc# cd /var/log/beamium
root@box:/var/log/beamium# cat beamium.log 
Sep 29 12:05:43.856 INFO fetch success, scraper: source1, uri: http://127.0.0.1:9100/metrics
Sep 29 12:05:43.858 ERRO fetch failed, scraper: source1, error: error trying to connect: Connection refused (os error 111)
Sep 29 12:05:51.870 INFO Beamium halted!

# systemctl status noderig
● noderig.service - LSB: Prometheus to Warp10 metrics forwarder
   Loaded: loaded (/etc/init.d/noderig; generated)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)
AvailCat commented 5 years ago

After dig into deb package, i see there is a service file in /lib/systemd/system, but also a /etc/systemd/system/beamium file linked to /dev/null

# ls -lah /etc/systemd/system | grep beam
lrwxrwxrwx 1 root root   9 Sep 28 02:50 beamium -> /dev/null

I don't know why it comes here, i have never create that file manually, maybe this file will cause dpkg configure fails?

slurdge commented 5 years ago

I have the same problem on debian 9

sblaisot commented 4 years ago

Same under ubuntu bionic.

This is an uninstallation problem (i.e. you encounter this bug only after beamium has been installed a first time with success then uninstalled and you try to isntall it again).

Fix is:

rm /etc/systemd/system/beamium
rm /etc/systemd/system/multi-user.target.wants/beamium.service
rm /var/lib/systemd/deb-systemd-helper-enabled/beamium.service.dsh-also
rm /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/beamium.service
rm /var/lib/systemd/deb-systemd-helper-masked/beamium
apt-get install beamium
sblaisot commented 4 years ago

Steps to reproduce

  1. Start from a fresh debian or ubuntu
  2. apt-get install beamium ==> OK
  3. apt-get purge beamium ==> OK
  4. mkdir /opt ==> to workaround #120
  5. apt-get install beamium ==> FAIL due to beamium systemd files left behind by uninstallation.