alisonatwork commented on issue #29362:
URL: https://github.com/apache/superset/issues/29362#issuecomment-3326580172

   For what it's worth, we just experienced the same problem in our setup, in 
what appears to be exactly the same scenario.
   
   1. Sessions stored in Redis
   2. Try to upload CSV file
   -> error page, even though if you open a new tab and reload Superset it 
shows that the load actually succedeed
   
   The error page hide the stack trace in the browser, but the actual stack 
trace in the server logs is exactly what was documented above - some mysterious 
error about `LazyString` not serializing correctly. We also patched the 
Superset source code in prod to print out the `dict` representation of the 
session to try figure out what was going wrong, and we also found this:
   
   ```py
   '_flashes': [
     (
       'danger',
       l'Unable to upload CSV file "REDACTED.csv" to table "REDACTED" in 
database "REDACTED". Error message: Table 'REDACTED' already exists.'
     )
   ]
   ```
   
   I.e. exactly the same error as @weigosw.
   
   There are a couple of bugs here. I think the first bug is "table already 
exists" is happening even on the first attempt to upload. It's also a bit of a 
weird because I thought CSV upload was supposed to be additive/merge, but 
that's by-the-by.
   
   The second bug is that the error message is a `LazyString` instead of a 
plain old string, which means it cannot be serialized to Redis when the session 
manager try to JSONify the session. I don't know where that error message is 
generated, but perhaps it could be converted earlier, before it even get put 
into the session object.
   
   A broader question I have is why error messages should go into the session 
at all, since seems like no need to make them stateful and could just be part 
of the HTTP response, but perhaps that's just a side-effect of the framework?


-- 
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