Bug 1762317

Summary: ipa-backup command is failing on rhel-7.8
Product: Red Hat Enterprise Linux 7 Reporter: Mohammad Rizwan <myusuf>
Component: ipaAssignee: Florence Blanc-Renaud <frenaud>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact: Katerina Nemcova <knemcova>
Priority: unspecified    
Version: 7.8CC: abokovoy, frenaud, lmanasko, mmcgrath, ndehadra, pasik, rcritten, ssidhaye, tborcin, tscherf
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.6.6-9.el7 Doc Type: Known Issue
Doc Text:
.The `ipa-backup` command fails to create a backup on RHEL 7 Due to recent modifications, the `ipa-backup` utility is only compatible with Python 3. However, RHEL 7 uses Python 2. As a consequence, the `ipa-backup` command fails while creating a backup on RHEL 7 and returns an error instead.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-31 19:55:52 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: 1744146    

Description Mohammad Rizwan 2019-10-16 14:05:01 UTC
Description of problem:
ipa-backup command is failing on rhel-7.8

Version-Release number of selected component (if applicable):
cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.8 Beta (Maipo)

ipa-server-4.6.6-8.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install ipa master
2. run ipa-backup 

Actual results:
ipa-backup command is failing.

Expected results:
ipa-backup command is success

Additional info:
[root@master ~]# ipa-backup  -v
ipalib.install.sysrestore: DEBUG: Loading Index file from '/var/lib/ipa/sysrestore/sysrestore.index'
ipapython.admintool: DEBUG: Logging to /var/log/ipabackup.log
ipapython.admintool: DEBUG: ipa-backup was invoked with arguments [] and options: {'data_only': False, 'verbose': True, 'gpg_keyring': None, 'gpg': False, 'quiet': False, 'online': False, 'log_file': None, 'logs': False}
ipapython.admintool: DEBUG: IPA version 4.6.6-8.el7
ipalib.plugable: DEBUG: importing all plugin modules in ipaserver.plugins...
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.aci
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.automember
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.automount
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.baseldap
ipalib.plugable: DEBUG: ipaserver.plugins.baseldap is not a valid plugin module
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.baseuser
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.batch
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.ca
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.caacl
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.cert
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.certmap
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.certprofile
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.config
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.delegation
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.dns
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.dnsserver
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.dogtag
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.domainlevel
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.group
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.hbac
ipalib.plugable: DEBUG: ipaserver.plugins.hbac is not a valid plugin module
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.hbacrule
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.hbacsvc
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.hbacsvcgroup
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.hbactest
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.host
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.hostgroup
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.idrange
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.idviews
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.internal
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.join
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.krbtpolicy
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.ldap2
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.location
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.migration
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.misc
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.netgroup
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.otp
ipalib.plugable: DEBUG: ipaserver.plugins.otp is not a valid plugin module
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.otpconfig
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.otptoken
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.passwd
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.permission
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.ping
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.pkinit
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.privilege
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.pwpolicy
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.rabase
ipalib.plugable: DEBUG: ipaserver.plugins.rabase is not a valid plugin module
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.radiusproxy
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.realmdomains
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.role
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.schema
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.selfservice
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.selinuxusermap
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.server
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.serverrole
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.serverroles
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.service
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.servicedelegation
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.session
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.stageuser
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.sudo
ipalib.plugable: DEBUG: ipaserver.plugins.sudo is not a valid plugin module
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.sudocmd
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.sudocmdgroup
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.sudorule
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.topology
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.trust
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.user
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.vault
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.virtual
ipalib.plugable: DEBUG: ipaserver.plugins.virtual is not a valid plugin module
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.whoami
ipalib.plugable: DEBUG: importing plugin module ipaserver.plugins.xmlserver
ipaserver.install.ipa_backup: INFO: Preparing backup on master.testrelm.test
ipapython.admintool: DEBUG:   File "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 178, in execute
    return_value = self.run()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_backup.py", line 292, in run
    os.mkdir(self.dir, mode=0o750)

ipapython.admintool: DEBUG: The ipa-backup command failed, exception: TypeError: mkdir() takes no keyword arguments
ipapython.admintool: ERROR: mkdir() takes no keyword arguments
ipapython.admintool: ERROR: The ipa-backup command failed. See /var/log/ipabackup.log for more information

Comment 3 Florence Blanc-Renaud 2019-10-16 14:58:15 UTC
The issue happens on python2 only. The interface on python2 is the following:
os.mkdir(path[, mode])

while on python3:
os.mkdir(path, mode=0o777, *, dir_fd=None)

The regression was added with commit e6415ec3210cda0808867642cb19f0df1ddd3c45 on branches master, ipa-4-8, ipa-4-7 and ipa-4-6, but does not raise any issue on platforms using python3.

Comment 4 Florence Blanc-Renaud 2019-10-16 15:01:20 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/8099

Comment 5 Florence Blanc-Renaud 2019-10-17 06:37:51 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/921f500240fc0861e099a97a2b412e8610eaf198

Comment 8 Mike McGrath 2019-10-24 14:28:11 UTC
Is there a known workaround for this?

Comment 9 Alexander Bokovoy 2019-10-24 14:42:15 UTC
(In reply to Mike McGrath from comment #8)
> Is there a known workaround for this?

Unfortunately, not. It is Python 2 versus Python 3 API change. Python 3 supports both old and new way of specifying permissions but Python 2 only supports the old one, as an argument and not a keyword. A fix is one-liner.

Comment 16 Mohammad Rizwan 2019-11-06 13:42:33 UTC
Version:
ipa-server-4.6.6-9.el7.x86_64

Based on logs in comment#14, marking it as a verified.

Comment 18 errata-xmlrpc 2020-03-31 19:55:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1083