Veonms commented on issue #33423:
URL: https://github.com/apache/superset/issues/33423#issuecomment-3107549390

   It’s been a few weeks since I last looked at this since I’ve been away but I 
found that it was an issue with some metadata missing/out of sync. We would see 
logs indicating this in Postgres (RDS):

   
   ``` logs
   ERROR: insert or update on table "tab_state" violates foreign key constraint 
"saved_query_id"
   DETAIL: Key (saved_query_id)=(602) is not present in table "saved_query".
   ```
   
   To resolve this I found that the user has to just update their query. If you 
get the user to go to 
```https://<superset_host>/sqllab?savedQueryId=<query_from_postgres_logs>```, 
make a change, and then save it, resolves this issue. Depending on the role of 
the user (admin) you may/may not be able to do this yourself due to #21769.
   It’s not an ideal solution if you have 100s/1000s of users with the same 
issue but in our case it was just a handful so it wasn’t much of a problem for 
us.
   
   The interesting thing is that I couldn’t reproduce this issue. Using the 
exact same query which was ‘saved’, the issue wouldn’t return. I initially 
thought that it may be some constraint on the Postgres side preventing the 
query from being saved but the aforementioned concluded that this is not the 
case.
   My next best guess is that the request was dropped at some point and 
although the Superset error says that it will “retry later”, it never does, or 
at least successfully.
   
   Since doing the above the users that were having this issue haven’t had the 
error appear again but that's not to say that this is a permanent fix. I 
highlighted where the toast/error is raised in my other comment if you want to 
take a look yourself.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to