Bug 577074 - Cobbler System Record Creation results in Internal Server Error (invalid character) & traceback
Summary: Cobbler System Record Creation results in Internal Server Error (invalid char...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 530
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jan Pazdziora
QA Contact: Dimitar Yordanov
URL:
Whiteboard:
Depends On:
Blocks: sat531-triage
TreeView+ depends on / blocked
 
Reported: 2010-03-26 01:23 UTC by Xixi
Modified: 2018-10-27 13:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-18 08:29:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
CobblerSystemCreateCommand.java.TEST.681463.1.patch (665 bytes, patch)
2010-03-26 01:27 UTC, Xixi
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0897 0 normal SHIPPED_LIVE Red Hat Network Satellite bug fix update 2010-11-18 08:27:31 UTC

Description Xixi 2010-03-26 01:23:04 UTC
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:

Comment 1 Xixi 2010-03-26 01:26:03 UTC
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     }

Comment 2 Xixi 2010-03-26 01:27:50 UTC
Created attachment 402733 [details]
CobblerSystemCreateCommand.java.TEST.681463.1.patch

Comment 3 Xixi 2010-03-26 01:28:24 UTC
Proposed patch attached (thanks Paresh!)

Comment 4 Partha Aji 2010-03-31 23:04:55 UTC
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!

Comment 8 Dimitar Yordanov 2010-09-02 15:43:14 UTC
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

Comment 10 errata-xmlrpc 2010-11-18 08:29:15 UTC
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


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