Bug 840250 - Deploying configuration file which path comprises symlink fails.
Deploying configuration file which path comprises symlink fails.
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
1.7
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomáš Kašpárek
Red Hat Satellite QA List
:
Depends On:
Blocks: 840448 space18
  Show dependency treegraph
 
Reported: 2012-07-14 17:16 EDT by Dimitar Yordanov
Modified: 2012-11-01 12:19 EDT (History)
2 users (show)

See Also:
Fixed In Version: rhncfg-5.10.34-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 840448 (view as bug list)
Environment:
Last Closed: 2012-11-01 12:19:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 1 Jan Hutař 2012-07-16 04:05:46 EDT
Description of problem:
Deploying configuration file which path comprises symlink fails.

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

How reproducible:
100%

Steps to Reproduce:
1. Register System to Satellite
2. Install rhncfg* on the System
3. rhn-actions-control --enable-all
4. Create configuratoin channel with the following files in it.
    directory - /opt/test_folder
    symlink   - /root/test_dir/link_to_test_folder -> /opt/test_dir
    file      - /root/test_dir/link_to_test_dir/test_file

5. Add the configuration channel to the System
6. Schedule deploy of all files from the configuration channel to the System
7. rhn_check -vv 
...
D: handle_action actionid = 17, version = 2
D: do_call configfiles.deploy({'files': [{'config_channel': 'test_3', 'username': 'root', 'encoding': '', 'checksum': '', 'filetype': 'directory', 'delim_start': '', 'modified': '', 'symlink': '', 'groupname': 'root', 'delim_end': '', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': '', 'path': '/opt/test_folder', 'revision': 1}, {'config_channel': 'test_3', 'username': '', 'encoding': '', 'checksum': '', 'filetype': 'symlink', 'delim_start': '', 'modified': '', 'symlink': '/opt/test_folder', 'groupname': '', 'delim_end': '', 'selinux_ctx': '', 'filemode': '', 'file_contents': '', 'checksum_type': '', 'path': '/root/test_dir/link_to_test_folder', 'revision': 1}, {'config_channel': 'test_3', 'username': 'root', 'encoding': '', 'checksum': 'd41d8cd98f00b204e9800998ecf8427e', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'root', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': 'md5', 'path': '/root/test_dir/link_to_test_folder/test_file', 'revision': 1}]},){'cache_only': None}
D: Sending back response(45, 'Failed deployment, /root/test_dir/link_to_test_folder already exists as a directory', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}
Comment 2 Jens Neu 2012-07-16 05:57:50 EDT
Intention: link home directory of user to a large disk which is mounted on /opt, deploy user specific files (.bash_profile, etc) to /home/$USER since effective mount point of the large disk is subject to change.
On my System:

- Config Channel "x-env-test-debug" with contents
dir: /opt/spw-test
link: /home/spw-test (-> /opt/spw-test)
file: /home/spw-test/.bash_profile

[root@pilot-client5 opt]# rhn_check -vvv
[...]
D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': '', 'checksum': '', 'filetype': 'directory', 'delim_start': '', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': '', 'path': '/opt/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': '', 'encoding': '', 'checksum': '', 'filetype': 'symlink', 'delim_start': '', 'modified': '', 'symlink': '/opt/spw-test', 'groupname': '', 'delim_end': '', 'selinux_ctx': '', 'filemode': '', 'file_contents': '', 'checksum_type': '', 'path': '/home/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': 'ca78bb4bb4901e6ba30170b348056f8b', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hfcHJvZmlsZQoKIyBHZXQgdGhlIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwppZiBbIC1mIH4vLmJhc2hyYyBdOyB0aGVuCgkuIH4vLmJhc2hyYwpmaQoK\nIyBVc2VyIHNwZWNpZmljIGVudmlyb25tZW50IGFuZCBzdGFydHVwIHByb2dyYW1zCgpQQVRIPSRQ\nQVRIOiRIT01FL2JpbgoKZXhwb3J0IFBBVEgKdW5zZXQgVVNFUk5BTUUK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bash_profile', 'revision': 1}]},){'cache_only': None}
D: Sending back response((6,), 'Fatal error in Python code occured', {})


Spacewalk Client: Centos 5.8 (Patches up to 20120712)

rhn-client-tools: 1.7.14-1.el5
rhncfg*: 5.10.27-1.el5

Spacewalk Server: Centos 5.8 (Patches up to 20120605)

spacewalk-oracle: 1.7.3-1.el5 (Patches up to 20120709)
DB Backend: Oracle 11gR2 "Enterprise Edition" on dedicated machine
Comment 3 Jens Neu 2012-07-16 06:02:42 EDT
Deploy files serialized:

1) dir: /opt/spw-test

D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': '', 'checksum': '', 'filetype': 'directory', 'delim_start': '', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': '', 'path': '/opt/spw-test', 'revision': 1}]},){'cache_only': None}
D: Sending back response(0, 'Files successfully deployed', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}

2) link: /home/spw-test -> /opt/spw-test

D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': '', 'encoding': '', 'checksum': '', 'filetype': 'symlink', 'delim_start': '', 'modified': '', 'symlink': '/opt/spw-test', 'groupname': '', 'delim_end': '', 'selinux_ctx': '', 'filemode': '', 'file_contents': '', 'checksum_type': '', 'path': '/home/spw-test', 'revision': 1}]},){'cache_only': None}
D: Sending back response(0, 'Files successfully deployed', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}

3) file: /home/spw-test/.bash_profile

D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': 'ca78bb4bb4901e6ba30170b348056f8b', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hfcHJvZmlsZQoKIyBHZXQgdGhlIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwppZiBbIC1mIH4vLmJhc2hyYyBdOyB0aGVuCgkuIH4vLmJhc2hyYwpmaQoK\nIyBVc2VyIHNwZWNpZmljIGVudmlyb25tZW50IGFuZCBzdGFydHVwIHByb2dyYW1zCgpQQVRIPSRQ\nQVRIOiRIT01FL2JpbgoKZXhwb3J0IFBBVEgKdW5zZXQgVVNFUk5BTUUK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bash_profile', 'revision': 1}]},){'cache_only': None}
D: Sending back response(0, 'Files successfully deployed', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}

works like a charm.
Comment 4 Jens Neu 2012-07-16 06:13:14 EDT
when dir/symlink/file are up-to-date, "deploy all config files" works:

D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': '', 'checksum': '', 'filetype': 'directory', 'delim_start': '', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': '', 'path': '/opt/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': '', 'encoding': '', 'checksum': '', 'filetype': 'symlink', 'delim_start': '', 'modified': '', 'symlink': '/opt/spw-test', 'groupname': '', 'delim_end': '', 'selinux_ctx': '', 'filemode': '', 'file_contents': '', 'checksum_type': '', 'path': '/home/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': 'ca78bb4bb4901e6ba30170b348056f8b', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hfcHJvZmlsZQoKIyBHZXQgdGhlIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwppZiBbIC1mIH4vLmJhc2hyYyBdOyB0aGVuCgkuIH4vLmJhc2hyYwpmaQoK\nIyBVc2VyIHNwZWNpZmljIGVudmlyb25tZW50IGFuZCBzdGFydHVwIHByb2dyYW1zCgpQQVRIPSRQ\nQVRIOiRIT01FL2JpbgoKZXhwb3J0IFBBVEgKdW5zZXQgVVNFUk5BTUUK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bash_profile', 'revision': 1}]},){'cache_only': None}
D: Sending back response(0, 'Files successfully deployed', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}

also adding /home/spw-test/.bashrc to channel works:
D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': '', 'checksum': '', 'filetype': 'directory', 'delim_start': '', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': '', 'path': '/opt/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': '', 'encoding': '', 'checksum': '', 'filetype': 'symlink', 'delim_start': '', 'modified': '', 'symlink': '/opt/spw-test', 'groupname': '', 'delim_end': '', 'selinux_ctx': '', 'filemode': '', 'file_contents': '', 'checksum_type': '', 'path': '/home/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': 'ca78bb4bb4901e6ba30170b348056f8b', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hfcHJvZmlsZQoKIyBHZXQgdGhlIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwppZiBbIC1mIH4vLmJhc2hyYyBdOyB0aGVuCgkuIH4vLmJhc2hyYwpmaQoK\nIyBVc2VyIHNwZWNpZmljIGVudmlyb25tZW50IGFuZCBzdGFydHVwIHByb2dyYW1zCgpQQVRIPSRQ\nQVRIOiRIT01FL2JpbgoKZXhwb3J0IFBBVEgKdW5zZXQgVVNFUk5BTUUK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bash_profile', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': '277ed0fce513f856f6bed95961dd3463', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hyYwoKIyBVc2VyIHNwZWNpZmljIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwoKYWxpYXMgcm09J3JtIC1pJwphbGlhcyBjcD0nY3AgLWknCmFsaWFzIG12\nPSdtdiAtaScKCiMgU291cmNlIGdsb2JhbCBkZWZpbml0aW9ucwppZiBbIC1mIC9ldGMvYmFzaHJj\nIF07IHRoZW4KCS4gL2V0Yy9iYXNocmMKZmkK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bashrc', 'revision': 1}]},){'cache_only': None}
D: Sending back response(0, 'Files successfully deployed', {})
D: do_call packages.checkNeedUpdate('rhnsd=1',){}

scrup system, error reoccurs:
[root@pilot-client5 ~]# rm -rf /opt/spw-test /home/spw-test
"deploy all config files"

D: do_call configfiles.deploy({'files': [{'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': '', 'checksum': '', 'filetype': 'directory', 'delim_start': '', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '', 'selinux_ctx': '', 'filemode': 644, 'file_contents': '', 'checksum_type': '', 'path': '/opt/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': '', 'encoding': '', 'checksum': '', 'filetype': 'symlink', 'delim_start': '', 'modified': '', 'symlink': '/opt/spw-test', 'groupname': '', 'delim_end': '', 'selinux_ctx': '', 'filemode': '', 'file_contents': '', 'checksum_type': '', 'path': '/home/spw-test', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': 'ca78bb4bb4901e6ba30170b348056f8b', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hfcHJvZmlsZQoKIyBHZXQgdGhlIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwppZiBbIC1mIH4vLmJhc2hyYyBdOyB0aGVuCgkuIH4vLmJhc2hyYwpmaQoK\nIyBVc2VyIHNwZWNpZmljIGVudmlyb25tZW50IGFuZCBzdGFydHVwIHByb2dyYW1zCgpQQVRIPSRQ\nQVRIOiRIT01FL2JpbgoKZXhwb3J0IFBBVEgKdW5zZXQgVVNFUk5BTUUK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bash_profile', 'revision': 1}, {'config_channel': 'x-env-test-debug', 'username': 'spw-test', 'encoding': 'base64', 'checksum': '277ed0fce513f856f6bed95961dd3463', 'filetype': 'file', 'delim_start': '{|', 'modified': '', 'symlink': '', 'groupname': 'spw-test', 'delim_end': '|}', 'selinux_ctx': '', 'filemode': 644, 'file_contents': 'IyBTcGFjZXdhbGsgbWFuYWdlZAojCiMgLmJhc2hyYwoKIyBVc2VyIHNwZWNpZmljIGFsaWFzZXMg\nYW5kIGZ1bmN0aW9ucwoKYWxpYXMgcm09J3JtIC1pJwphbGlhcyBjcD0nY3AgLWknCmFsaWFzIG12\nPSdtdiAtaScKCiMgU291cmNlIGdsb2JhbCBkZWZpbml0aW9ucwppZiBbIC1mIC9ldGMvYmFzaHJj\nIF07IHRoZW4KCS4gL2V0Yy9iYXNocmMKZmkK\n', 'checksum_type': 'md5', 'path': '/home/spw-test/.bashrc', 'revision': 1}]},){'cache_only': None}
D: Sending back response((6,), 'Fatal error in Python code occured', {})
Comment 5 Tomáš Kašpárek 2012-08-07 05:53:30 EDT
fixed in spacewalk master 22aa313729b0840566ee290a37996ab7840d3604
Comment 6 Jan Pazdziora 2012-10-30 15:24:21 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 7 Jan Pazdziora 2012-11-01 12:19:38 EDT
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

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