Satellite 6 update or upgrade fails on pulp-manage-db step with AttributeError: 'NoneType' object has no attribute 'critical'

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.2 or
  • Red Hat Satellite 6.3 or
  • Red Hat Satellite 6.4
  • Red Hat Enterprise Linux 7

Issue

  • Updating or upgrading between Satellite 6 versions fails with "AttributeError: 'NoneType' object has no attribute 'critical'".
[ERROR 2018-02-05 17:43:32 main] Upgrade step migrate_pulp failed. Check logs for more information.
[DEBUG 2018-02-05 17:43:32 main] Exit with status code: 1 (signal was 1)
[ERROR 2018-02-05 17:43:32 main] Errors encountered during run:
[ERROR 2018-02-05 17:43:32 main] Traceback (most recent call last):
  File "/bin/pulp-manage-db", line 9, in <module>
    load_entry_point('pulp-server==2.8.7.18', 'console_scripts', 'pulp-manage-db')()
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 245, in main
    _logger.critical(str(e))
AttributeError: 'NoneType' object has no attribute 'critical'
  • Pulp services fail to start with "AttributeError: 'NoneType' object has no attribute 'critical'".

Resolution

Make sure the systemd-journald service is running:

# systemctl is-active systemd-journald
inactive
# systemctl start systemd-journald
# systemctl is-active systemd-journald
active

Next, re-run the commands you were running for the update or upgrade or for starting Pulp services.

For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.

Root Cause

The pulp-manage-db command fails to instantiate a logger object when the /dev/log socket file is missing. As a result, the command fails to run.

The systemd-journald.service service is responsible for creating the /dev/log socket file. If for any reason systemd-journald.service stops and removes /dev/log then pulp-manage-db will fail to run.

Other Pulp services may fail for the same reason i.e. failure to instantiate a logger object due to a missing /dev/log socket file.

Diagnostic Steps

If this error happens during a Satellite update/upgrade then satellite-installer logs under /var/log/foreman-installer/ will contain a traceback similar to this, with a _logger object being mentioned and the 'NoneType' object has no attribute: <some loglevel>:

[ERROR 2018-02-05 17:43:32 main] Traceback (most recent call last):
  File "/bin/pulp-manage-db", line 9, in <module>
    load_entry_point('pulp-server==2.8.7.18', 'console_scripts', 'pulp-manage-db')()
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 245, in main
    _logger.critical(str(e))
AttributeError: 'NoneType' object has no attribute 'critical'

Make sure /dev/log exists and has the correct permissions:

# ls -lZ /dev/log
srw-rw-rw-. root root system_u:object_r:devlog_t:s0    /dev/log

Restarting the systemd-journald.service is expected to re-create this file and fix the issue.

SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.