Cannot Visit Website (via Python Server) without Exception #488

Closed
opened 2023-11-11 09:27:11 +00:00 by hsjobeki · 1 comment
Owner

Current main branch (commit id: 04c754caad5a80b1da4c1d402e2bec39cf00bb5e)

Steps to reproduce:

johannes@johannes-nixos ~/g/c/p/clan-cli (main)> ./bin/clan webui --dev --no-open
direnv: loading ~/git/clan-core/pkgs/ui/.envrc
direnv: loading ~/git/clan-core/.envrc
direnv: using flake
direnv: nix-direnv: using cached dev shell
direnv: using flake .#ui --builders 
direnv: nix-direnv: using cached dev shell
INFO:     Started server process [1069261]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://localhost:2979 (Press CTRL+C to quit)
🍻 Start orval v6.17.0 - A swagger client generator for typescript
🎉 clan - Your OpenAPI spec has been converted into ready to use orval!

> clan-ui@0.1.0 dev
> next dev --hostname localhost --port 3000

- ready started server on localhost:3000, url: http://localhost:3000
- event compiled client and server successfully in 263 ms (20 modules)
- wait compiling...
- event compiled client and server successfully in 100 ms (20 modules)
ERROR:    Exception in ASGI application
  1. Visit the browser at: http://localhost:2979

  2. The UI loads, but the server has an Exception.

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/applications.py", line 292, in __call__
    await super().__call__(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/applications.py", line 116, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in __call__
    await self.app(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app
    raise exc
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app
    await app(scope, receive, sender)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 746, in __call__
    await route.handle(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app
    raise exc
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app
    await app(scope, receive, sender)
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 70, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/routing.py", line 190, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/johannes/git/clan-core/pkgs/clan-cli/clan_cli/webui/routers/root.py", line 35, in root
    return Response(filename.read_bytes(), media_type=content_type)
                    ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/pathlib.py", line 1050, in read_bytes
    with self.open(mode='rb') as f:
         ^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/pathlib.py", line 1044, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/johannes/git/clan-core/pkgs/clan-cli/clan_cli/webui/assets/backups.txt'

Visiting /doc or /redoc works fine.

Current main branch (commit id: `04c754caad5a80b1da4c1d402e2bec39cf00bb5e`) Steps to reproduce: ```sh johannes@johannes-nixos ~/g/c/p/clan-cli (main)> ./bin/clan webui --dev --no-open direnv: loading ~/git/clan-core/pkgs/ui/.envrc direnv: loading ~/git/clan-core/.envrc direnv: using flake direnv: nix-direnv: using cached dev shell direnv: using flake .#ui --builders direnv: nix-direnv: using cached dev shell INFO: Started server process [1069261] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://localhost:2979 (Press CTRL+C to quit) 🍻 Start orval v6.17.0 - A swagger client generator for typescript 🎉 clan - Your OpenAPI spec has been converted into ready to use orval! > clan-ui@0.1.0 dev > next dev --hostname localhost --port 3000 - ready started server on localhost:3000, url: http://localhost:3000 - event compiled client and server successfully in 263 ms (20 modules) - wait compiling... - event compiled client and server successfully in 100 ms (20 modules) ERROR: Exception in ASGI application ``` 2. Visit the browser at: `http://localhost:2979` 3. The UI loads, but the server has an Exception. ```sh ERROR: Exception in ASGI application Traceback (most recent call last): File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/applications.py", line 292, in __call__ await super().__call__(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/applications.py", line 116, in __call__ await self.middleware_stack(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__ raise exc File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__ await self.app(scope, receive, _send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/cors.py", line 83, in __call__ await self.app(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app raise exc File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app await app(scope, receive, sender) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__ raise e File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__ await self.app(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 746, in __call__ await route.handle(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle await self.app(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 75, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app raise exc File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app await app(scope, receive, sender) File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/starlette/routing.py", line 70, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/routing.py", line 273, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/n6hs8i97hp5i677cz2pi4wfs50hxg00j-python3-3.11.5-env/lib/python3.11/site-packages/fastapi/routing.py", line 190, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/johannes/git/clan-core/pkgs/clan-cli/clan_cli/webui/routers/root.py", line 35, in root return Response(filename.read_bytes(), media_type=content_type) ^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/pathlib.py", line 1050, in read_bytes with self.open(mode='rb') as f: ^^^^^^^^^^^^^^^^^^^^ File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/pathlib.py", line 1044, in open return io.open(self, mode, buffering, encoding, errors, newline) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/home/johannes/git/clan-core/pkgs/clan-cli/clan_cli/webui/assets/backups.txt' ``` Visiting `/doc` or `/redoc` works fine.
Mic92 was assigned by hsjobeki 2023-11-11 09:27:11 +00:00
Qubasa was assigned by hsjobeki 2023-11-11 09:27:11 +00:00
hsjobeki changed title from Cannot Start Server without Exception to Cannot Visit Website (via Python Server) without Exception 2023-11-11 09:29:00 +00:00
Owner

Oh this good old buddy

Oh this good old buddy
Mic92 closed this issue 2023-11-14 16:09:37 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: clan/clan-core#488
No description provided.