Bug 964315 - Installation fails with external postgres db if postgres user has no "ident" auth rights
Summary: Installation fails with external postgres db if postgres user has no "ident" ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Spacewalk
Classification: Community
Component: Installation
Version: 1.10
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jan Pazdziora (Red Hat)
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2013-05-17 20:45 UTC by Michele Baldessari
Modified: 2017-09-28 18:09 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-18 13:02:47 UTC
Embargoed:


Attachments (Terms of Use)

Description Michele Baldessari 2013-05-17 20:45:29 UTC
Description of problem:
Playing with today's nightly rpms (rainy evening..I know), I have created a user+db for spacewalk in postgres. After launching:
# spacewalk-setup --disconnected --external-db
** Database: Setting up database connection for PostgreSQL backend.

Hostname (leave empty for local)? localhost
Port [5432]? 
Database? spacewalk
Username? spacewalk
Password? 
** Database: Populating database.
The Database has schema.  Would you like to clear the database [Y]? 
** Database: Clearing database.
** Database: Shutting down spacewalk services that may be using DB.
** Database: Services stopped.  Clearing DB.
** Database: Re-populating database.
*** Progress: ########################
Could not populate database.

Log file at /var/log/rhn/populate_db.log gave me:

psql:/etc/sysconfig/rhn/postgres/deploy.sql:42485: ERROR:  could not establish connection
DETAIL:  fe_sendauth: no password supplied

CONTEXT:  SQL statement "SELECT dblink_connect('at_conn', 'dbname=' || current_database() || ' port=' || coalesce(inet_server_port(), '5432'))"
PL/pgSQL function pg_dblink_exec(character varying) line 6 at PERFORM
SQL statement "SELECT pg_dblink_exec(
                'insert into rhnPackageName(id, name) values (' || name_id || ', ' ||
                coalesce(quote_literal(name_in), 'NULL') || ')')"
PL/pgSQL function lookup_package_name(character varying,numeric) line 17 at PERFORM

So I realized that in /var/lib/pgsql/data/pg_hba.conf I had for some reason:
local   all             all                                     md5

instead of:
local   all             all                                     ident

No biggie really, but it might be nice to check for postgres user access before starting if it cannot be avoided.

Version-Release number of selected component (if applicable):
postgresql-contrib-9.2.4-1.fc18.x86_64
spacewalk-setup-embedded-postgresql-1.10.1-1.fc18.noarch
spacewalk-backend-sql-postgresql-1.10.32-1.fc18.noarch
postgresql-server-9.2.4-1.fc18.x86_64
postgresql-libs-9.2.4-1.fc18.x86_64
postgresql-jdbc-9.2.1002-1.fc18.noarch
spacewalk-postgresql-1.9.2-1.fc18.noarch
spacewalk-java-postgresql-1.10.76-1.fc18.noarch
postgresql-9.2.4-1.fc18.x86_64

Comment 1 Jan Pazdziora (Red Hat) 2013-05-18 13:02:47 UTC
You don't need the full

   local all all ident

privileges, the

   local spaceschema postgres ident

is enough. We list that as a required pg_hba.conf configuration on the page

   https://fedorahosted.org/spacewalk/wiki/PostgreSQLServerSetup

Comment 2 Eric Herget 2017-09-28 18:09:57 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.


Note You need to log in before you can comment on or make changes to this bug.