Bug 1974822

Summary: [regression] IPA server in debug mode fails to run because time.perf_counter_ns is Python 3.7+
Product: Red Hat Enterprise Linux 8 Reporter: Scott Poore <spoore>
Component: ipaAssignee: François Cami <fcami>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: ksiddiqu, myusuf, rcritten, tscherf, twoerner
Target Milestone: betaKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: idm-client-8050020210708083354.de73ecb2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1978747 (view as bug list) Environment:
Last Closed: 2021-11-09 18:29:22 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: 1978747    

Description Scott Poore 2021-06-22 15:43:59 UTC
Description of problem:

When running the IPA server in debug mode, I am seeing "Internal Server Error" messages when running IPA commands.

ipa: ERROR: cannot connect to 'https://ipa-server-hostname/ipa/session/json': Internal Server Error

Looking at the logs:

module 'time' has no attribute 'perf_counter_ns'

Version-Release number of selected component (if applicable):
ipa-server-4.9.3-1.module+el8.5.0+10565+ae980a94.x86_64


How reproducible:
always

Steps to Reproduce:
1.  ipa-server-install
2.  echo -e '[global]\ndebug=True' >> /etc/ipa/server.conf
3.  systemctl restart httpd
4.  ipa user-find

Actual results:
Internal Server Error

Expected results:
list users

Additional info:

Comment 1 François Cami 2021-06-22 15:52:31 UTC
Investigation:

This is caused by perf_counter_ns being Python 3.7+ only.
That is only used in rpcserver.py ; putting a lambda there that defines time.perf_counter_ns is enough to fix the problem.
It has to be done conditionally on Python version e.g. the current code is fine for Python 3.7+.

Comment 2 François Cami 2021-06-22 19:23:54 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/8891

Comment 3 François Cami 2021-06-22 19:36:45 UTC
PR: https://github.com/freeipa/freeipa/pull/5852

Comment 16 Mohammad Rizwan 2021-07-30 12:29:45 UTC
version:  ipa-server-4.9.6-4.module+el8.5.0+11912+1b4496cf

2021-07-30T11:09:19+0000 ipatests/test_integration/test_installation.py::TestInstallMaster::test_install_master PASSED [ 50%]
2021-07-30T11:10:23+0000 ipatests/test_integration/test_installation.py::TestInstallMaster::test_smoke_test_for_debug_mode PASSED [100%]

Automation passed. report.html is attached for reference.

Comment 18 errata-xmlrpc 2021-11-09 18:29:22 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 (ipa bug fix and enhancement update), 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-2021:4230

Comment 19 Red Hat Bugzilla 2023-09-15 01:10:22 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days