Bug 843466 - spacewalk-hostname-rename failed in only IPv6 enviroment
Summary: spacewalk-hostname-rename failed in only IPv6 enviroment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 550
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Pavel Studeník
URL:
Whiteboard:
Depends On:
Blocks: sat550-ipv6
TreeView+ depends on / blocked
 
Reported: 2012-07-26 12:11 UTC by Pavel Studeník
Modified: 2012-09-21 09:20 UTC (History)
4 users (show)

Fixed In Version: spacewalk-utils-1.7.15-34
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-21 09:20:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pavel Studeník 2012-07-26 12:11:07 UTC
Description of problem:
I renamed hostname in only IPv6 enviroment. Hostname had IPv6 address and then run spacewalk-hostname-rename. Result was fail "psql:<stdin>:1: ERROR:  value too long for type character varying(15)"

Version-Release number of selected component (if applicable):
spacewalk-utils-1.7.15-31.el6sat

How reproducible:
always

Steps to Reproduce:
1. Install satellite in IPv6 only IPv6 only environment
2. Verify that hostname has IPv6 address
3. Change hostname for this machine
4. Run spacewalk-hostname-rename
  
Actual results:
Validating IP ... OK
=============================================
hostname: sat.redhat.com
ip: 2000:dead:beef:a:5054:ff:fe7e:eb4
=============================================
Stopping rhn-satellite services ... OK
Testing DB connection ... OK
Updating /etc/rhn/rhn.conf ... OK
Actual SSL key pair package: rhn-org-httpd-ssl-key-pair-sat-1.0-17.noarch
 No need to re-generate SSL certificate.
Regenerating new bootstrap client-config-overrides.txt ... OK
Updating NOCpulse.ini ... OK
Updating monitoring data ... psql:<stdin>:1: ERROR:  value too long for type character varying(15)
FAILED

Fix the problem and run /usr/bin/spacewalk-hostname-rename again


Expected results:
Application run without error.

Comment 1 Jan Pazdziora (Red Hat) 2012-08-06 09:30:45 UTC
What error do you get when you try it on Oracle-based installation?

Comment 2 Jan Pazdziora (Red Hat) 2012-08-06 09:32:02 UTC
I assume that the code failing is

function update_monitoring_data {
    NOCPULSE_OLD_PUBLIC_KEY=`cat $NOCPULSE_PUBLIC_KEY_FILE`
    spacewalk-sql --select-mode - >>$LOG <<EOS
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;
$DBSHELL_QUIT
EOS
}

Comment 3 Tomas Lestach 2012-08-06 14:48:46 UTC
spacewalk.git: 2371ce74d6ec383fb839a394b7f71e24e99aff73

Comment 5 Pavel Studeník 2012-08-07 11:16:01 UTC
I tried it on Oracle-based installation and I didn't get any error. 
Hostname was renamed without a problem.

Comment 6 Tomas Lestach 2012-08-07 11:18:50 UTC
Make sure monitoring is enabled on the satellite server. You won't hit the bug otherwise.

Comment 8 Pavel Studeník 2012-08-14 11:28:14 UTC
If monitoring was disabled or enabled on postgresql, I got same error.


On satellite (Oracle-based) monitoring was enabled and I didn't get any error. 

>> rpm -qa | grep spacewalk-utils
spacewalk-utils-1.7.15-32.el6sat.noarch

>> spacewalk-hostname-rename 2000:dead:beef:a:5054:ff:fedc:b4ee
Validating IP ... OK
=============================================
hostname: sat55.redhat.com
ip: 2000:dead:beef:a:5054:ff:fedc:b4ee
=============================================
Stopping rhn-satellite services ... OK
Testing DB connection ... OK
Updating /etc/rhn/rhn.conf ... OK
Actual SSL key pair package: rhn-org-httpd-ssl-key-pair-sat55-1.0-2.noarch
 No need to re-generate SSL certificate.
Regenerating new bootstrap client-config-overrides.txt ... OK
Updating NOCpulse.ini ... OK
Updating monitoring data ... OK
Pushing monitoring scouts ... OK
Updating other DB entries ... OK
Changing cobbler settings ... OK
Changing jabberd settings ... OK
Starting rhn-satellite services ... O

Comment 11 Clifford Perry 2012-09-21 09:20:42 UTC
This issue is resolved with the release of RHN Satellite 5.5. 

As of September 20th 2012, RHN Satellite 5.5 has been generally available. 

Release Notes and other 5.5 documentation can be found here:

 https://access.redhat.com/knowledge/docs/Red_Hat_Network_Satellite/

The associated Errata for the 5.5 release are:

5.5 Satellite GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1296.html

5.5 Upgrade Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1298.html

5.5 RHN Proxy GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1297.html

5.5 RHN Tools GA Errata
 - http://rhn.redhat.com/errata/RHEA-2012-1299.html

Regards,
Clifford
- Engineering Manager, Satellite


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