You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to delete a user from mealie but am unable to do so. The following error added in the logs is showing up.
Steps to Reproduce
Have an instance with Postgresql.
Go to Users
Select a user and click delete
Please provide relevant logs
ERROR 2024-10-30T12:39:27 - DELETE statement on table 'users_to_recipes' expected to delete 2 row(s); Only 0 were matched.
Traceback (most recent call last):
File "/app/mealie/routes/_base/mixins.py", line 120, in delete_one
item = self.repo.delete(item_id)
File "/app/mealie/repos/repository_users.py", line 62, in delete
entry = super().delete(value, match_key)
File "/app/mealie/repos/repository_generic.py", line 250, in delete
raise e
File "/app/mealie/repos/repository_generic.py", line 247, in delete
ERROR 2024-10-30T12:39:27 - DELETE statement on table 'users_to_recipes' expected to delete 2 row(s); Only 0 were matched.
self.session.commit()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2028, in commit
Traceback (most recent call last):
trans.commit(_to_root=True)
File "/app/mealie/routes/_base/mixins.py", line 120, in delete_one
File "<string>", line 2, in commit
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go
ret_value = fn(self, *arg, **kw)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1313, in commit
self._prepare_impl()
item = self.repo.delete(item_id)
File "/app/mealie/repos/repository_users.py", line 62, in delete
entry = super().delete(value, match_key)
File "/app/mealie/repos/repository_generic.py", line 250, in delete
raise e
File "/app/mealie/repos/repository_generic.py", line 247, in delete
self.session.commit()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2028, in commit
trans.commit(_to_root=True)
File "<string>", line 2, in commit
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go
ret_value = fn(self, *arg, **kw)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1313, in commit
self._prepare_impl()
File "<string>", line 2, in _prepare_impl
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go
File "<string>", line 2, in _prepare_impl
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go
ret_value = fn(self, *arg, **kw)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1288, in _prepare_impl
self.session.flush()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4352, in flush
self._flush(objects)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4487, in _flush
ret_value = fn(self, *arg, **kw)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1288, in _prepare_impl
self.session.flush()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4352, in flush
self._flush(objects)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4487, in _flush
with util.safe_reraise():
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
raise exc_value.with_traceback(exc_tb)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4448, in _flush
flush_context.execute()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute
rec.execute(self)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
self.dependency_processor.process_deletes(uow, states)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/dependency.py", line 1120, in process_deletes
self._run_crud(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/dependency.py", line 1222, in _run_crud
raise exc.StaleDataError(
sqlalchemy.orm.exc.StaleDataError: DELETE statement on table 'users_to_recipes' expected to delete 2 row(s); Only 0 were matched.
with util.safe_reraise():
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalche/my/util/langhelpers.py", line 146, in __exit__
raise exc_value.with_traceback(exc_tb)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 4448, in _flush
flush_context.execute()
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute
rec.execute(self)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py", line 589, in execute
self.dependency_processor.process_deletes(uow, states)
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/dependency.py", line 1120, in process_deletes
self._run_crud(
File "/opt/pysetup/.venv/lib/python3.10/site-packages/sqlalchemy/orm/dependency.py", line 1222, in _run_crud
raise exc.StaleDataError(
sqlalchemy.orm.exc.StaleDataError: DELETE statement on table 'users_to_recipes' expected to delete 2 row(s); Only 0 were matched.
INFO 2024-10-30T12:39:27 - [_PublicIPRemoved_:0] 400 Bad Request "DELETE /api/users/ed59ebfd-998c-4aaf-be3a-084b548aa528 HTTP/1.1"
Mealie Version
hkotel/mealie:latest, freshly pulled from docker, i believe it's 2.1.0
Deployment
Docker (Synology)
Additional Deployment Details
Portainer stack with docker.io/library/postgres:16-alpine
The text was updated successfully, but these errors were encountered:
First Check
What is the issue you are experiencing?
I am trying to delete a user from mealie but am unable to do so. The following error added in the logs is showing up.
Steps to Reproduce
Please provide relevant logs
Mealie Version
hkotel/mealie:latest, freshly pulled from docker, i believe it's 2.1.0
Deployment
Docker (Synology)
Additional Deployment Details
Portainer stack with docker.io/library/postgres:16-alpine
The text was updated successfully, but these errors were encountered: