Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anyio - BrokenResourceError #1441

Closed
befedo opened this issue Feb 23, 2022 · 2 comments
Closed

anyio - BrokenResourceError #1441

befedo opened this issue Feb 23, 2022 · 2 comments
Labels

Comments

@befedo
Copy link

befedo commented Feb 23, 2022

Hello,

I have a dash application which is hosted as a FastAPI middleware with uvicorn. When I run the whole thing, with > python app.py everything works as expected. After building a standalone application (see below, build.bat) I get the following error:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\uvicorn\protocols\http\h11_impl.py", line 364, in run_asgi
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\uvicorn\middleware\proxy_headers.py", line 75, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\fastapi\applications.py", line 212, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\applications.py", line 112, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\middleware\errors.py", line 159, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\exceptions.py", line 71, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\routing.py", line 656, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\routing.py", line 408, in handle
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\middleware\wsgi.py", line 64, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\middleware\wsgi.py", line 91, in __call__
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\to_thread.py", line 28, in run_sync
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\_backends\_asyncio.py", line 818, in run_sync_in_worker_thread
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\_backends\_asyncio.py", line 754, in run
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\starlette\middleware\wsgi.py", line 126, in wsgi
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\from_thread.py", line 35, in run
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\_backends\_asyncio.py", line 847, in run_async_from_thread
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\concurrent\futures\_base.py", line 446, in result
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\concurrent\futures\_base.py", line 391, in __get_result
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\streams\memory.py", line 193, in send
  File "C:\Users\nuitka\DOCUME~1\build\app\APP~1.DIS\anyio\streams\memory.py", line 177, in send_nowait
anyio.BrokenResourceError

I've installed all in a venv, with the following version:

> python -mnuitka --version
0.7
Commercial: None
Python: 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21) [MSC v.1929 64 bit (AMD64)]
Flavor: Unknown
Executable: C:\Users\nuitka\Documents\build\app\.env\Scripts\python.exe
OS: Windows
Arch: x86_64
WindowsRelease: 10

I've invoked nuitka like below (build.bat)

python -m nuitka^
  --mingw64^
  --standalone^
  --prefer-source-code^
  --assume-yes-for-downloads^
  --enable-plugin=numpy^
  --enable-plugin=multiprocessing^
  --enable-plugin=pylint-warnings^
  --include-package=sqlalchemy^
  --include-package=plotly^
  --include-data-dir=app/assets=app/assets^
  --include-package-data=plotly^
  --include-package-data=dash^
  --include-package-data=dash_renderer^
  --include-package-data=dash_extensions^
  --include-package-data=dash_html_components^
  --include-package-data=dash_core_components^
  --include-package-data=dash_bootstrap_components^
  app.py

I've found something on stackoverflow but don't know if that helps.

If I can provide something else, please let me know.

Best regards
Befedo

@xkortex
Copy link

xkortex commented Sep 9, 2022

In all likelihood, this has nothing to do with Nuitka. This is something to do with a connection closing unexpectedly in the starlette/anyio layer. This issue might be related: encode/starlette#1284

Are you able to reliably reproduce the error?

@kayhayen
Copy link
Member

The report is also about ancient Nuitka.

@Nuitka Nuitka locked and limited conversation to collaborators Sep 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants