Unable to run langgraph docker container when using existing postgres db and redis #400

Closed
opened 2026-02-20 17:39:55 -05:00 by yindo · 11 comments
Owner

Originally created by @magallardo on GitHub (Jan 15, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

docker run \
    --env-file .env \
    -p 8123:8000 \
    -e REDIS_URI="redacted" \
    -e DATABASE_URI="redacted" \
    -e LANGSMITH_API_KEY="redacted" \
    my-image

Error Message and Stack Trace (if applicable)

2025-01-15 21:38:28 2025-01-16T02:38:28.085675Z [info     ] Using auth of type=noop        [langgraph_api.auth.middleware] api_revision=939d51f api_variant=local
2025-01-15 21:38:28 2025-01-16T02:38:28.087168Z [info     ] Started server process [1]     [uvicorn.error] api_revision=939d51f api_variant=local color_message=Started server process [%d]
2025-01-15 21:38:28 2025-01-16T02:38:28.087305Z [info     ] Waiting for application startup. [uvicorn.error] api_revision=939d51f api_variant=local
2025-01-15 21:38:28 2025-01-16T02:38:28.087515Z [warning  ] No license key found, running in test mode with LangSmith API key. For production use, set LANGGRAPH_CLOUD_LICENSE_KEY in environment. [langgraph_license.validation] api_revision=939d51f api_variant=local
2025-01-15 21:38:28 2025-01-16T02:38:28.282471Z [info     ] HTTP Request: GET https://api.smith.langchain.com/auth?langgraph-api=true "HTTP/1.1 200 OK" [httpx] api_revision=939d51f api_variant=local
2025-01-15 21:38:28 2025-01-16T02:38:28.327079Z [warning  ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly
2025-01-15 21:38:28     This probably means the server terminated abnormally
2025-01-15 21:38:28     before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local
2025-01-15 21:38:29 2025-01-16T02:38:29.298065Z [warning  ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly
2025-01-15 21:38:29     This probably means the server terminated abnormally
2025-01-15 21:38:29     before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local
2025-01-15 21:38:31 2025-01-16T02:38:31.233615Z [warning  ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly
2025-01-15 21:38:31     This probably means the server terminated abnormally
2025-01-15 21:38:31     before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local
2025-01-15 21:38:35 2025-01-16T02:38:35.103750Z [warning  ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly
2025-01-15 21:38:35     This probably means the server terminated abnormally
2025-01-15 21:38:35     before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local
2025-01-15 21:38:42 2025-01-16T02:38:42.837522Z [warning  ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly
2025-01-15 21:38:42     This probably means the server terminated abnormally
2025-01-15 21:38:42     before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local
2025-01-15 21:38:58 2025-01-16T02:38:58.299583Z [warning  ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly
2025-01-15 21:38:58     This probably means the server terminated abnormally
2025-01-15 21:38:58     before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local
2025-01-15 21:38:58 2025-01-16T02:38:58.325300Z [error    ] Traceback (most recent call last):
2025-01-15 21:38:58   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 693, in lifespan
2025-01-15 21:38:58     async with self.lifespan_context(app) as maybe_state:
2025-01-15 21:38:58   File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
2025-01-15 21:38:58     return await anext(self.gen)
2025-01-15 21:38:58            ^^^^^^^^^^^^^^^^^^^^^
2025-01-15 21:38:58   File "/api/langgraph_api/lifespan.py", line 29, in lifespan
2025-01-15 21:38:58   File "/usr/local/lib/python3.11/site-packages/langgraph_storage/database.py", line 146, in start_pool
2025-01-15 21:38:58     await _pg_pool.open(wait=True)
2025-01-15 21:38:58   File "/usr/local/lib/python3.11/site-packages/psycopg_pool/pool_async.py", line 387, in open
2025-01-15 21:38:58     await self.wait(timeout=timeout)
2025-01-15 21:38:58   File "/usr/local/lib/python3.11/site-packages/psycopg_pool/pool_async.py", line 174, in wait
2025-01-15 21:38:58     raise PoolTimeout(f"pool initialization incomplete after {timeout} sec")
2025-01-15 21:38:58 psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec
2025-01-15 21:38:58  [uvicorn.error] api_revision=939d51f api_variant=local
2025-01-15 21:38:58 2025-01-16T02:38:58.325529Z [error    ] Application startup failed. Exiting. [uvicorn.error] api_revision=939d51f api_variant=local

Description

I am trying to run langgraph against existing postgres and redis containers. The redis and database containers start up fine and ready to receive connections. However, when I run the langgraph server, it fails to connect to database.
The database and redis uris passed to the docker run command are:
postgres://postgres:postgres@192.168.1.95:5432/postgres?sslmode=disable
redis://192.168.1.95:6379

Note that the dabase and redis are started from a separate docker compose and both containers are running fine.

I have tested running the database, redis and langgraph from the same docker-compose file and that seems to work ok.

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64
Python Version: 3.11.7 (main, Dec 4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)]

Package Information

langchain_core: 0.3.29
langsmith: 0.2.10
langchain_openai: 0.3.0
langgraph_cli: 0.1.67
langgraph_sdk: 0.1.51

Optional packages not installed

langserve

Other Dependencies

click: 8.1.8
httpx: 0.28.1
jsonpatch: 1.33
langgraph-api: Installed. No version info available.
langsmith-pyo3: Installed. No version info available.
openai: 1.59.7
orjson: 3.10.14
packaging: 24.2
pydantic: 2.10.5
python-dotenv: Installed. No version info available.
PyYAML: 6.0.2
requests: 2.32.3
requests-toolbelt: 1.0.0
tenacity: 9.0.0
tiktoken: 0.8.0
typing-extensions: 4.12.2
zstandard: Installed. No version info available.

Originally created by @magallardo on GitHub (Jan 15, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python docker run \ --env-file .env \ -p 8123:8000 \ -e REDIS_URI="redacted" \ -e DATABASE_URI="redacted" \ -e LANGSMITH_API_KEY="redacted" \ my-image ``` ### Error Message and Stack Trace (if applicable) ```shell 2025-01-15 21:38:28 2025-01-16T02:38:28.085675Z [info ] Using auth of type=noop [langgraph_api.auth.middleware] api_revision=939d51f api_variant=local 2025-01-15 21:38:28 2025-01-16T02:38:28.087168Z [info ] Started server process [1] [uvicorn.error] api_revision=939d51f api_variant=local color_message=Started server process [%d] 2025-01-15 21:38:28 2025-01-16T02:38:28.087305Z [info ] Waiting for application startup. [uvicorn.error] api_revision=939d51f api_variant=local 2025-01-15 21:38:28 2025-01-16T02:38:28.087515Z [warning ] No license key found, running in test mode with LangSmith API key. For production use, set LANGGRAPH_CLOUD_LICENSE_KEY in environment. [langgraph_license.validation] api_revision=939d51f api_variant=local 2025-01-15 21:38:28 2025-01-16T02:38:28.282471Z [info ] HTTP Request: GET https://api.smith.langchain.com/auth?langgraph-api=true "HTTP/1.1 200 OK" [httpx] api_revision=939d51f api_variant=local 2025-01-15 21:38:28 2025-01-16T02:38:28.327079Z [warning ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly 2025-01-15 21:38:28 This probably means the server terminated abnormally 2025-01-15 21:38:28 before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local 2025-01-15 21:38:29 2025-01-16T02:38:29.298065Z [warning ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly 2025-01-15 21:38:29 This probably means the server terminated abnormally 2025-01-15 21:38:29 before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local 2025-01-15 21:38:31 2025-01-16T02:38:31.233615Z [warning ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly 2025-01-15 21:38:31 This probably means the server terminated abnormally 2025-01-15 21:38:31 before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local 2025-01-15 21:38:35 2025-01-16T02:38:35.103750Z [warning ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly 2025-01-15 21:38:35 This probably means the server terminated abnormally 2025-01-15 21:38:35 before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local 2025-01-15 21:38:42 2025-01-16T02:38:42.837522Z [warning ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly 2025-01-15 21:38:42 This probably means the server terminated abnormally 2025-01-15 21:38:42 before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local 2025-01-15 21:38:58 2025-01-16T02:38:58.299583Z [warning ] error connecting in 'pool-1': connection failed: connection to server at "192.168.1.95", port 5432 failed: server closed the connection unexpectedly 2025-01-15 21:38:58 This probably means the server terminated abnormally 2025-01-15 21:38:58 before or while processing the request. [psycopg.pool] api_revision=939d51f api_variant=local 2025-01-15 21:38:58 2025-01-16T02:38:58.325300Z [error ] Traceback (most recent call last): 2025-01-15 21:38:58 File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 693, in lifespan 2025-01-15 21:38:58 async with self.lifespan_context(app) as maybe_state: 2025-01-15 21:38:58 File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__ 2025-01-15 21:38:58 return await anext(self.gen) 2025-01-15 21:38:58 ^^^^^^^^^^^^^^^^^^^^^ 2025-01-15 21:38:58 File "/api/langgraph_api/lifespan.py", line 29, in lifespan 2025-01-15 21:38:58 File "/usr/local/lib/python3.11/site-packages/langgraph_storage/database.py", line 146, in start_pool 2025-01-15 21:38:58 await _pg_pool.open(wait=True) 2025-01-15 21:38:58 File "/usr/local/lib/python3.11/site-packages/psycopg_pool/pool_async.py", line 387, in open 2025-01-15 21:38:58 await self.wait(timeout=timeout) 2025-01-15 21:38:58 File "/usr/local/lib/python3.11/site-packages/psycopg_pool/pool_async.py", line 174, in wait 2025-01-15 21:38:58 raise PoolTimeout(f"pool initialization incomplete after {timeout} sec") 2025-01-15 21:38:58 psycopg_pool.PoolTimeout: pool initialization incomplete after 30.0 sec 2025-01-15 21:38:58 [uvicorn.error] api_revision=939d51f api_variant=local 2025-01-15 21:38:58 2025-01-16T02:38:58.325529Z [error ] Application startup failed. Exiting. [uvicorn.error] api_revision=939d51f api_variant=local ``` ### Description I am trying to run langgraph against existing postgres and redis containers. The redis and database containers start up fine and ready to receive connections. However, when I run the langgraph server, it fails to connect to database. The database and redis uris passed to the docker run command are: postgres://postgres:postgres@192.168.1.95:5432/postgres?sslmode=disable redis://192.168.1.95:6379 Note that the dabase and redis are started from a separate docker compose and both containers are running fine. I have tested running the database, redis and langgraph from the same docker-compose file and that seems to work ok. ### System Info System Information ------------------ > OS: Darwin > OS Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 > Python Version: 3.11.7 (main, Dec 4 2023, 18:10:11) [Clang 15.0.0 (clang-1500.1.0.2.5)] Package Information ------------------- > langchain_core: 0.3.29 > langsmith: 0.2.10 > langchain_openai: 0.3.0 > langgraph_cli: 0.1.67 > langgraph_sdk: 0.1.51 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > click: 8.1.8 > httpx: 0.28.1 > jsonpatch: 1.33 > langgraph-api: Installed. No version info available. > langsmith-pyo3: Installed. No version info available. > openai: 1.59.7 > orjson: 3.10.14 > packaging: 24.2 > pydantic: 2.10.5 > python-dotenv: Installed. No version info available. > PyYAML: 6.0.2 > requests: 2.32.3 > requests-toolbelt: 1.0.0 > tenacity: 9.0.0 > tiktoken: 0.8.0 > typing-extensions: 4.12.2 > zstandard: Installed. No version info available.
yindo closed this issue 2026-02-20 17:39:55 -05:00
Author
Owner

@ucekmez commented on GitHub (Jan 16, 2025):

We're having a similar issue with existing postgresql

    async for event, chunk in self.graph.astream(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream
    async with AsyncPregelLoop(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__
    saved = await self.checkpointer.aget_tuple(self.checkpoint_config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple
    await cur.execute(
  File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedColumn: column cw.task_path does not exist
LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa...
@ucekmez commented on GitHub (Jan 16, 2025): We're having a similar issue with existing postgresql ``` File "/workspace/src/agents/main_agent.py", line 184, in chat async for event, chunk in self.graph.astream( File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream async with AsyncPregelLoop( File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__ saved = await self.checkpointer.aget_tuple(self.checkpoint_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple await cur.execute( File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute raise ex.with_traceback(None) psycopg.errors.UndefinedColumn: column cw.task_path does not exist LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa... ```
Author
Owner

@vbarda commented on GitHub (Jan 16, 2025):

We're having a similar issue with existing postgresql

    async for event, chunk in self.graph.astream(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream
    async with AsyncPregelLoop(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__
    saved = await self.checkpointer.aget_tuple(self.checkpoint_config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple
    await cur.execute(
  File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedColumn: column cw.task_path does not exist
LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa...

This is an unrelated issue -- you need to use latest versions of langgraph and langgraph-checkpoint-postgres

@vbarda commented on GitHub (Jan 16, 2025): > We're having a similar issue with existing postgresql > > ``` > async for event, chunk in self.graph.astream( > File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream > async with AsyncPregelLoop( > File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__ > saved = await self.checkpointer.aget_tuple(self.checkpoint_config) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple > await cur.execute( > File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute > raise ex.with_traceback(None) > psycopg.errors.UndefinedColumn: column cw.task_path does not exist > LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa... > ``` This is an unrelated issue -- you need to use latest versions of `langgraph` and `langgraph-checkpoint-postgres`
Author
Owner

@vbarda commented on GitHub (Jan 16, 2025):

@magallardo could you verify that you are actually able to connect to the database using that URI?

@vbarda commented on GitHub (Jan 16, 2025): @magallardo could you verify that you are actually able to connect to the database using that URI?
Author
Owner

@magallardo commented on GitHub (Jan 16, 2025):

@vbarda Thanks for the suggestion. After trying to connect from pgAdmin, I noticed the example docker-compose provided in the Langraph training course has a typo in the port mapping and that was causing the connection issue. It is strange as there was no problem when starting postgres, redis and langgraaph server from the same docker-compose.

Anyway the typo in the docker compose file is the following:
langgraph-postgres:
image: postgres:16
ports:
- "5433:5432"

it shoul be:
langgraph-postgres:
image: postgres:16
ports:
- "5432:5432"

After fixing this issue, the langgraph server was complaining with connection issues to redis. I also noticed that docker-compose example was missing the port mapping. After adding the port mapping fixed the issue. Again, this problem does not appear when starting langgraph, redis and postgres from the same docker compose.

langgraph-redis:
image: redis:6
ports:
- "6379:6379"

Thanks again

@magallardo commented on GitHub (Jan 16, 2025): @vbarda Thanks for the suggestion. After trying to connect from pgAdmin, I noticed the example docker-compose provided in the Langraph training course has a typo in the port mapping and that was causing the connection issue. It is strange as there was no problem when starting postgres, redis and langgraaph server from the same docker-compose. Anyway the typo in the docker compose file is the following: langgraph-postgres: image: postgres:16 ports: - "5433:5432" it shoul be: langgraph-postgres: image: postgres:16 ports: - "5432:5432" After fixing this issue, the langgraph server was complaining with connection issues to redis. I also noticed that docker-compose example was missing the port mapping. After adding the port mapping fixed the issue. Again, this problem does not appear when starting langgraph, redis and postgres from the same docker compose. langgraph-redis: image: redis:6 ports: - "6379:6379" Thanks again
Author
Owner

@vbarda commented on GitHub (Jan 17, 2025):

We will update in langchain-academy, thanks for flagging! Closing this since looks like you resolved the issue, but feel free to reopen / make another one if you run into other issues.

@vbarda commented on GitHub (Jan 17, 2025): We will update in langchain-academy, thanks for flagging! Closing this since looks like you resolved the issue, but feel free to reopen / make another one if you run into other issues.
Author
Owner

@kairobeduti commented on GitHub (Jan 21, 2025):

We're having a similar issue with existing postgresql

    async for event, chunk in self.graph.astream(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream
    async with AsyncPregelLoop(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__
    saved = await self.checkpointer.aget_tuple(self.checkpoint_config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple
    await cur.execute(
  File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedColumn: column cw.task_path does not exist
LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa...

this probably has to do with this commit.

i was also facing this error and just ran a .setup() complete the new columns creation.

@kairobeduti commented on GitHub (Jan 21, 2025): > We're having a similar issue with existing postgresql > > ``` > async for event, chunk in self.graph.astream( > File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream > async with AsyncPregelLoop( > File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__ > saved = await self.checkpointer.aget_tuple(self.checkpoint_config) > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple > await cur.execute( > File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute > raise ex.with_traceback(None) > psycopg.errors.UndefinedColumn: column cw.task_path does not exist > LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa... > ``` this probably has to do with [this commit](https://github.com/langchain-ai/langgraph/commit/053a501db3970923eb3e074645617088752672f7). i was also facing this error and just ran a .setup() complete the new columns creation.
Author
Owner

@jhachirag7 commented on GitHub (Feb 7, 2025):

We're having a similar issue with existing postgresql

    async for event, chunk in self.graph.astream(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream
    async with AsyncPregelLoop(
  File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__
    saved = await self.checkpointer.aget_tuple(self.checkpoint_config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple
    await cur.execute(
  File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute
    raise ex.with_traceback(None)
psycopg.errors.UndefinedColumn: column cw.task_path does not exist
LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa...

this probably has to do with this commit.

i was also facing this error and just ran a .setup() complete the new columns creation.

did you find any solution why it's happening.

@jhachirag7 commented on GitHub (Feb 7, 2025): > > We're having a similar issue with existing postgresql > > ``` > > async for event, chunk in self.graph.astream( > > File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/__init__.py", line 1836, in astream > > async with AsyncPregelLoop( > > File "/usr/local/lib/python3.11/site-packages/langgraph/pregel/loop.py", line 988, in __aenter__ > > saved = await self.checkpointer.aget_tuple(self.checkpoint_config) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/local/lib/python3.11/site-packages/langgraph/checkpoint/postgres/aio.py", line 186, in aget_tuple > > await cur.execute( > > File "/usr/local/lib/python3.11/site-packages/psycopg/cursor_async.py", line 97, in execute > > raise ex.with_traceback(None) > > psycopg.errors.UndefinedColumn: column cw.task_path does not exist > > LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa... > > ``` > > this probably has to do with [this commit](https://github.com/langchain-ai/langgraph/commit/053a501db3970923eb3e074645617088752672f7). > > i was also facing this error and just ran a .setup() complete the new columns creation. did you find any solution why it's happening.
Author
Owner

@saurabhlalsaxena commented on GitHub (Feb 23, 2025):

Faced the same issue
UndefinedColumn: column cw.task_path does not exist
LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa...

Tried moving to an older version of langgraph-checkpoint-postgres and it is working fine
@vbarda please reopen the issue, we have a production postgres checkpointer and if we upgrade to the new version of langgraph-checkpoint-postgres then it is breaking.

This running on version - 2.0.8

@saurabhlalsaxena commented on GitHub (Feb 23, 2025): Faced the same issue UndefinedColumn: column cw.task_path does not exist LINE 27: ...array_agg(array[cw.type::bytea, cw.blob] order by cw.task_pa... Tried moving to an older version of langgraph-checkpoint-postgres and it is working fine @vbarda please reopen the issue, we have a production postgres checkpointer and if we upgrade to the new version of langgraph-checkpoint-postgres then it is breaking. This running on version - 2.0.8
Author
Owner

@jaredscheib commented on GitHub (Apr 22, 2025):

I also just spent my morning addressing this issue. Very frustrating. There should not be breaking changes on a minor version upgrade.

The only fix was to downgrade back the three libraries implicated and pin them to specific versions:

langgraph = "0.2.53"
langgraph-checkpoint = "2.0.7"
langgraph-checkpoint-postgres = "2.0.6"

Thanks.

@jaredscheib commented on GitHub (Apr 22, 2025): I also just spent my morning addressing this issue. Very frustrating. There should not be breaking changes on a minor version upgrade. The only fix was to downgrade back the three libraries implicated and pin them to specific versions: ``` langgraph = "0.2.53" langgraph-checkpoint = "2.0.7" langgraph-checkpoint-postgres = "2.0.6" ``` Thanks.
Author
Owner

@saurabhlalsaxena commented on GitHub (Apr 22, 2025):

So you need to migrate your DB to the new version of checkpointer db. It resolves the issue.

@saurabhlalsaxena commented on GitHub (Apr 22, 2025): So you need to migrate your DB to the new version of checkpointer db. It resolves the issue.
Author
Owner

@jaredscheib commented on GitHub (Apr 22, 2025):

Thanks @saurabhlalsaxena. I'll give it a shot down the line. That requirement breaks the understanding of semantic versioning, given this is a minor version upgrade.

@jaredscheib commented on GitHub (Apr 22, 2025): Thanks @saurabhlalsaxena. I'll give it a shot down the line. That requirement breaks the understanding of semantic versioning, given this is a minor version upgrade.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#400