Bug 746546

Summary: Populating database error.
Product: [Community] Spacewalk Reporter: dylan <dylan.zhang>
Component: InstallationAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.6   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-17 06:55:33 UTC Type: ---
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: 723481    

Description dylan 2011-10-17 03:21:40 UTC
Description of problem:
When i excuted spacewalk-setup several times. The database seems began to fail to work.It just stucked and no errors show up.

* Loading answer file: /home/thomasking/spacewalkanswerfile.
** Database: Setting up database connection for PostgreSQL backend.
** Database: Populating database.
The Database has schema.  Would you like to clear the database [Y]? y
** Database: Clearing database.
NOTICE:  schema "rpm" does not exist, skipping
NOTICE:  schema "rhn_exception" does not exist, skipping
NOTICE:  schema "rhn_quota" does not exist, skipping
NOTICE:  schema "rhn_config" does not exist, skipping
NOTICE:  schema "rhn_server" does not exist, skipping
NOTICE:  schema "rhn_entitlements" does not exist, skipping
NOTICE:  schema "rhn_bel" does not exist, skipping
NOTICE:  schema "rhn_cache" does not exist, skipping
NOTICE:  schema "rhn_channel" does not exist, skipping
NOTICE:  schema "rhn_config_channel" does not exist, skipping
NOTICE:  schema "rhn_org" does not exist, skipping
NOTICE:  schema "rhn_user" does not exist, skipping

these schemas' unexisting is because i execute the spacewalk-setup a second time.
In the first time, it delete all these schemas above. then Stucked.
Because some of the schemas has been deleted, then it shows that they are not existed. And again, it stucked.



Version-Release number of selected component (if applicable):
spacewalk 1.6 postgresql 8.4.7

How reproducible:
     I just execute spacewalk-setup several times, because my tomcat always shows some error. Then the database failed. 
     When i setup a new database with the below words, it seems to be corrected, and works fine.
su - postgres -c 'PGPASSWORD=spacepw; createdb dba ; createlang plpgsql dba ; yes $PGPASSWORD | createuser -P -sDR namea'

     But still, after resetup the spacewalk-setup 2 or 3 times, the problem showed up again.
  
Actual results:
In the populate_db.log, i found nothing.

Expected results:


Additional info:

Comment 1 dylan 2011-10-17 06:51:59 UTC
Note that when i delete the db and db user by typing dropdb and dropdbuser, it works again. so, i am not sure whether there is something wrong about the spacewalk's scripts.

Comment 2 Jan Pazdziora (Red Hat) 2011-10-17 06:55:33 UTC
These are not errors.

You should really investigate the cause that lead to this, which is that something got stuck. Check the PostgreSQL log and see what is the problem in the first place.

Comment 3 dylan 2011-10-17 09:06:30 UTC
Ok, My finding is that:
     The database may not be deleted clearly by spacewalk, since if i deleted the db and db user manuly, it works fine. but if i use the spacewalk script, it stucked.

(In reply to comment #2)
> These are not errors.
> You should really investigate the cause that lead to this, which is that
> something got stuck. Check the PostgreSQL log and see what is the problem in
> the first place.

Comment 4 Jan Pazdziora (Red Hat) 2011-10-17 09:28:30 UTC
(In reply to comment #3)
> Ok, My finding is that:
>      The database may not be deleted clearly by spacewalk, since if i deleted
> the db and db user manuly, it works fine. but if i use the spacewalk script, it
> stucked.

And this is what will need to be investigated, not the fact that you get those notices from subsequent cleanup run.