AssertionError: Feedback token task was not created in '../chat/playground'. An error occurred #166

Closed
opened 2026-02-16 00:19:06 -05:00 by yindo · 2 comments
Owner

Originally created by @normalstory on GitHub (Apr 20, 2024).

Originally assigned to: @eyurtsev on GitHub.

Hello!

I'd like to thank you all first. Although I'm not a developer, I've been learning and testing things with LangChain's help recently, and I've learned a lot. Let's keep going!

Issue Report

During my study process, I encountered an error that I couldn't find the cause of, so I decided to write this post.

Issue Phenomenon

  1. Normal Behavior:
    The paths ../prompt/playground/, ../translate/playground/, and
    ../llm/playground/ work well in both local (http://0.0.0.0:8000 ~) and
    ngrok-free.app (..ngrok-free.app ~) environments.

  2. Abnormal Behavior:
    However, the path ../chat/playground/ does not respond at all on both
    local (http://0.0.0.0:8000 ~) and ngrok-free.app (..ngrok-free.app ~)
    environments in a browser window.

Specific Phenomenon: Different responses each time

  1. Error Message in IDE (VSCode)
INFO:    ...- "GET /chat/c/N4XyA/input_schema HTTP/1.1" 200 OK
INFO:     ... - "POST /chat/stream_log HTTP/1.1" 200 OK
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 282, in __call__
    await wrap(partial(self.listen_for_disconnect, receive))
  File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 271, in wrap
    await func()
  File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 221, in listen_for_disconnect
    message = await receive()
  File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 535, in receive
    await self.message_event.wait()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 1073a7d90

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
  |     result = await app(  # type: ignore[func-returns-value]
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
  |     return await self.app(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
  |     await super().__call__(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
  |     raise exc
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
  |     await self.app(scope, receive, _send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/cors.py", line 93, in __call__
  |     await self.simple_response(scope, receive, send, request_headers=headers)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/cors.py", line 148, in simple_response
  |     await self.app(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
  |     raise exc
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 776, in app
  |     await route.handle(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
  |     await self.app(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
  |     raise exc
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 75, in app
  |     await response(scope, receive, send)
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 268, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 678, in __aexit__
  |     raise BaseExceptionGroup(
  | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 271, in wrap
    |     await func()
    |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 251, in stream_response
    |     async for data in self.body_iterator:
    |   File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/langserve/api_handler.py", line 1250, in _stream_log
    |     raise AssertionError("Feedback token task was not created.")
    | AssertionError: Feedback token task was not created.
    +------------------------------------
  1. Error Message in Browser (F12, Developer Mode)
    A form field element has neither an id nor a name attribute. This might prevent the browser from correctly autofilling the form. To fix this issue, add a unique id or name attribute to a form field. This is not strictly needed, but still recommended even if you have an autocomplete attribute on the same element.
    스크린샷 2024-04-21 오전 1 51 30

  2. Error Message on LangSmith
    스크린샷 2024-04-21 오전 1 48 35

  3. Error Message on ngrok-Spect
    스크린샷 2024-04-21 오전 1 47 43

Do you know the cause?
"Interestingly, only LangSmith responded normally, while all the other platforms failed".
Please let me know if anyone has an idea about what's causing this issue!

Originally created by @normalstory on GitHub (Apr 20, 2024). Originally assigned to: @eyurtsev on GitHub. **Hello!** I'd like to thank you all first. Although I'm not a developer, I've been learning and testing things with LangChain's help recently, and I've learned a lot. Let's keep going! **Issue Report** During my study process, I encountered an error that I couldn't find the cause of, so I decided to write this post. * Development Environment: Mac M1, venv, Python 3.10.7 * Runtime Channels: local, ngrok * Debugging Channels: Lang Smith, ngrok inspect * Code Path: https://github.com/normalstory/langserve_ollama * Troubleshooting History: https://github.com/teddylee777/langserve_ollama/issues/2 **Issue Phenomenon** 1. Normal Behavior: The paths `../prompt/playground/`, `../translate/playground/`, and `../llm/playground/` work well in both local (`http://0.0.0.0:8000 ~`) and ngrok-free.app (`..ngrok-free.app ~`) environments. 2. Abnormal Behavior: However, the path `../chat/playground/` does not respond at all on both local (`http://0.0.0.0:8000 ~`) and ngrok-free.app (`..ngrok-free.app ~`) environments in a browser window. **Specific Phenomenon**: Different responses each time 1. Error Message in IDE (VSCode) ``` INFO: ...- "GET /chat/c/N4XyA/input_schema HTTP/1.1" 200 OK INFO: ... - "POST /chat/stream_log HTTP/1.1" 200 OK ERROR: Exception in ASGI application Traceback (most recent call last): File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 282, in __call__ await wrap(partial(self.listen_for_disconnect, receive)) File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 271, in wrap await func() File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 221, in listen_for_disconnect message = await receive() File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 535, in receive await self.message_event.wait() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/locks.py", line 214, in wait await fut asyncio.exceptions.CancelledError: Cancelled by cancel scope 1073a7d90 During handling of the above exception, another exception occurred: + Exception Group Traceback (most recent call last): | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi | result = await app( # type: ignore[func-returns-value] | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__ | return await self.app(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__ | await super().__call__(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__ | await self.middleware_stack(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__ | raise exc | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__ | await self.app(scope, receive, _send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/cors.py", line 93, in __call__ | await self.simple_response(scope, receive, send, request_headers=headers) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/cors.py", line 148, in simple_response | await self.app(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__ | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__ | await self.middleware_stack(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 776, in app | await route.handle(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle | await self.app(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 77, in app | await wrap_app_handling_exceptions(app, request)(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app | raise exc | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app | await app(scope, receive, sender) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/starlette/routing.py", line 75, in app | await response(scope, receive, send) | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 268, in __call__ | async with anyio.create_task_group() as task_group: | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 678, in __aexit__ | raise BaseExceptionGroup( | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 271, in wrap | await func() | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/sse_starlette/sse.py", line 251, in stream_response | async for data in self.body_iterator: | File "/Users/chanwoo/code/langserve_ollama/st/lib/python3.10/site-packages/langserve/api_handler.py", line 1250, in _stream_log | raise AssertionError("Feedback token task was not created.") | AssertionError: Feedback token task was not created. +------------------------------------ ``` 2. Error Message in Browser (F12, Developer Mode) ```A form field element has neither an id nor a name attribute. This might prevent the browser from correctly autofilling the form. To fix this issue, add a unique id or name attribute to a form field. This is not strictly needed, but still recommended even if you have an autocomplete attribute on the same element.``` ![스크린샷 2024-04-21 오전 1 51 30](https://github.com/langchain-ai/langserve/assets/1615995/02d39e66-69cd-4358-9c35-5bdb3113f170) 3. Error Message on LangSmith <img width="1267" alt="스크린샷 2024-04-21 오전 1 48 35" src="https://github.com/langchain-ai/langserve/assets/1615995/fb90b905-7f92-4317-bc26-1f50f8381975"> 4. Error Message on ngrok-Spect <img width="1202" alt="스크린샷 2024-04-21 오전 1 47 43" src="https://github.com/langchain-ai/langserve/assets/1615995/39b97b7c-428f-4a13-86a0-cb1ff0a7124b"> **Do you know the cause?** "Interestingly, only LangSmith responded normally, while all the other platforms failed". Please let me know if anyone has an idea about what's causing this issue!
yindo added the bug label 2026-02-16 00:19:06 -05:00
yindo closed this issue 2026-02-16 00:19:06 -05:00
Author
Owner

@hemslo commented on GitHub (Apr 25, 2024):

I also found this error after upgrade langserve to 0.1.0, commented at https://github.com/langchain-ai/langserve/pull/593#discussion_r1579347085

@hemslo commented on GitHub (Apr 25, 2024): I also found this error after upgrade langserve to `0.1.0`, commented at https://github.com/langchain-ai/langserve/pull/593#discussion_r1579347085
Author
Owner

@eyurtsev commented on GitHub (Apr 25, 2024):

Patched release in 0.1.1. Thank you for flagging!

@eyurtsev commented on GitHub (Apr 25, 2024): Patched release in 0.1.1. Thank you for flagging!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#166