Description of problem: Against postgresql spacewalk the "spacewalk-hostname-rename" command fails with SQL syntax error. It seems that it uses same sql code for both oracle and postgres. Version-Release number of selected component (if applicable): spacewalk-utils-1.7.15-1.el6.noarch spacewalk-schema-1.7.55-1.el6.noarch How reproducible: always Steps to Reproduce: 1.spacewalk-hostname-rename <ip> Actual results: spacewalk-hostname-rename fails, error msg printed Expected results: spacewalk-hostname-rename succeeds, no errors Additional info: spacewalk-hostname-rename x.x.x.x Validating IP ... OK ============================================= hostname: fqdn ip: x.x.x.x ============================================= Stopping rhn-satellite services ... OK Testing DB connection ... Running: psql -U spaceuser -d spaceschema -v ON_ERROR_STOP=ON -f - -h localhost -p 5432 psql:<stdin>:1: ERROR: syntax error at or near "off" LINE 1: set feed off; ^ FAILED Your database isn't running. Fix the problem and run /usr/bin/spacewalk-hostname-rename again
spacewalk.git master: af92a3dd2101a0b9759ad63f8abfd138089d5c2f
I ran into this too Its the QUIT commands in the sql statments that break it. This diff should break the script in the right so it will work for you. copy the script into your home directory and apply this diff with the patch command It disables the database running check and gets rid of the "QUIT" statements which is the only Oracle specific syntax in the functional portion of the code. unfortunately it will produce errors about the client closing the connection unexpectedly however that's not a really serious problem however i wouldn't try to put it into the core repo because of it. --- spacewalk-hostname-rename.orig 2012-04-04 11:49:42.063065418 -0400 +++ spacewalk-hostname-rename 2012-04-04 11:57:35.000096385 -0400 @@ -331,7 +331,6 @@ UPDATE rhn_sat_cluster SET vip = '$IP' WHERE public_key LIKE '${NOCPULSE_OLD_PUBLIC_KEY}%'; UPDATE rhn_sat_node SET ip = '$IP' WHERE EXISTS (SELECT 1 FROM rhn_sat_cluster RSC WHERE RSC.public_key LIKE '${NOCPULSE_OLD_PUBLIC_KEY}%' AND sat_cluster_id = RSC.recid); COMMIT; -QUIT EOS } @@ -417,7 +416,7 @@ " | spacewalk-sql --select-mode - ) # SQL_RET="${SQL_RET#"${SQL_RET%%[![:space:]]*}"}" -print_status "${SQL_RET}" "Your database isn't running." +#print_status "${SQL_RET}" "Your database isn't running." echo -n "Updating /etc/rhn/rhn.conf ... " | tee -a $LOG update_rhn_conf @@ -450,7 +449,6 @@ UPDATE rhn_config_macro SET definition='$HOSTNAME' WHERE name='RHN_SAT_HOSTNAME'; UPDATE rhn_config_macro SET definition='$HOSTNAME' WHERE name='MDOM'; COMMIT; -QUIT EOS print_status 0 # just simulate end fi @@ -479,7 +477,6 @@ spacewalk-sql --select-mode - >>$LOG <<EOS UPDATE rhntemplatestring SET value='$HOSTNAME' WHERE label='hostname'; COMMIT; -QUIT EOS print_status 0 # just simulate end @@ -493,7 +490,6 @@ spacewalk-sql --select-mode - >>$LOG <<EOS DELETE FROM rhnPushDispatcher WHERE hostname != '$HOSTNAME'; COMMIT; -QUIT EOS for jabber_config_file in c2s.xml s2s.xml sm.xml
*** Bug 842153 has been marked as a duplicate of this bug. ***
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18