Bug 1623763

Summary: ipa service-del <Principal name> should display principal name instead of Invalid 'principal'.
Product: Red Hat Enterprise Linux 7 Reporter: Sudhir Menon <sumenon>
Component: ipaAssignee: IPA Maintainers <ipa-maint>
Status: CLOSED DEFERRED QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: abokovoy, cheimes, myusuf, pcech, pvoborni, rcritten, tscherf
Target Milestone: rcKeywords: FutureFeature, TestCaseProvided
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-11 19:11:35 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:
Attachments:
Description Flags
Screenshot of service del none

Description Sudhir Menon 2018-08-30 07:10:23 UTC
Description of problem: Deleting services from the UI/console should display principal name instead of Invalid 'principal'
 
Version-Release number of selected component (if applicable):
ipa-server-4.6.4-6.el7.x86_64
sssd-1.16.2-12.el7.x86_64
package samba is not installed
pki-server-10.5.9-6.el7.noarch
selinux-policy-3.13.1-220.el7.noarch
389-ds-base-1.3.8.4-11.el7.x86_64


How reproducible: Always

Steps to Reproduce:
1. Install Master and 2 Replicas
2. Navigate to IPA UI --> Identity ---> Services.
3. Select all the services and click the 'Delete' button.


Actual results:
Services required by IPA are not deleted but the pop-up window displays Invalid 'principal' instead of the actual service deleted.

[root@master ~]# ipa service-del ldap/replica1.apollo.test
ipa: ERROR: invalid 'principal': This principal is required by the IPA master

[Thu Aug 30 11:50:39.407794 2018] [:error] [pid 11758] ipa: DEBUG: retrieving schema for SchemaCache url=ldapi://%2fvar%2frun%2fslapd-APOLLO-TEST.socket conn=<ldap.ldapobject.SimpleLDAPObject instance at 0x7f57f3199908>
[Thu Aug 30 11:50:39.697064 2018] [:error] [pid 11758] ipa: DEBUG: WSGI wsgi_execute PublicError: Traceback (most recent call last):
[Thu Aug 30 11:50:39.697083 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 369, in wsgi_execute
[Thu Aug 30 11:50:39.697088 2018] [:error] [pid 11758]     result = command(*args, **options)
[Thu Aug 30 11:50:39.697098 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 450, in __call__
[Thu Aug 30 11:50:39.697103 2018] [:error] [pid 11758]     return self.__do_call(*args, **options)
[Thu Aug 30 11:50:39.697107 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 478, in __do_call
[Thu Aug 30 11:50:39.697112 2018] [:error] [pid 11758]     ret = self.run(*args, **options)
[Thu Aug 30 11:50:39.697116 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 800, in run
[Thu Aug 30 11:50:39.697121 2018] [:error] [pid 11758]     return self.execute(*args, **options)
[Thu Aug 30 11:50:39.697125 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/baseldap.py", line 1587, in execute
[Thu Aug 30 11:50:39.697129 2018] [:error] [pid 11758]     delete_entry(pkey)
[Thu Aug 30 11:50:39.697134 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/baseldap.py", line 1538, in delete_entry
[Thu Aug 30 11:50:39.697138 2018] [:error] [pid 11758]     dn = callback(self, ldap, dn, *nkeys, **options)
[Thu Aug 30 11:50:39.697142 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/service.py", line 669, in pre_callback
[Thu Aug 30 11:50:39.697147 2018] [:error] [pid 11758]     check_required_principal(ldap, keys[-1])
[Thu Aug 30 11:50:39.697151 2018] [:error] [pid 11758]   File "/usr/lib/python2.7/site-packages/ipaserver/plugins/service.py", line 287, in check_required_principal
[Thu Aug 30 11:50:39.697156 2018] [:error] [pid 11758]     raise errors.ValidationError(name='principal', error=_('This principal is required by the IPA master'))
[Thu Aug 30 11:50:39.697160 2018] [:error] [pid 11758] ValidationError: invalid 'principal': This principal is required by the IPA master

Expected results: It's better to display the output in console and UI by replacing the Invalid 'principal' with actual principal name to avoid confusion as in that the principal name is invalid.

e.g
[root@master ~]# ipa service-del ldap/replica1.apollo.test
ipa: ERROR: ldap/replica1.apollo.test: This principal is required by the IPA master

Additional info: Logging this as an bug to change the output being displayed while deleting the service.

Comment 2 Sudhir Menon 2018-08-30 07:11:41 UTC
Created attachment 1479689 [details]
Screenshot of service del

Comment 3 Alexander Bokovoy 2018-09-11 18:30:58 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7695

Comment 4 Petr Čech 2019-12-11 19:11:35 UTC
Once the upstream community implements this feature it will be pulled into a corresponding Red Hat Enterprise Linux release following the corresponding schedules.
From now on this issue will be tracked in the community issue tracker only.
Closing this BZ.