Bug 1993124

Summary: [RFE] - dsconf should allow to configure the timeout for tasks.
Product: Red Hat Directory Server Reporter: Têko Mihinto <tmihinto>
Component: Command Line UtilitiesAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: medium Docs Contact: Evgenia Martynyuk <emartyny>
Priority: medium    
Version: 11.3CC: aadhikar, abobrov, bsmejkal, cilmar, emartyny, idm-ds-dev-bugs, mreynolds, pcech, vashirov
Target Milestone: DS12.2Keywords: FutureFeature, Triaged
Target Release: dirsrv-12.2   
Hardware: x86_64   
OS: Linux   
Whiteboard: sync-to-jira
Fixed In Version: redhat-ds-12-9020020230314150545.1674d574 Doc Type: Enhancement
Doc Text:
.The `dsconf` utility can now set timeout for tasks Previously, if a task took longer than four minutes, `dsconf` returned the following message: ---- DEBUG: The backup create task has failed with the error code: (None) ... ---- With this enhancement, you can set the required timeout for the task by using the `--timeout` option. The timeout does not stop the task, however it stops the `dsconf` utility from waiting for the task result.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-30 09:40: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:

Description Têko Mihinto 2021-08-12 12:30:08 UTC
Description of problem:

In lib389/tasks.py, there is a timeout of 120 * 2 seconds ( 4 minutes ) when a new task is created.
In case the task takes longer, dsconf returns the following message:

==========================================
...
DEBUG: The backup create task has failed with the error code: (None)
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 134, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/backup.py", line 20, in backup_create
    raise ValueError("The backup create task has failed with the error code: ({})".format(result))
ValueError: The backup create task has failed with the error code: (None)
ERROR: Error: The backup create task has failed with the error code: (None)
==========================================

It would be nice to:
* allow dsconf to specify a timeout ( maybe this is already possible but I don't see any documented option )
* provide additional information stating that the timeout was over.


Version-Release number of selected component (if applicable):

$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)
$
$ rpm -qa | grep 389-ds-base
389-ds-base-debugsource-1.4.3.13-1.module+el8dsrv+8334+69a46a2e.x86_64
389-ds-base-libs-1.4.3.22-1.module+el8dsrv+10501+8ce33e95.x86_64
389-ds-base-debuginfo-1.4.3.13-1.module+el8dsrv+8334+69a46a2e.x86_64
389-ds-base-1.4.3.22-1.module+el8dsrv+10501+8ce33e95.x86_64
$

How reproducible:
Always.

Steps to Reproduce:
1. Launch a task that will last longer than 4 minutes.
2. Check the output of the dsconf command
3. Check the errors log

Actual results:
The dsconf command fails and returns no reason for the failure.

Expected results:
* Allow to specify the timeout
* Provide additional information about the failure.

Additional info:
Issue was seen at a customer site.
I could reproduce by reducing the timeout value in /usr/lib/python3.6/site-packages/lib389/tasks.py in the wait() function.

$ dsconf -v -D "cn=Directory Manager" ldap://localhost:5389 backup create
...
DEBUG: cn=backup_2021-08-11T17:49:34.483894,cn=backup,cn=tasks,cn=config getVal('nsTaskExitCode')
DEBUG: cn=backup_2021-08-11T17:49:34.483894,cn=backup,cn=tasks,cn=config getVal('nsTaskLog')
DEBUG: cn=backup_2021-08-11T17:49:34.483894,cn=backup,cn=tasks,cn=config getVal('nsTaskWarning')
DEBUG: cn=backup_2021-08-11T17:49:34.483894,cn=backup,cn=tasks,cn=config getVal('nsTaskExitCode')
DEBUG: cn=backup_2021-08-11T17:49:34.483894,cn=backup,cn=tasks,cn=config getVal('nsTaskLog')
DEBUG: cn=backup_2021-08-11T17:49:34.483894,cn=backup,cn=tasks,cn=config getVal('nsTaskWarning')
DEBUG: The backup create task has failed with the error code: (None)
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 134, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/backup.py", line 20, in backup_create
    raise ValueError("The backup create task has failed with the error code: ({})".format(result))
ValueError: The backup create task has failed with the error code: (None)
ERROR: Error: The backup create task has failed with the error code: (None)
$

Comment 4 Petr Čech 2022-05-25 12:15:58 UTC
As the RHEL 8.5 reached EOL, it makes sense to move this BZ to dirsrv-11.5, which means RHEL 8.6.

Comment 6 mreynolds 2023-02-15 21:06:31 UTC
Upstream ticket: https://github.com/389ds/389-ds-base/issues/5666

Comment 17 Evgenia Martynyuk 2023-05-16 20:56:16 UTC
Peer comment were applied.  RN text is release pending

Comment 19 errata-xmlrpc 2023-05-30 09:40:35 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 (redhat-ds:12 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-2023:3344