Description of problem: Error when using the web UI to compare the differences between a revision file when SELinux is disabled in RHEL6. Error Message: This action's status is: Failed. The client picked up this action on 03/17/11 12:48:54 AM EDT. The client completed this action on 03/17/11 12:48:55 AM EDT. Client execution returned "Fatal error in Python code occurred [[6]]" (code -1) Version-Release number of selected component (if applicable): Red Hat Satellite 5.4 --Client rhncfg-5.9.27-15.el6.noarch rhncfg-actions-5.9.27-15.el6.noarch rhncfg-management-5.9.27-15.el6.noarch rhncfg-client-5.9.27-15.el6.noarch How reproducible: Always Steps to Reproduce: 1. Install a RHEL6 box and set SELinux to disabled [root@localhost ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.0 (Santiago) [root@localhost ~]# sestatus SELinux status: disabled [root@localhost ~]# 2. Create a configuration channel and deploy the file using rhncfg-client [root@localhost ~]# rhncfg-client elist Mode Owner Group Size Rev Config Channel File -rw-r--r-- root root 9 1 config-files-sfdc_00413111 /etc/test-case-00413111 [root@localhost ~]# rhncfg-client Usage: /usr/bin/rhncfg-client MODE [ --server-name name ] [ params ] Valid modes are: diff get list elist channels verify [root@localhost ~]# rhncfg-client verify missing /etc/test-case-00413111 [root@localhost ~]# rhncfg-client get Deploying /etc/test-case-00413111 [root@localhost ~]# ls -laZ /etc/test-case-00413111 -rw-r--r-- root root ? /etc/test-case-00413111 3. Add new lines on the file deployed [root@localhost ~]# echo "Making Test" >> /etc/test-case-00413111 4. Select to compare the files using the webUI. 5. At box, run rhn_check -v 6. Check the action scheduled. You should see the error below: (see also compare{1,2,3}.png This action's status is: Failed. The client picked up this action on 03/17/11 12:48:54 AM EDT. The client completed this action on 03/17/11 12:48:55 AM EDT. Client execution returned "Fatal error in Python code occurred [[6]]" (code -1) Actual results: Compare files fails when SELinux is disabled. If SELinux is set to permissive or enforcing, it works as expected. Expected results: Compare files functionality works as expected when SELinux is disabled.
Created attachment 485929 [details] Screenshot Compare Files 1
Created attachment 485930 [details] Screenshot Compare Files 2
Created attachment 485931 [details] Screenshot Compare Files 3
Hello, The error only occurs when comparing the files using the web UI. Running the command line, the error is not showed. [root@dhcp153 ~]# tail -n0 -f /var/log/rhncfg* & [1] 19975 ==> /var/log/rhncfg <== ==> /var/log/rhncfg-actions <== [root@dhcp153 ~]# rhncfg-manager diff -r 1 /etc/test-case-00413111 -c config-files-sfdc_00413111 2011-03-17 15:16:17 rpc_repository.__init__: 2011-03-17 15:16:17 rpc_repository.__init__: 2011-03-17 15:16:17 repository.__init__: server url https://satellite-server.example.com/CONFIG-MANAGEMENT-TOOL 2011-03-17 15:16:17 repository.__init__: server url https://satellite-server.example.com/CONFIG-MANAGEMENT-TOOL 2011-03-17 15:16:17 repository.__init__: ca cert /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT 2011-03-17 15:16:17 repository.__init__: ca cert /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT 2011-03-17 15:16:17 rpc_repository.assert_repo_health: 2011-03-17 15:16:17 rpc_repository.assert_repo_health: 2011-03-17 15:16:17 rhncfg_diff.run: 2011-03-17 15:16:17 rhncfg_diff.run: 2011-03-17 15:16:17 rpc_repository.config_channel_exists: config-files-sfdc_00413111 2011-03-17 15:16:17 rpc_repository.config_channel_exists: config-files-sfdc_00413111 2011-03-17 15:16:17 rpc_repository.list_config_channels: 2011-03-17 15:16:17 rpc_repository.list_config_channels: 2011-03-17 15:16:17 rpc_repository.get_raw_file_info: 2011-03-17 15:16:17 rpc_repository.get_raw_file_info: --- /etc/test-case-00413111 attributes: -rw-r--r-- root root config channel: config-files-sfdc_00413111 revision: 1 --- /etc/test-case-00413111 2011-03-17 14:33:04 attributes: -rw-r--r-- root root config channel: local file revision: None @@ -1,1 +1,4 @@ -test_case+test_caseasdfasdfasdf +asdfasdfasdf +asdfasdfasdf +asdfasdfasdf 2011-03-17 15:16:17 rpc_repository.cleanup: 2011-03-17 15:16:17 rpc_repository.cleanup: Still investigating... Kind Regards, Marcelo Moreira de Mello
Hello, When scheduled using the web UI and then on client ran rhn_check -vvvvv we can see: 11 D: handle_action actionid = 1765, version = 2 12 D: do_call configfiles.diff ({'files': [{'config_channel': 'config-files-sfdc_00413111', 'username': 'root', 'encoding': 'base64', 'checksum': '3d80871179 da89ed75f406b31f7f8240', 'filetype': 'file', 'delim_start': '{|', 'file_contents': 'dGVzdF9jYXNl\n', 'symlink': '', 'groupname': 'root', 'delim_end': '|}' , 'selinux_ctx': '', 'filemode': 644, 'checksum_type': 'md5', 'path': '/etc/test-case-00413111', 'revision': 1}]},) {'cache_only': None} 13 D: Sending back response ((6,), 'Fatal error in Python code occured', {}) 14 D: do_call packages.checkNeedUpdate ('rhnsd=1',) {} Trying to identify what is causing the exception. Kind Regards, Marcelo Moreira de Mello
Created attachment 486035 [details] rhbz#688461 - fixed python exception when comparing files using Hello, We found the issue bug during. When scheduled to compare files using the web UI and then running rhn_check -vvvvv on client we got this error: 11 D: handle_action actionid = 1765, version = 2 12 D: do_call configfiles.diff ({'files': [{'config_channel': 'config-files-sfdc_00413111', 'username': 'root', 'encoding': 'base64', 'checksum': '3d80871179 da89ed75f406b31f7f8240', 'filetype': 'file', 'delim_start': '{|', 'file_contents': 'dGVzdF9jYXNl\n', 'symlink': '', 'groupname': 'root', 'delim_end': '|}' , 'selinux_ctx': '', 'filemode': 644, 'checksum_type': 'md5', 'path': '/etc/test-case-00413111', 'revision': 1}]},) {'cache_only': None} 13 D: Sending back response ((6,), 'Fatal error in Python code occured', {}) 14 D: do_call packages.checkNeedUpdate ('rhnsd=1',) {} Looking the /var/log/up2date, we can found the python exception: Traceback (most recent call last): File "/usr/sbin/rhn_check", line 334, in __run_action (status, message, data) = CheckCli.__do_call(method, params, kwargs) File "/usr/sbin/rhn_check", line 327, in __do_call retval = method(*params, **kwargs) File "/usr/share/rhn/actions/configfiles.py", line 330, in diff diff = fp.diff(file) File "/usr/share/rhn/config_common/file_utils.py", line 101, in diff cur_sectx = lgetfilecon(path)[1] <type 'exceptions.OSError'>: [Errno 61] No data available Patch sent to spacewalk-devel list for approval: https://www.redhat.com/archives/spacewalk-devel/2011-March/msg00073.html After applied the patch, we are now able to compare files using the web UI: This action's status is: Completed. The client picked up this action on 03/17/11 12:18:23 PM EDT. The client completed this action on 03/17/11 12:18:24 PM EDT. Client execution returned "Files successfully diffed" (code 0) Config Files: /etc/test-case-00413111 (rev. 1) Differences exist Kind Regards, Marcelo Moreira de Mello
Hello, Fixed in spacewalk.master commit 97fead2f7823a92e091ca607ab27bbf5a0041fcd http://git.fedorahosted.org/git/?p=spacewalk.git;a=commit;h=97fead2f7823a92e091ca607ab27bbf5a0041fcd Kind Regards, Marcelo Moreira de Mello
Core problem is bug 690238.
Bug/feature of 690238 workarounded in spacewalk.git ab80c2974e4fa2261478bed2c6d8a99703671b4c
cherry picked as e1505ec8d18f2950b4dc9a29202e9cf6afef86d4 and 0b2d46dd674f9c8f9ef016f8e608d16c8fa5b4a9
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-2011-0878.html