Description
The module does cli_flask = sys.modules["flask.cli"] at import time. If flask.cli has not been imported yet, this raises KeyError and the backend fails to start before serving any request. This is a hard startup crash path and depends on import order, which is brittle across environments.
Severity: high
File: config_portal/backend/server.py
Expected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.
Description
The module does
cli_flask = sys.modules["flask.cli"]at import time. Ifflask.clihas not been imported yet, this raisesKeyErrorand the backend fails to start before serving any request. This is a hard startup crash path and depends on import order, which is brittle across environments.Severity:
highFile:
config_portal/backend/server.pyExpected Behavior
The code should handle this case properly to avoid unexpected errors or degraded quality.