Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPM Installation and removal fails on CentOS 8 #160

Open
ablackrw opened this issue Jan 27, 2021 · 1 comment
Open

RPM Installation and removal fails on CentOS 8 #160

ablackrw opened this issue Jan 27, 2021 · 1 comment

Comments

@ablackrw
Copy link

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:

  • /usr/lib/python2.7/site-packages
  • /usr/lib/python3.6/site-packages
  • /usr/lib/python3.7/site-packages
    In contrast, the postinst script selects between the following directories:
  • /usr/lib/python3/site-packages/pdagent
  • /usr/lib/python2.7/site-packages/pdagent
  • /usr/lib/python2.6/site-packages/pdagent
    Of the above directories, only hosts using python2.7 will successfully install.

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
Copy link

rphull commented May 17, 2023

Noticing the same for RHEL9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants