2fa login not possible

erpnext ist connected with ldap. And I am able to login with my ldap accounts.
Then I ve tried to set up 2fa.
I ve tried OTP and email on both I am not able to login in.
I enter Username and Password. Then I get a mail with 6digits as expectetd.
When I enter the 6 digits. I get the error message Login invalid, please try again.

I got this error message in the developer console
Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 95, in application
File “apps/frappe/frappe/app.py”, line 191, in init_request
frappe.local.http_request = HTTPRequest()
File “apps/frappe/frappe/auth.py”, line 40, in init
File “apps/frappe/frappe/auth.py”, line 76, in set_session
frappe.local.login_manager = LoginManager()
File “apps/frappe/frappe/auth.py”, line 112, in init
if self.login() is False:
File “apps/frappe/frappe/auth.py”, line 137, in login
self.authenticate(user=user, pwd=pwd)
File “apps/frappe/frappe/auth.py”, line 259, in authenticate
self.fail(“Invalid login credentials”, user=user.name)
File “apps/frappe/frappe/auth.py”, line 304, in fail
raise frappe.AuthenticationError

Maybe someone can point me the right direction.
I ve the same problem with the latest v14 and v15

thanks a log

is here somebody who can help?
If I enter the wrong username and passwort. I get immediately the message, that username or password is wrong
If I enter the correct username and password. I am prompted to enter the 2nd factor.
I ve tried Mail and OTP. I both cases the login is invalid.