ObjectDeletedError

Hi Cornelius,

I’m using a MySQL Galera Cluster as database backend. Checking my logs I
found several errors related the apis* /token/init* and /validate/check.
The error is:

“ObjectDeletedError: Instance ‘<TokenInfo at 0x7f35d11bb0d0>’ has been
deleted, or its row is otherwise not present.”

This is the full error trace:

[2016-12-19 10:10:11,038][12094][139869586839296][ERROR][privacyidea.app:
1423] Exception on /validate/check [GET]
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1817, in
wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1477, in
full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1381, in
handle_user_exception
reraise(exc_type, exc_value, tb)
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1475, in
full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1461, in
dispatch_request
return self.view_functionsrule.endpoint
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py”,
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py”,
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py”,
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py”,
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py”,
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py”,
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/prepolicy.py”,
line 106, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/prepolicy.py”,
line 106, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/decorators.py”,
line 89, in check_user_or_serial_in_request_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/prepolicy.py”,
line 106, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/event.py”, line 58,
in event_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/validate.py”, line
208, in check
result, details = check_serial_pass(serial, password, options=options)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/log.py”, line 180,
in log_wrapper
f_result = func(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/lib/policydecorators.py",
line 82, in policy_wrapper
return self.decorator_function(wrapped_function, *args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/lib/policydecorators.py",
line 377, in auth_lastauth
res, reply_dict = wrapped_function(user_or_serial, passw, options)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/token.py”, line
1797, in check_serial_pass
options=options)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/log.py”, line 180,
in log_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/token.py”, line
1967, in check_token_list
token_obj.inc_count_auth_success()
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/decorators.py”,
line 45, in token_locked_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/tokenclass.py”,
line 277, in add_tokeninfo
self.token.set_info(add_info)
File “/usr/lib/python2.7/dist-packages/privacyidea/models.py”, line 484,
in set_info
Type=types.get(k)).save()
File “/usr/lib/python2.7/dist-packages/privacyidea/models.py”, line 591,
in save
ret = self.id
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py”,
line 316, in get
return self.impl.get(instance_state(instance), dict_)
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py”,
line 611, in get
value = callable_(state, passive)
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/state.py”, line 380,
in call
self.manager.deferred_scalar_loader(self, toload)
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/loading.py”, line
606, in load_scalar_attributes
raise orm_exc.ObjectDeletedError(state)
ObjectDeletedError: Instance ‘<TokenInfo at 0x7f35d10c1d90>’ has been
deleted, or its row is otherwise not present.

Is it a known issue?

Thanks in advance,

Daniele

Hello Daniele,

no, this is not a know issue.

You should have this investigated. Taking into account versions of the
software components and your setup of the cluster.

Kind regards
COrnelius

caruso.daniele.89@gmail.com:Am Montag, 19. Dezember 2016 10:32:50 UTC+1 schrieb

Hi Cornelius,

I’m using a MySQL Galera Cluster as database backend. Checking my logs I
found several errors related the apis* /token/init* and /validate/check.
The error is:

“ObjectDeletedError: Instance ‘<TokenInfo at 0x7f35d11bb0d0>’ has been
deleted, or its row is otherwise not present.”

This is the full error trace:

[2016-12-19 10:10:11,038][12094][139869586839296][ERROR][privacyidea.app:
1423] Exception on /validate/check [GET]
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1817, in
wsgi_app
response = self.full_dispatch_request()
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1477, in
full_dispatch_request
rv = self.handle_user_exception(e)
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1381, in
handle_user_exception
reraise(exc_type, exc_value, tb)
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1475, in
full_dispatch_request
rv = self.dispatch_request()
File “/usr/lib/python2.7/dist-packages/flask/app.py”, line 1461, in
dispatch_request
return self.view_functionsrule.endpoint
File
"/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py",
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py",
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py",
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py",
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py",
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/api/lib/postpolicy.py",
line 99, in policy_wrapper
response = wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/prepolicy.py”
, line 106, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/prepolicy.py”
, line 106, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/decorators.py”,
line 89, in check_user_or_serial_in_request_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/lib/prepolicy.py”
, line 106, in policy_wrapper
return wrapped_function(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/event.py”, line
58, in event_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/api/validate.py”,
line 208, in check
result, details = check_serial_pass(serial, password, options=options)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/log.py”, line 180
, in log_wrapper
f_result = func(*args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/lib/policydecorators.py",
line 82, in policy_wrapper
return self.decorator_function(wrapped_function, *args, **kwds)
File
"/usr/lib/python2.7/dist-packages/privacyidea/lib/policydecorators.py",
line 377, in auth_lastauth
res, reply_dict = wrapped_function(user_or_serial, passw, options)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/token.py”, line
1797, in check_serial_pass
options=options)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/log.py”, line 180
, in log_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/token.py”, line
1967, in check_token_list
token_obj.inc_count_auth_success()
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/decorators.py”,
line 45, in token_locked_wrapper
f_result = func(*args, **kwds)
File “/usr/lib/python2.7/dist-packages/privacyidea/lib/tokenclass.py”,
line 277, in add_tokeninfo
self.token.set_info(add_info)
File “/usr/lib/python2.7/dist-packages/privacyidea/models.py”, line 484,
in set_info
Type=types.get(k)).save()
File “/usr/lib/python2.7/dist-packages/privacyidea/models.py”, line 591,
in save
ret = self.id
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py”,
line 316, in get
return self.impl.get(instance_state(instance), dict_)
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py”,
line 611, in get
value = callable_(state, passive)
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/state.py”, line
380, in call
self.manager.deferred_scalar_loader(self, toload)
File “/usr/lib/python2.7/dist-packages/sqlalchemy/orm/loading.py”, line
606, in load_scalar_attributes
raise orm_exc.ObjectDeletedError(state)
ObjectDeletedError: Instance ‘<TokenInfo at 0x7f35d10c1d90>’ has been
deleted, or its row is otherwise not present.

Is it a known issue?

Thanks in advance,

Daniele