Bug 964333
| Summary: | rhn-satellite-activate --disconnect fails because driver_postgresql.py sets host=None instead of host=localhost | ||
|---|---|---|---|
| Product: | [Community] Spacewalk | Reporter: | Michele Baldessari <michele> |
| Component: | Installation | Assignee: | Jan Pazdziora (Red Hat) <jpazdziora> |
| Status: | CLOSED NOTABUG | QA Contact: | Red Hat Satellite QA List <satqe-list> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 1.10 | CC: | jpazdziora |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-05-18 13:14:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1484117 | ||
(In reply to comment #0) > Description of problem: > In my postgresq DB I have "ident" as auth method when using Unix sockets and You PostgreSQL setup is incorrect then -- please consult https://fedorahosted.org/spacewalk/wiki/PostgreSQLServerSetup for the settings that work with Spacewalk. This BZ closed some time during 2.5, 2.6 or 2.7. Adding to 2.7 tracking bug. |
Description of problem: In my postgresq DB I have "ident" as auth method when using Unix sockets and "md5" for anything else. In this scenario, rhn-satellite-activate will fail because /usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py has the following code: class Database(sql_base.Database): """ Class for PostgreSQL database operations. """ def __init__(self, host=None, port=None, username=None, password=None, database=None): if host is None or host == '' or host == 'localhost': self.host = None self.port = None else: self.host = host self.port = port I have host = localhost in /etc/rhn/rhn.conf and the above will try to connect without having set 'host' to anything and the connect will fail due to wrong auth: init.py:179:connect:SQLConnectError: (None, None, 'spacewalk', 'Attempting Re-Connect to the database failed') Traceback (most recent call last): File "/usr/bin/rhn-satellite-activate", line 42, in <module> sys.exit(abs(mod.main() or 0)) File "/usr/lib/python2.7/site-packages/spacewalk/satellite_tools/rhn_satellite_activate.py", line 580, in main rhnSQL.initDB() File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/init.py", line 102, in initDB initDB(backend, host, port, username, password, database) File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/init.py", line 55, in initDB __DB.connect() File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 174, in connect return self.connect(reconnect=0) File "/usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py", line 163, in connect password=self.password) File "/usr/lib64/python2.7/site-packages/psycopg2/init.py", line 179, in connect connection_factory=connection_factory, async=async) SQLConnectError: (None, None, 'spacewalk', 'Attempting Re-Connect to the database failed') If I change the line "if host is None or host == '' or host == 'localhost':" to " if host is None or host == ''": things are fine. Version-Release number of selected component (if applicable): # rpm -qf /usr/lib/python2.7/site-packages/spacewalk/server/rhnSQL/driver_postgresql.py spacewalk-backend-sql-postgresql-1.10.32-1.fc18.noarch