Bug 1782169

Summary: traceback in idview
Product: Red Hat Enterprise Linux 8 Reporter: Christian Heimes <cheimes>
Component: ipaAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: high Docs Contact:
Priority: urgent    
Version: 8.0CC: fperalta, kludhwan, ksiddiqu, mvarun, pasik, pkulkarn, rcritten, tscherf
Target Milestone: rc   
Target Release: 8.2   
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: 2020-04-28 15:44:12 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:

Description Christian Heimes 2019-12-11 10:26:50 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/freeipa/issue/7958

### Issue

Reported in irc by Sokol trying to look at idviews. He repaired the issue by removing and re-adding all views.

== /var/log/httpd/error_log ==
[Tue May 21 22:14:32.778871 2019] [:warn] [pid 2153:tid 139938951522048] [client 172.22.10.142:57218] failed to set perms (3140) on file (/run/ipa/ccaches/louis.abel2.COM)!, referer: https://phx-entl01.ipa.example.com/ipa/ui/
[Tue May 21 22:14:33.187218 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218] ipa: ERROR: non-public: TypeError: ord() expected string of length 1, but int found
[Tue May 21 22:14:33.187276 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218] Traceback (most recent call last):
[Tue May 21 22:14:33.187283 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/rpcserver.py&quot;, line 370, in wsgi_execute
[Tue May 21 22:14:33.187287 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     result = command(*args, **options)
[Tue May 21 22:14:33.187291 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipalib/frontend.py&quot;, line 450, in __call__
[Tue May 21 22:14:33.187319 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     return self.__do_call(*args, **options)
[Tue May 21 22:14:33.187324 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipalib/frontend.py&quot;, line 478, in __do_call
[Tue May 21 22:14:33.187328 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     ret = self.run(*args, **options)
[Tue May 21 22:14:33.187332 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipalib/frontend.py&quot;, line 800, in run
[Tue May 21 22:14:33.187335 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     return self.execute(*args, **options)
[Tue May 21 22:14:33.187339 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/plugins/baseldap.py&quot;, line 2072, in execute
[Tue May 21 22:14:33.187343 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     self, ldap, entries, truncated, *args, **options
[Tue May 21 22:14:33.187347 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/plugins/idviews.py&quot;, line 1176, in post_callback
[Tue May 21 22:14:33.187351 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     ldap, entries, truncated, *args, **options)
[Tue May 21 22:14:33.187365 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/plugins/idviews.py&quot;, line 873, in post_callback
[Tue May 21 22:14:33.187502 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     self.obj.convert_anchor_to_human_readable_form(entry, **options)
[Tue May 21 22:14:33.187509 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/plugins/idviews.py&quot;, line 745, in convert_anchor_to_human_readable_form
[Tue May 21 22:14:33.187520 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     anchor
[Tue May 21 22:14:33.187524 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/plugins/idviews.py&quot;, line 644, in resolve_anchor_to_object_name
[Tue May 21 22:14:33.187528 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     name = domain_validator.get_trusted_domain_object_from_sid(sid)
[Tue May 21 22:14:33.187537 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib/python3.6/site-packages/ipaserver/dcerpc.py&quot;, line 497, in get_trusted_domain_object_from_sid
[Tue May 21 22:14:33.187611 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     2  # 2 means every character needs to be escaped
[Tue May 21 22:14:33.187616 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]   File &quot;/usr/lib64/python3.6/site-packages/ldap/filter.py&quot;, line 36, in escape_filter_chars
[Tue May 21 22:14:33.187620 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218]     r.append(&quot;\\\\%02x&quot; % ord(c))
[Tue May 21 22:14:33.187627 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218] TypeError: ord() expected string of length 1, but int found
[Tue May 21 22:14:33.187637 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218] 
[Tue May 21 22:14:33.187993 2019] [wsgi:error] [pid 2147:tid 139939151333120] [remote 172.22.10.142:57218] ipa: INFO: [jsonserver_session] louis.abel2.COM: idoverrideuser_find('Default Trust View', '', sizelimit=0, version='2.230'): InternalError
[description of the issue]

Comment 1 Christian Heimes 2019-12-11 10:28:19 UTC
The issue is caused by an invalid call to escape_filter_chars(). The function is called with bytes but only works with text. The fix is trivial.

Comment 2 Christian Heimes 2019-12-12 08:59:38 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/c30a0c22681ec4a5d6cdf341a69d144f6ab3a0a8

Comment 5 Christian Heimes 2019-12-12 12:39:14 UTC
Fixed upstream
ipa-4-8:
https://pagure.io/freeipa/c/9462e4c4b6e37fd1178f96d6d901db8d115c4cfb

Comment 13 Varun Mylaraiah 2020-02-20 07:40:42 UTC
Verified SanityOnly 

https://idm-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/trigger-test-suite/job/master/1684/console

Based on the test result, marking the bug VERIFIED.

Comment 15 errata-xmlrpc 2020-04-28 15:44:12 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/RHEA-2020:1640