Configuration file deployment fails with "Client execution returned "Fatal error in Python code occured [[6]]" (code -1)" during Kickstart.
Environment
- Red Hat Satellite 5.x
- Configuration deployment
Issue
- Configuration deployment while kickstarting a client fails,the error message for the same can be found under
event
tab of client's System profile:
Client execution returned "Fatal error in Python code occurred [[6]]" (code -1)
Resolution
- Check the SELinux context set for files under the configuration channel.
Root Cause
- The SELinux Context for the files where not properly set which caused this issue.
Diagnostic Steps
- Add following command in the post script in the kickstart file:
rhncfg-client get &> /root/ks-get.log
- After the client is up, check for the
/root/ks-get.log
file in which you may find:
Using server name test.client.com
Traceback (most recent call last):
File "/usr/bin/rhncfg-client", line 38, in ?
sys.exit(Main().main() or 0)
File "/usr/share/rhn/config_common/rhn_main.py", line 207, in main
handler.run()
File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run
self.options.exclude)
File "/usr/share/rhn/config_common/deploy.py", line 53, in deploy_files
dep_trans.add_preprocessed(path, processed_path, file_info, dirs_created)
File "/usr/share/rhn/config_common/transactions.py", line 202, in add_preprocessed
self._chown_chmod_chcon(processed_file_path, dest_path, file_info, strict_ownership=strict_ownership)
File "/usr/share/rhn/config_common/transactions.py", line 170, in _chown_chmod_chcon
raise Exception("failed to set selinux context on %s" % dest_path)
Exception: failed to set selinux context on /etc/ssh/sshd_config
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments