Bug 964315 - Installation fails with external postgres db if postgres user has no "ident" auth rights
Installation fails with external postgres db if postgres user has no "ident" ...
Status: CLOSED NOTABUG
Product: Spacewalk
Classification: Community
Component: Installation (Show other bugs)
1.10
All Linux
low Severity low
: ---
: ---
Assigned To: Jan Pazdziora
Red Hat Satellite QA List
:
Depends On:
Blocks: space27
  Show dependency treegraph
 
Reported: 2013-05-17 16:45 EDT by Michele Baldessari
Modified: 2017-09-28 14:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-05-18 09:02:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michele Baldessari 2013-05-17 16:45:29 EDT
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 2013-05-18 09:02:47 EDT
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 14:09:57 EDT
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.