Skip to content

WanGP v13.0 issue #1739

Description

@TurbinoZ100000

Package

WanGP

When did the issue occur?

Running the Package

What GPU / hardware type are you using?

5070 ti

What happened?

Everything seems to be working correctly, but there's a constant error message at the top of the GUI:

Connection to server lost. Reconnecting…

This error is thrown in console every second or so:

ERROR: Exception in ASGI application
Traceback (most recent call last):
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 415, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 56, in call
return await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\fastapi\applications.py", line 1159, in call
await super().call(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\applications.py", line 107, in call
await self.middleware_stack(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\errors.py", line 186, in call
raise exc
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\errors.py", line 164, in call
await self.app(scope, receive, _send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\shared\gradio\gradio_frontend_patch.py", line 207, in call
return await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\base.py", line 191, in call
with recv_stream, send_stream, collapse_excgroups():
File "E:\StabilityMatrix\Data\Assets\Python\cpython-3.10.19-windows-x86_64-none\lib\contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette_utils.py", line 87, in collapse_excgroups
raise exc
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\base.py", line 193, in call
response = await self.dispatch_func(request, call_next)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\shared\gradio\video_preview.py", line 341, in _wangp_video_preview_upload_middleware
response = await call_next(request)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\base.py", line 168, in call_next
raise app_exc from app_exc.cause or app_exc.context
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\base.py", line 144, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\gradio\route_utils.py", line 834, in call
await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\shared\authentication\web.py", line 165, in call
return await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\shared\authentication\web.py", line 150, in call
return await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\exceptions.py", line 63, in call
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette_exception_handler.py", line 53, in wrapped_app
raise exc
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\routing.py", line 716, in call
await self.middleware_stack(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\routing.py", line 736, in app
await route.handle(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\routing.py", line 462, in handle
await self.app(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\fastapi\applications.py", line 1159, in call
await super().call(scope, receive, send)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\applications.py", line 106, in call
self.middleware_stack = self.build_middleware_stack()
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\fastapi\applications.py", line 1065, in build_middleware_stack
app = cls(app, *args, **kwargs)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\exceptions.py", line 34, in init
self.add_exception_handler(key, value)
File "E:\StabilityMatrix\Data\Packages\Wan2GP\venv\lib\site-packages\starlette\middleware\exceptions.py", line 44, in add_exception_handler
assert issubclass(exc_class_or_status_code, Exception)
TypeError: issubclass() arg 1 must be a class

First reported this on the WanGP github and received this reply, I'm not really tech savvy to understand it:

This is a Stability Matrix issue.

Wan2GP's console output does not reach the console in Stability Matrix, unlike every other WebUI package managed by it. Due to this, a custom wrapper was made that chain loads the Wan2GP launch so that stdout and errors sent by Wan2GP over gradio are intercepted and displayed in the package console in SM, otherwise nothing gets displayed as Wan2GP doesn't send anything it can grab.

Wan2GP v13's Deepy panel crashes because Stability Matrix's launch wrapper turns gradio.Error from a class into a plain function, and WanGP registers that name as an exception handler that must be a class. This started with commit deepbeepmeep/Wan2GP@87d0eeb, 2026-09-11, shipped in v13, which added the two add_exception_handler lines. Generation and the rest of the UI are unaffected; it is the Deepy panel and the log spam.

This issue does not reproduce outside of Stability Matrix.

The fault is in the wrapper and needs to be reported to the Stability Matrix repo for tracking.

Console output

No response

Version

v2.16.3

What Operating System are you using?

Windows

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions