Bug 57172 - Internal error in selfservice while fetching reset methods
Internal error in selfservice while fetching reset methods
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2024-03-22 12:15 CET by Frank Greif
Modified: 2024-03-22 12:29 CET (History)
0 users

See Also:
What kind of report is it?: ---
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):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Greif 2024-03-22 12:15:58 CET
When an unauthenticated user chooses 'reset password' from the burger menu, an error message appears:

"Authentication failed: internal server error during passwordreset/get_reset_methods"

in management-console-module-passwordreset.log a Python traceback is logged:

```
22.03.24 11:25:12       ERROR      (    11433) : Uncaught exception POST /univention/command/passwordreset/get_reset_methods (0.0.0.0)
    HTTPServerRequest(protocol='http', host='dc01.intern.epharisto-ev.de', method='POST', uri='/univention/command/passwordreset/get_reset_methods', version='HTTP/1.1', remote_ip='0.0.0.0')
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/univention/management/console/modules/passwordreset/tokendb.py", line 130, in open_db
        self.logger.info("db_open(): Connected to database %r on server with version %r using protocol version %r.", DB_NAME, conn.server_version, conn.protocol_version)
    TypeError: info() takes 2 positional arguments but 5 were given
```

The corresponding source has been changed recently (commit bdecb09fe28141e6f62f77347c118d41305a463d)
```
CommitDate: Tue Feb 20 11:08:55 2024 +0100

    feat(self-service): make connection properties for postgresql and memcached configurable

    Bug #57061
```
The parameters of the call to `self.logger.info` have to be adjusted.

I will change this inplace into a construct of "string %r" % (arg,arg,...) for the time being. (I know, string formatting is a matter of taste, so the real solution may look differently.)
Comment 1 Frank Greif 2024-03-22 12:29:37 CET
Addendum: I did not dig into the class behind `self.logger` so I don't know if other calls (to `exception` or `error`) in this source file would potentially suffer from the same problem.