Description of problem: After registering a system on Satellite v5.3 with special character in profile name, trying to create Cobbler System Record fails with Internal Server Error and traceback /var/log/cobbler/cobblerd.log : 2010-03-25 11:41:15,460 - api - Exception Info: File "/usr/lib/python2.3/site-packages/cobbler/remote.py", line 1567, in _dispatch return method_handle(*params) File "/usr/lib/python2.3/site-packages/cobbler/remote.py", line 1401, in modify_system return self.__call_method(obj, attribute, arg) File "/usr/lib/python2.3/site-packages/cobbler/remote.py", line 1374, in __call_method return method(arg) File "/usr/lib/python2.3/site-packages/cobbler/item_system.py", line 325, in set_name raise CX(_("invalid characters in name: %s") % x) The issue is same in nature as bug 531059 just at a different place. Version-Release number of selected component (if applicable): Red Hat Network (RHN) Satellite 5.3.0 System architecture(s): RHEL 5 U3 i386 platform How reproducible: Always. Steps to Reproduce: 1. Register a system with [ and ] chars in the profile name: rhnreg_ks --username USERNAME --password PASSWORD --profilename "test.system[test]" 2. Give provisioning entitlement to this system 3. Under provisioning -> select existing kickstart profile and Click on "Create Cobbler System Record" Actual results: Fails with "Internal Server Error" and stacktrace in cobblerd.log and catalina.out Expected results: It should successfully create cobbler system recor Additional info:
Code Snippets: java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java 209 /** 210 * Store the System to cobbler 211 * @return ValidatorError if the store failed. 212 */ 213 public ValidatorError store() { 214 Profile profile = Profile.lookupByName(getCobblerConnection(), profileName); 215 // First lookup by MAC addr 216 SystemRecord rec = lookupExisting(); 217 if (rec == null) { 218 // Next try by name 219 rec = SystemRecord.lookupByName(getCobblerConnection(user), 220 getCobblerSystemRecordName()); 221 } 222 223 // Else, lets make a new system 224 if (rec == null) { 225 rec = SystemRecord.create(getCobblerConnection(), 226 getCobblerSystemRecordName(), 227 profile); 228 } 272 public String getCobblerSystemRecordName() { 273 String name = this.server.getName().replace(' ', '_'); 274 return name + ":" + 275 this.server.getOrg().getId(); 276 }
Created attachment 402733 [details] CobblerSystemCreateCommand.java.TEST.681463.1.patch
Proposed patch attached (thanks Paresh!)
Applied the given patch .. Should be resolved as of http://git.fedorahosted.org/git/spacewalk.git/?p=spacewalk.git;a=commit;h=f953b36556acd47f7efae8aa476003b271af0f00 Thanks Paresh!
Hi all, I have just verified the issue on RHEL 4 and RHEL 5, Red Hat Network (RHN) Satellite 5.3.0. Installing the following list of packages fixed the problem. spacewalk-java-0.5.44-88.el5sat.src.rpm spacewalk-taskomatic-0.5.44-88.el5sat.noarch.rpm spacewalk-java-0.5.44-88.el5sat.noarch.rpm spacewalk-java-config-0.5.44-88.el5sat.noarch.rpm spacewalk-java-lib-0.5.44-88.el5sat.noarch.rpm Regards Dimitar Yordanov
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0897.html