OSBN/Ubuntuusers Planet XING / LinkedIn / Amazon

Short tip: Updating Pulp database after upgrading Katello

After upgrading Katello recently, I stumbled upon the following error when accessing the administration interface:

Katello_ErrorThe web server protocol told me that a database update might causes this issue:

# tail /var/log/httpd/foreman-ssl_error_ssl.log
[Wed Aug 17 09:42:51.536914 2016] [:error] [pid 3178] [remote] mod_wsgi (pid=3178): Target WSGI script '/usr/share/pulp/wsgi/webservices.wsgi' cannot be loaded as Python module.
[Wed Aug 17 09:42:51.536946 2016] [:error] [pid 3178] [remote] mod_wsgi (pid=3178): Exception occurred processing WSGI script '/usr/share/pulp/wsgi/webservices.wsgi'.
[Wed Aug 17 09:42:51.536960 2016] [:error] [pid 3178] [remote] Traceback (most recent call last):
[Wed Aug 17 09:42:51.536971 2016] [:error] [pid 3178] [remote]   File "/usr/share/pulp/wsgi/webservices.wsgi", line 19, in <module>
[Wed Aug 17 09:42:51.536993 2016] [:error] [pid 3178] [remote]     application = wsgi_application()
[Wed Aug 17 09:42:51.537000 2016] [:error] [pid 3178] [remote]   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 117, in wsgi_application
[Wed Aug 17 09:42:51.537010 2016] [:error] [pid 3178] [remote]     raise e
[Wed Aug 17 09:42:51.537026 2016] [:error] [pid 3178] [remote] InitializationException: The database has not been migrated to the current version. Run pulp-manage-db and restart the application.

To update the Pulp database, it is necessary to run the pulp-manage-db utility as Apache user. This also requires changing the login shell temporarily:

# chsh -s /bin/bash apache
Changing shell for apache.
Shell changed.
# runuser -l apache -c pulp-manage-db
Attempting to connect to localhost:27017
Attempting to connect to localhost:27017
Write concern for Mongo connection: {}
Loading content types.
Loading type descriptors []
Parsing type descriptors
Validating type descriptor syntactic integrity
Validating type descriptor semantic integrity
Database migrations complete.
# chsh -s /sbin/nologin apache
Changing shell for apache.
Shell changed.

Afterwards, the user interface behaved like before.

Sharing is caring

Leave a Reply

Your email address will not be published. Required fields are marked *