Skip to content

fix: import-time crash risk from direct sys.modules["flask.cli"] lookup #1271

@huyhoang171106

Description

@huyhoang171106

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions