Bug 55082 - optparse.OptionConflictError: option -A/--authentication-file: conflicting option string(s): -A, --authentication-file
optparse.OptionConflictError: option -A/--authentication-file: conflicting op...
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Nikola Radovanovic
Arvid Requate
:
Depends on: 53100
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-10 12:03 CEST by Florian Best
Modified: 2022-09-08 11:43 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): bitesize, Regression
Max CVSS v3 score: 7.3 (CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2022-08-10 12:03:49 CEST
Several jenkins jobs for UCS 5.0-2 log the following traceback:

2 times in /var/log/univention/join.log:
https://jenkins2022.knut.univention.de/job/UCSschool-5.0/job/Install%20Multiserver/Config=s4,TestGroup=base1,UCSRelease=testing/ws/test/join.log
Traceback (most recent call last):
» File "/usr/share/univention-samba4/scripts/univention-samba4-site-tool.py", line 78, in <module>
»   parser.add_option("-A", "--authentication-file", dest="authentication_file", help="Get the credentials from a file")
» File "/usr/lib/python3.7/optparse.py", line 1008, in add_option
»   self._check_conflict(option)
» File "/usr/lib/python3.7/optparse.py", line 983, in _check_conflict
»   option)
optparse.OptionConflictError: option -A/--authentication-file: conflicting option string(s): -A, --authentication-file

called from joinscript services/univention-samba4/96univention-samba4.inst.

+++ This bug was initially created as a clone of Bug #53100 +++
Comment 1 Daniel Tröder univentionstaff 2022-08-17 16:15:27 CEST
This is already added by /usr/lib/python3/dist-packages/samba/getopt.py
Comment the line with "-A" out, and run it:

-----------------------------------------------------------------
root@master203:~# /usr/share/univention-samba4/scripts/univention-samba4-site-tool.py --help

[..]

  Credentials Options:
[..]
    -A AUTHFILE, --authentication-file=AUTHFILE
                        Authentication file
-----------------------------------------------------------------

So adding it to univention-samba4-site-tool.py is not necessary.

The samba/getopt.py seems to be custom patched or similar, as this options code does not exist anywhere in Sambas repository.

AFAICS the option can be removed and lines 110-113 are not necessary, and "-A" can still be used.
Comment 2 Daniel Tröder univentionstaff 2022-08-17 16:16:35 CEST
The script fails in all of UCS@school Jenkins jobs.
Comment 3 Daniel Tröder univentionstaff 2022-08-17 16:38:36 CEST
[5.0-2 9bfcebb3bb] Bug #55082: Ignore traceback from optparse.OptionConflictError
Comment 4 Nikola Radovanovic univentionstaff 2022-08-23 12:11:06 CEST
MR: https://git.knut.univention.de/univention/ucs/-/merge_requests/488
Comment 5 Nikola Radovanovic univentionstaff 2022-08-25 17:40:51 CEST
9bfcebb3bb | Ignore traceback from optparse.OptionConflictError
3a89020640 | - optparse.OptionConflictError option -A/--authentication-file: conflicting option string(s): -A, --authentication-file
0d62c3f1b7 | Advisory update
Comment 6 Arvid Requate univentionstaff 2022-08-25 17:59:05 CEST
Verified:
* Code review
* Functional test

password=univention
root@primary20:~# /usr/share/univention-samba4/scripts/univention-samba4-site-tool.py -H "ldap://$(hostname -f)" \
                               -A auth-file.txt --site foo1 --createsite --ignore-exists
created site foo1

* Test not strictly required
* Documentation update not required
* No risk expected for other (non-updated) systems
* Advisory