Skip to content

Python 3.14: Production mode crashes with "Cannot finalize signals outside of event loop" #3132

@shreevathsaEK22

Description

@shreevathsaEK22

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When running Sanic on Python 3.14 with debug=False, the server crashes during startup or on first request with:
sanic_routing.exceptions.NotFound: Could not find signal http.middleware.before with {'attach_to': 'response'}\n", "filename": "types.py", "correlation_id": "056ab372-f4f6-11f0-8bef-3667fa84840f"}

Code snippet

No response

Expected Behavior

No response

How do you run Sanic?

Sanic CLI

Operating System

Linux

Sanic Version

25.13.12

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions