Bug 1124588

Summary: CobblerSync fails if a system record references a proxy that is off
Product: Red Hat Satellite 5 Reporter: Stephen Herr <sherr>
Component: ProvisioningAssignee: Jan Dobes <jdobes>
Status: CLOSED DEFERRED QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-09 11:19:42 UTC Type: Bug
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: 462714    

Description Stephen Herr 2014-07-29 21:01:15 UTC
Description of problem:
The CobblerSync taskomatic task will fail if a profile references a Proxy that is currently off. This is because cobbler attempts to determin the ip address associated with the proxy's hostname at import time, and if the proxy is off then the socket python module returns an error.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Execute a guest provision through a proxy
2. Turn off the proxy
3. Make a change to the profile used

Actual results:
CobblerSync task will fail with exception:
INFO   | jvm 3    | 2014/07/29 15:56:00 | 2014-07-29 15:56:00,684 [DefaultQuartzScheduler_Worker-3] ERROR com.redhat.rhn.manager.kickstart.cobbler.CobblerCommand - Error calling cobbler.
INFO   | jvm 3    | 2014/07/29 15:56:00 | redstone.xmlrpc.XmlRpcFault: <class 'socket.gaierror'>:[Errno -2] Name or service not known
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at redstone.xmlrpc.XmlRpcClient.handleResponse(XmlRpcClient.java:443)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at redstone.xmlrpc.XmlRpcClient.endCall(XmlRpcClient.java:376)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at redstone.xmlrpc.XmlRpcClient.invoke(XmlRpcClient.java:165)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper.invokeMethod(CobblerXMLRPCHelper.java:69)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.manager.kickstart.cobbler.CobblerCommand.invokeXMLRPC(CobblerCommand.java:100)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.manager.kickstart.cobbler.CobblerCommand.invokeXMLRPC(CobblerCommand.java:115)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.manager.kickstart.cobbler.CobblerProfileSyncCommand.syncProfileToSpacewalk(CobblerProfileSyncCommand.java:154)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.manager.kickstart.cobbler.CobblerProfileSyncCommand.store(CobblerProfileSyncCommand.java:107)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.taskomatic.task.CobblerSyncTask.execute(CobblerSyncTask.java:123)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.taskomatic.task.RhnJavaJob.execute(RhnJavaJob.java:89)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at com.redhat.rhn.taskomatic.TaskoJob.execute(TaskoJob.java:169)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
INFO   | jvm 3    | 2014/07/29 15:56:00 |       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)

And in cobbler.log:
Tue Jul 29 16:44:27 2014 - INFO | Exception occured: <class 'socket.gaierror'>
Tue Jul 29 16:44:27 2014 - INFO | Exception value: [Errno -2] Name or service not known
Tue Jul 29 16:44:27 2014 - INFO | Exception Info:
  File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 1766, in _dispatch
    return method_handle(*params)
   File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 877, in save_profile
    return self.save_item("profile",object_id,token,editmode=editmode)
   File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 871, in save_item
    rc = self.api.add_item(what,obj)
   File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 395, in add_item
    return self.get_items(what).add(ref,check_for_duplicate_names=check_for_duplicate_names,save=save,logger=logger)
   File "/usr/lib/python2.6/site-packages/cobbler/collection.py", line 309, in add
    self.lite_sync.add_single_profile(ref.name)
   File "/usr/lib/python2.6/site-packages/cobbler/action_litesync.py", line 110, in add_single_profile
    self.add_single_system(k.name)
   File "/usr/lib/python2.6/site-packages/cobbler/action_litesync.py", line 142, in add_single_system
    self.sync.pxegen.write_all_system_files(system)
   File "/usr/lib/python2.6/site-packages/cobbler/pxegen.py", line 319, in write_all_system_files
    self.write_pxe_file(f2, system, profile, distro, working_arch)
   File "/usr/lib/python2.6/site-packages/cobbler/pxegen.py", line 614, in write_pxe_file
    image, arch, kickstart_path)
   File "/usr/lib/python2.6/site-packages/cobbler/pxegen.py", line 692, in build_kernel_options
    ipaddress = socket.gethostbyname_ex(blended["http_server"])[2][0]

Expected results:
CobblerSync should work

Additional info:

Comment 1 Tomas Lestach 2018-04-09 11:19:42 UTC
We have re-reviewed this bug, as part of an ongoing effort to improve Satellite/Proxy feature and bug updates, review and backlog.

This is a low priority bug and has no currently open customer cases. While this bug may still valid, we do not see it being implemented prior to the EOL of the Satellite 5.x product. As such, this is being CLOSED DEFERRED. 

Closing now to help set customer expectations as early as possible. You are welcome to re-open this bug if needed.