HTTPStatusError("Client error '422 Unprocessable Entity' ... #3

Closed
opened 2026-02-16 06:17:38 -05:00 by yindo · 3 comments
Owner

Originally created by @wkdghdus on GitHub (Oct 17, 2024).

Hi, there are some issues trying to implement this template to the project I am working on.

When I import this project straight into my project without any modification, it returns such error.

HTTPStatusError("Client error '422 Unprocessable Entity' for url 'http://api/threads/c7ff1dda-9fb2-4aac-aaf2-c77598d66938/runs'\nFor more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422")Traceback (most recent call last):


  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1511, in astream
    async for _ in runner.atick(


  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/runner.py", line 194, in atick
    _panic_or_proceed(


  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/runner.py", line 273, in _panic_or_proceed
    raise exc


  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/retry.py", line 102, in arun_with_retry
    await task.proc.ainvoke(task.input, config)


  File "/usr/local/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 453, in ainvoke
    input = await asyncio.create_task(coro, context=context)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/usr/local/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 236, in ainvoke
    ret = await asyncio.create_task(coro, context=context)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/deps/__outer_interiorGPT/src/squads/conversationTeam/chatbot/graph.py", line 50, in schedule_memories
    await memory_client.runs.create(


  File "/usr/local/lib/python3.11/site-packages/langgraph_sdk/client.py", line 1474, in create
    return await self.http.post(f"/threads/{thread_id}/runs", json=payload)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


  File "/usr/local/lib/python3.11/site-packages/langgraph_sdk/client.py", line 229, in post
    raise e


  File "/usr/local/lib/python3.11/site-packages/langgraph_sdk/client.py", line 222, in post
    r.raise_for_status()


  File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 763, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)


httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url 'http://api/threads/c7ff1dda-9fb2-4aac-aaf2-c77598d66938/runs'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422


Invalid assistant ID

There is no problem running the memory state separately, and I've figured that it is a problem with get_client() not being able to run in the background. I've tried inputting url parameter as http://localhost:8123, yet the error changes to ConnectError('All connection attempts failed') but does not fix.

what possibly could happen here? All I did was to copy paste the code into my repository, changed the import to absolute path, and all the models to openAI. the same code works perfectly in the template.

Originally created by @wkdghdus on GitHub (Oct 17, 2024). Hi, there are some issues trying to implement this template to the project I am working on. When I import this project straight into my project without any modification, it returns such error. ``` HTTPStatusError("Client error '422 Unprocessable Entity' for url 'http://api/threads/c7ff1dda-9fb2-4aac-aaf2-c77598d66938/runs'\nFor more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422")Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1511, in astream async for _ in runner.atick( File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/runner.py", line 194, in atick _panic_or_proceed( File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/runner.py", line 273, in _panic_or_proceed raise exc File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/retry.py", line 102, in arun_with_retry await task.proc.ainvoke(task.input, config) File "/usr/local/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 453, in ainvoke input = await asyncio.create_task(coro, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langgraph/utils/runnable.py", line 236, in ainvoke ret = await asyncio.create_task(coro, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/deps/__outer_interiorGPT/src/squads/conversationTeam/chatbot/graph.py", line 50, in schedule_memories await memory_client.runs.create( File "/usr/local/lib/python3.11/site-packages/langgraph_sdk/client.py", line 1474, in create return await self.http.post(f"/threads/{thread_id}/runs", json=payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langgraph_sdk/client.py", line 229, in post raise e File "/usr/local/lib/python3.11/site-packages/langgraph_sdk/client.py", line 222, in post r.raise_for_status() File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 763, in raise_for_status raise HTTPStatusError(message, request=request, response=self) httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url 'http://api/threads/c7ff1dda-9fb2-4aac-aaf2-c77598d66938/runs' For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422 Invalid assistant ID ``` There is no problem running the memory state separately, and I've figured that it is a problem with get_client() not being able to run in the background. I've tried inputting url parameter as http://localhost:8123, yet the error changes to ConnectError('All connection attempts failed') but does not fix. what possibly could happen here? All I did was to copy paste the code into my repository, changed the import to absolute path, and all the models to openAI. the same code works perfectly in the template.
yindo closed this issue 2026-02-16 06:17:38 -05:00
Author
Owner

@wkdghdus commented on GitHub (Oct 17, 2024):

I've been trying to run the template using langgraph up and the debugger. but it seems like the memory isn't updating when I use this method. It runs perfectly on the desktop CLI. But when I use the debugger and langgraph up command I get this error, resulting in memories not getting updated

langgraph-api-1       | 2024-10-17T09:52:19.659927Z [warning  ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.660303Z [warning  ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.661846Z [warning  ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.661999Z [warning  ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.668279Z [warning  ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.668368Z [warning  ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.674180Z [warning  ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       | 2024-10-17T09:52:19.674241Z [warning  ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed
langgraph-api-1       |
@wkdghdus commented on GitHub (Oct 17, 2024): I've been trying to run the template using langgraph up and the debugger. but it seems like the memory isn't updating when I use this method. It runs perfectly on the desktop CLI. But when I use the debugger and langgraph up command I get this error, resulting in memories not getting updated ``` langgraph-api-1 | 2024-10-17T09:52:19.659927Z [warning ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.660303Z [warning ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.661846Z [warning ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.661999Z [warning ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.668279Z [warning ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.668368Z [warning ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.674180Z [warning ] Ignoring unknown node name handle_patch_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | 2024-10-17T09:52:19.674241Z [warning ] Ignoring unknown node name handle_insertion_memory in pending sends [langgraph] api_revision=0bf6edd api_variant=licensed langgraph-api-1 | ```
Author
Owner

@wkdghdus commented on GitHub (Oct 17, 2024):

I've solved this problem by modifying langgraph.json file.

I've initially assigned the graph names like these
"convo/chatBot": "path/to/chatbot/graph.py:graph"
"convo/memoryGraph": path/to/memory/graph.py:graph"

I think this for some reason hindered the ability for get_client to fetch the memory graph.
(I have no idea how get_client() fetches the correct graph without any specification)

but when I changed the graph names to "chatBot" "memoryGraph", it worked as intended.

can somebody possibly explain why this solution worked?

@wkdghdus commented on GitHub (Oct 17, 2024): I've solved this problem by modifying langgraph.json file. I've initially assigned the graph names like these "convo/chatBot": "path/to/chatbot/graph.py:graph" "convo/memoryGraph": path/to/memory/graph.py:graph" I think this for some reason hindered the ability for get_client to fetch the memory graph. (I have no idea how get_client() fetches the correct graph without any specification) but when I changed the graph names to "chatBot" "memoryGraph", it worked as intended. can somebody possibly explain why this solution worked?
Author
Owner

@hinthornw commented on GitHub (Nov 14, 2024):

It's https://github.com/langchain-ai/memory-template/blob/141b1b0afff40b5cea79212b9fa5cc9be58f26ef/src/chatbot/configuration.py#L17

the assistant ID configuration value can etiher be a graph name or an assistant.

@hinthornw commented on GitHub (Nov 14, 2024): It's https://github.com/langchain-ai/memory-template/blob/141b1b0afff40b5cea79212b9fa5cc9be58f26ef/src/chatbot/configuration.py#L17 the assistant ID configuration value can etiher be a graph name or an assistant.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/memory-template#3