OTP error validation

Hi guys,
I am having some issues in authenticator with OTP.
I create OTP for new users but when authenticating it shows error, but old users still work normally.
Log in UI show: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Log in /var/log/privacyidea/privacyidea.log:
[2024-10-07 11:15:57,211][1223][140321173296896][ERROR][privacyidea.app:1891] Exception on /validate/check [POST]
Traceback (most recent call last):
File “/opt/privacyidea/lib/python3.8/site-packages/flask/app.py”, line 2447, in wsgi_app
response = self.full_dispatch_request()
File “/opt/privacyidea/lib/python3.8/site-packages/flask/app.py”, line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File “/opt/privacyidea/lib/python3.8/site-packages/flask/app.py”, line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File “/opt/privacyidea/lib/python3.8/site-packages/flask/_compat.py”, line 39, in reraise
raise value
File “/opt/privacyidea/lib/python3.8/site-packages/flask/app.py”, line 1950, in full_dispatch_request
rv = self.dispatch_request()
File “/opt/privacyidea/lib/python3.8/site-packages/flask/app.py”, line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/postpolicy.py”, line 109, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/postpolicy.py”, line 109, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/postpolicy.py”, line 109, in policy_wrapper
response = wrapped_function(*args, **kwds)
[Previous line repeated 8 more times]
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/decorators.py”, line 41, in function_wrapper
response = wrapped_function(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/prepolicy.py”, line 155, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/prepolicy.py”, line 155, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/prepolicy.py”, line 155, in policy_wrapper
return wrapped_function(*args, **kwds)
[Previous line repeated 5 more times]
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/lib/decorators.py”, line 100, in check_user_or_serial_in_request_wrapper
f_result = func(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/lib/subscriptions.py”, line 338, in check_subscription_wrapper
f_result = func(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/api/lib/prepolicy.py”, line 155, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/lib/event.py”, line 116, in event_wrapper
if event_handler.check_condition(options=options):
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/lib/eventhandler/base.py”, line 593, in check_condition
if not compare_generic_condition(cond,
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/lib/utils/init.py”, line 911, in compare_generic_condition
res = compare_value_value(key_method(key), comparator, value)
File “/opt/privacyidea/lib/python3.8/site-packages/privacyidea/lib/utils/init.py”, line 882, in compare_value_value
return value1 < value2
TypeError: ‘<’ not supported between instances of ‘NoneType’ and ‘str’

I hope to receive your support. Thanks!!

You configured a broken event handler or you loaded a bogus subscription file.

How can I fix this error, I had restarted the server but nothing happened :frowning:

React to what others say!

Posting “How can i fix it” does not bring you any further.

As I said, the error log indicates, that you have some bogus conditions probably in some event handlers. And may be a wrong subscription.

So it might be a good idea, that you look into that or that you post your according configuration.

Could you clarify which configuration you are referring to? I’m quite confused. Additionally, I have a backup server that is functioning properly. Is it possible to replace the configuration on the faulty server?

You can use

pi-manage config exporter (–help)

to export your configuration or parts of your configuration. You can do it on both machines and compare.

You can use pi-manage config importer to import.

THIS IS A HINT. THIS IS NOT A DETAILED EXPLANATION!

Read the man page and the docs before doing so. And think before doing so!

I do not take any responsiblity here for persons doing things without reading and thinking!

Resolve: import config from backup server

Great, thanks for the heads up.