Bug 1309003

Summary: rhncfg-manager raises an exception while handling an exception during a file deployment
Product: [Community] Spacewalk Reporter: Gennadii Altukhov <galtukho>
Component: ClientsAssignee: Gennadii Altukhov <galtukho>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.4CC: fdewaley, satqe-list, tkasparek, tlestach, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1215658 Environment:
Last Closed: 2016-06-16 08:09:57 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: 1215658    
Bug Blocks: 1127217, 1484117    

Description Gennadii Altukhov 2016-02-16 17:10:56 UTC
Description of problem:
rhncfg-manager raises an exceptions while handling an exception during a file deployment

Version-Release number of selected component (if applicable):
Spacewalk server 2.4
rhncfg-management-5.10.85-1.el6.noarch


Steps to Reproduce:
1. create a configuration channel
2. add a file owned by a user that would not be present on the system by default
   add a directory owned by a user that would not be present on the system by default and contains a common directory with created file in its path
   for example:
   file /usr/share/cfg/file
   dir  /usr/share/cfg/dir

3. on a system that does not have that user, use rhncfg-manager download-channel -t /tmp my_test_config_channel

Actual results:
the following trace : 
Traceback (most recent call last):
  File "/usr/bin/rhncfg-manager", line 46, 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_management/rhncfg_download_channel.py", line 52, in run
    config_channel=ns)
  File "/usr/share/rhn/config_common/deploy.py", line 65, in deploy_files
    try_rollback(dep_trans, "Error unable to deploy file, information on user '%s' could not be found" % e[0])
  File "/usr/share/rhn/config_common/deploy.py", line 81, in try_rollback
    dep_trans.rollback()
  File "/usr/share/rhn/config_common/transactions.py", line 266, in rollback
    os.rmdir(remove_dir)
OSError: [Errno 39] Directory not empty: '/usr2/tools'

Expected results:
rollback transaction w/o any errors

Additional info:
if we have only a file in our configuration channel and we download it by rhncfg-manager, and something wrong happened, rhncfg do not try to rollback transaction. You can find the file on filesystem, but actually with "generated name". There is actually another problem which makes impossible to remove directory complitely.

Comment 1 Gennadii Altukhov 2016-02-16 17:11:49 UTC
Taking...

Comment 2 Gennadii Altukhov 2016-02-29 15:52:59 UTC
spacewalk.git:
20fc36c3ec3e4d09bd032d2183253db945945f66

Comment 3 Eric Herget 2017-09-28 18:11:49 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.