gweis opened a new issue, #38413:
URL: https://github.com/apache/superset/issues/38413

   ### Bug description
   
   Superset re-encrypt-secrets does not find any colums to re-encrypt and 
therefore does nothing when it attempts to re-encrypt-secrets.
   
   This is at least in superset 6.0.0 and later (not sure whether it affects 
earlier versions).
   
   I also believe it is the core issue for 
https://github.com/apache/superset/issues/37842. Yes, lazy configuration of the 
secret key solves another potential pitfall, but in my case that was not the 
problem.
   
   The actual problem seems to be here 
https://github.com/apache/superset/blob/master/superset/utils/encrypt.py#L109 .
   
   SQLA Model metadata is stored in `flask_appbuilder.Model.metadata` rather 
than in `superset.db` which is the Flask-SQLAlchemy SQLA instance apparently 
used for db connections only. (`flask_appbuilder.Model' seems to be the SQLA 
instance for model management only).
   
   So the line above should rather be something like 
   ```
   # import FAB Model somwhere
   # from flask_appbuilder import Model 
   
   # use FAB Model instead of sef._db.metadata
   for table_name, table in Model.metadata.tables.items():
   ```
   
   As a workaround for now I created a custom CLI script, which is just a 
duplication of the existing code, but replaced that one line. Everything is 
working as expected.
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   6.0.0
   
   ### Python version
   
   3.11
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   No stacktrace applicable here. Nothing errors because it does nothing at the 
moment.
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


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