Vitor-Avila commented on PR #26654:
URL: https://github.com/apache/superset/pull/26654#issuecomment-2137310010

   @mistercrunch we got a few reports of users facing errors to delete objects 
on our end as well (after the fix was released to production). Here's an 
example stack trace:
   ```
   Traceback (most recent call last):
     File "/home/superset/preset/superset/superset/daos/base.py", line 217, in 
delete
       db.session.commit()
     File "<string>", line 2, in commit
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 1435, in commit
       self._transaction.commit(_to_root=self.future)
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 829, in commit
       self._prepare_impl()
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 808, in _prepare_impl
       self.session.flush()
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 3367, in flush
       self._flush(objects)
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 3507, in _flush
       transaction.rollback(_capture_exception=True)
     File 
"/usr/local/lib/python3.9/site-packages/sqlalchemy/util/langhelpers.py", line 
70, in __exit__
       compat.raise_(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py", 
line 207, in raise_
       raise exception
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 3467, in _flush
       flush_context.execute()
     File 
"/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/unitofwork.py", line 
456, in execute
       rec.execute(self)
     File 
"/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/unitofwork.py", line 
577, in execute
       self.dependency_processor.process_deletes(uow, states)
     File 
"/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/dependency.py", line 
1110, in process_deletes
       self._run_crud(
     File 
"/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/dependency.py", line 
1207, in _run_crud
       raise exc.StaleDataError(
   sqlalchemy.orm.exc.StaleDataError: DELETE statement on table 'tagged_object' 
expected to delete 1 row(s); Only 2 were matched.
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File 
"/home/superset/preset/superset/superset/commands/dashboard/delete.py", line 
49, in run
       DashboardDAO.delete(self._models)
     File "/home/superset/preset/superset/superset/daos/base.py", line 220, in 
delete
       raise DAODeleteFailedError(exception=ex) from ex
   superset.daos.exceptions.DAODeleteFailedError: Delete failed
   ```
   
   I managed to reproduce with a certain dashboard on my end as well, but it's 
inconsistent (I can't reliably reproduce with every new dashboard).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to