PagerDuty / pdagent

The PagerDuty Agent is a program that lets you easily integrate your monitoring system with PagerDuty.
http://www.pagerduty.com/docs/guides/agent-install-guide/
Other
33 stars 29 forks source link

RPM Installation and removal fails on CentOS 8 #160

Open ablackrw opened 3 years ago

ablackrw commented 3 years ago

I am running a CentOS 8.3.2011 system on which I am attempting to install the PagerDuty Agent. However, problems were encountered both during the installation and the removal process. During installation, the postinst script appears to fail at line 68 with the following message:

chmod: cannot access '/usr/lib/python3/site-packages/pdagent/root_certs': No such file or directory
warning: %post(pdagent-1.7.3-1.noarch) scriptlet failed, exit status 1

As a result of this failure, the startup script for the service fails to deploy, and the service is not started. The cause of this problem is the version detection logic in lines 58-65. As found in makepkg.sh:106-110, the directories bundled into the RPM are as follows:

During removal, the prerm script appears to fail at line 43 with the following message:

  File "<string>", line 1
    import platform; print platform.python_version()
                                  ^
SyntaxError: invalid syntax
error: %preun(pdagent-1.7.3-1.noarch) scriptlet failed, exit status 1

Because the preflight checks fail, it is not possible to gracefully uninstall the RPM using yum. The purpose behind this logic (specifically line 59) appears to be the removal of the compiled python libraries, performed at postinst:71. A fix for this would be to use the version detection logic from postinst:58-65 in place of the version present in prerm:43-48, once the version in postinst is corrected. However, this doesn't take into consider the possibility of the default version of python being switched post installation. As such, the 'correct' fix would be to remove all .pyc files from all three installation directories.

rphull commented 1 year ago

Noticing the same for RHEL9