dosubot[bot] commented on issue #30211:
URL: https://github.com/apache/superset/issues/30211#issuecomment-2340639553
<!-- Answer -->
The error during `superset init` after a successful `superset db upgrade` is
likely due to an issue in the migration script
`4a33124c18ad_mig_new_columnar_upload_perm.py`. Specifically, the error
handling in the `upgrade` function might not be sufficient to catch and handle
all potential issues that could arise during the permission migration process.
Here is the relevant part of the migration script:
```python
def upgrade():
bind = op.get_bind()
session = Session(bind=bind)
do_upgrade(session)
try:
session.commit()
except SQLAlchemyError as ex:
session.rollback()
raise Exception(f"An error occurred while upgrading permissions:
{ex}") from ex
```
If an error occurs during the `do_upgrade(session)` call, it will be caught
by the `except` block, which rolls back the session and raises a new exception
with a message indicating that an error occurred while upgrading permissions.
This could be the source of the error you encountered during `superset init`.
To diagnose the specific cause, you would need to check the exact error
message that was raised. This message should provide more details about what
went wrong during the permission migration process
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/migrations/versions/2024-04-26_12-36_4a33124c18ad_mig_new_columnar_upload_perm.py)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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]