Bug 964323 - postgresql installation fails when external DB already exists and needs clearing
postgresql installation fails when external DB already exists and needs clearing
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Installation (Show other bugs)
1.10
All Linux
low Severity low
: ---
: ---
Assigned To: Milan Zázrivec
Red Hat Satellite QA List
:
Depends On:
Blocks: space21
  Show dependency treegraph
 
Reported: 2013-05-17 17:08 EDT by Michele Baldessari
Modified: 2014-03-04 08:09 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-04 08:08:21 EST
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 17:08:09 EDT
Description of problem:
When launching spacewalk-setup --disconnected --external-db I get (am using today's nightly rpms on F18):
 spacewalk-setup --disconnected --external-db
** Database: Setting up database connection for PostgreSQL backend.
Could not connect to the database.  Your connection information may be incorrect.  Error: DBI connect('dbname=rhnschema','rhnuser',...) failed: FATAL:  Peer authentication failed for user "rhnuser" at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1683.

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.
DBD::Pg::db do failed: FATAL:  terminating connection due to administrator command
FATAL:  terminating connection due to administrator command at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
DBD::Pg::db do failed: no connection to the server at /usr/share/perl5/vendor_perl/Spacewalk/Setup.pm line 1141, <STDIN> line 6.
** Database: Re-populating database.
*** Progress: #
Could not populate database.

So in order to clear the DB it shuts it down but then loses the connection

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-20 05:14:46 EDT
I assume that you previously had the embedded PostgreSQL installation on that machine and only then changed to the "external" approach (albeit with the PostgreSQL server on the same box).

As a result, your /etc/rhn/service-list likely lists the postgresql database and that's why it got stopped. Could you check the content of /etc/rhn/service-list and see if removing the postgresql record helps?
Comment 2 Michele Baldessari 2013-05-22 15:03:24 EDT
Hi Jan,

that did fix it yes and indeed I did toy with the embedded version before and
yes (see my other two BZs) I did manage to completely miss the https://fedorahosted.org/spacewalk/wiki/PostgreSQLServerSetup guide.

I guess we can close this one out. Do you want me to document these errors in the wiki somewhere?

cheers,
Michele
Comment 3 Jan Pazdziora 2013-05-24 05:33:06 EDT
(In reply to Michele Baldessari from comment #2)
> 
> that did fix it yes and indeed I did toy with the embedded version before and
> yes (see my other two BZs) I did manage to completely miss the
> https://fedorahosted.org/spacewalk/wiki/PostgreSQLServerSetup guide.
> 
> I guess we can close this one out. Do you want me to document these errors
> in the wiki somewhere?

Bugs belong to bugzilla. ;-)

I'd leave this one open -- the developers might want to add removal of the embedded db entry if the subsequent spacewalk-setup run is not the embedded db one.

Thank you, Jan
Comment 4 Milan Zázrivec 2014-01-03 10:07:21 EST
Fixed in spacewalk.git master: abbab01f79d77849763ac21aae268302e197f181
Comment 5 Matej Kollar 2014-01-17 07:16:07 EST
Switching MODIFIED Spacewalk bugs to ON_QA before 2.1 release.
Comment 6 Matej Kollar 2014-03-04 08:08:21 EST
Spacewalk 2.1 has been released.
https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21
Comment 7 Matej Kollar 2014-03-04 08:09:05 EST
Spacewalk 2.1 has been released.
https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21

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