it-novum / openitcockpit-agent-go

Cross-Platform Monitoring Agent for openITCOCKPIT written in Go
https://openitcockpit.io/download_agent/
Apache License 2.0
5 stars 2 forks source link

apt repo installation of agent openitcockpit-agent_3.0.10_amd64.deb fails #79

Closed javierspn closed 8 months ago

javierspn commented 1 year ago

Hi!

Agent Mode: [x] Pull Model (openITCOCKPIT Server request data from Agent) [ ] Push Model (Agent send data to openITCOCKPIT)

Versions openITCOKPIT Server Version: 4.6.2 openITCOCKPIT Monitoring Agent Version: 3.0.10

Operating system Linux Debian Bullseye 11.6 AMD64

Describe the bug I installed the official debian package from the official repo yesterday. The server is installed on a virtual machine. I had to rollback the VM to a previous snapshot.

I uninstalled the agent from the agent host. After using apt remove open....etc files are left on /etc/openitcockpit-agent and /var/log/openitcockpit-agent; I removed those manually.

Then I executed apt autoremove and apt purge.

Once I install the agent with apt, the following error triggers:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  openitcockpit-agent
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 9,927 kB of archives.
After this operation, 20.3 MB of additional disk space will be used.
Get:1 https://packages.openitcockpit.io/openitcockpit-agent/deb/stable deb/main amd64 openitcockpit-agent amd64 3.0.10 [9,927 kB]
Fetched 9,927 kB in 5s (2,150 kB/s)                         
Selecting previously unselected package openitcockpit-agent.
(Reading database ... 51257 files and directories currently installed.)
Preparing to unpack .../openitcockpit-agent_3.0.10_amd64.deb ...
Unpacking openitcockpit-agent (3.0.10) ...
Setting up openitcockpit-agent (3.0.10) ...
Failed to start openitcockpit-agent.service: Unit openitcockpit-agent.service not found.
dpkg: error processing package openitcockpit-agent (--configure):
 installed openitcockpit-agent package post-installation script subprocess returned error exit status 5
Errors were encountered while processing:
 openitcockpit-agent
E: Sub-process /usr/bin/dpkg returned an error code (1)

To Reproduce Steps to reproduce the behavior:

  1. Add repositories as per https://openitcockpit.io/download_agent/ (Ubuntu/Debian "From repository" section)
  2. apt-update
  3. apt install openitcockpit-agent
  4. See error

Expected behavior APT installs the agent properly

Screenshots Screenshot_20230319_122355

Additional context NOTE: same error on two machines, same OS.

nook24 commented 1 year ago

Unfortunately I was not able to reproduce this on my end. The installation works fine with Debian 11.6 on DigitalOcean and a Docker Container.

Here is my result: asciicast

I installed the official debian package from the official repo yesterday. The server is installed on a virtual machine. I had to rollback the VM to a previous snapshot.

Would be interesting to know, what the first error was, that let you restore your system.

I uninstalled the agent from the agent host. After using apt remove open....etc files are left on /etc/openitcockpit-agent and /var/log/openitcockpit-agent; I removed those manually.

If you use apt-get remove the configuration files will be not removed by the system. From the man page of apt-get:

       remove
           remove is identical to install except that packages are removed instead of installed.
           Note that removing a package leaves its configuration files on the system. If a plus
           sign is appended to the package name (with no intervening space), the identified
           package will be installed instead of removed.

       purge
           purge is identical to remove except that packages are removed and purged (any
           configuration files are deleted too).

I'm not sure about this one

dpkg: error processing package openitcockpit-agent (--configure):
 installed openitcockpit-agent package post-installation script subprocess returned error exit status 5
Errors were encountered while processing:
 openitcockpit-agent
E: Sub-process /usr/bin/dpkg returned an error code (1)

You should execute the postinst script directly as root user to get more information about the error /var/lib/dpkg/info/openitcockpit-agent.postinst.

The postinst.sh isn't doing much that could fail: https://github.com/it-novum/openitcockpit-agent-go/blob/main/build/package/postinst.sh#L11-L51

nook24 commented 8 months ago

Inactive