You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "eschutho (via GitHub)" <gi...@apache.org> on 2025/08/06 22:25:27 UTC
[PR] fix(initialization): prevent startup failures when database tables don't exist [superset]
eschutho opened a new pull request, #34584:
URL: https://github.com/apache/superset/pull/34584
### SUMMARY
Added defensive initialization checks to prevent application startup failures
when database tables haven't been created yet. The application now
gracefully skips database-dependent features during initialization if the
database is not ready, allowing successful startup even before migrations
have run.
The key change is the introduction of a `_init_database_dependent_features()`
method that checks for table existence before attempting to initialize
features like the tagging system and theme seeding. This prevents
`OperationalError` exceptions that would otherwise crash the application
during startup.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable - backend initialization change only
### TESTING INSTRUCTIONS
1. Run the new unit tests: `pytest tests/unit_tests/initialization_test.py
-v`
2. To manually test the fix:
- Start with a fresh database (no tables created)
- Start the Superset application
- Verify the application starts without errors
- Check logs for: "Superset tables not yet created. Skipping
database-dependent initialization"
- Run migrations: `superset db upgrade`
- Restart the application
- Verify all features initialize properly
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
**Author:** Claude (Anthropic's AI Assistant)
**Co-authored-by:** Elizabeth Thompson
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(initialization): prevent startup failures when database tables don't exist [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #34584:
URL: https://github.com/apache/superset/pull/34584#issuecomment-3162014848
Wondering what happens afterwards if the app starts up but the database isn't ready after this change. If there are tasks/jobs that needs to be run, wondering if doing a retry somewhere would make sense such that we can retry those operations.
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(initialization): prevent startup failures when database tables don't exist [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #34584:
URL: https://github.com/apache/superset/pull/34584
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org