langchain-ai / langgraph

Build resilient language agents as graphs.
https://langchain-ai.github.io/langgraph/
MIT License
6.57k stars 1.05k forks source link

Langgraph requires REDIS_URI which isn't used in my project and the project was running fine previously. #1489

Closed kbatsuren closed 2 months ago

kbatsuren commented 2 months ago

Checked other resources

Example Code

langgraph up

Error Message and Stack Trace (if applicable)

langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/starlette/config.py", line 115, in get
langgraph-api-1       |     raise KeyError(f"Config '{key}' is missing, and has no default.")
langgraph-api-1       | KeyError: "Config 'REDIS_URI' is missing, and has no default."

Description

The code was working fine. Last Friday but not working on Monday without any change.

System Info

langgraph up
Starting LangGraph API server...
For local dev, requires env var LANGSMITH_API_KEY with access to LangGraph Cloud closed beta.
For production use, requires a license key in env var LANGGRAPH_CLOUD_LICENSE_KEY.
\ Building...#0 building with "desktop-linux" instance using docker driver

#1 [langgraph-api internal] load build definition from Dockerfile
#1 transferring dockerfile: 910B done
#1 DONE 0.0s

#2 [langgraph-api internal] load metadata for docker.io/langchain/langgraph-api:3.11
#2 DONE 0.0s

#3 [langgraph-api internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s

#4 [langgraph-api 1/6] FROM docker.io/langchain/langgraph-api:3.11
#4 DONE 0.0s

#5 [langgraph-api internal] load build context
#5 transferring context: 2.96kB done
#5 DONE 0.0s

#6 [langgraph-api 3/6] RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -c /api/constraints.txt -r /deps/__outer_multi_agents/multi_agents/requirements.txt
#6 CACHED

#7 [langgraph-api 4/6] ADD ./multi_agents /deps/__outer_multi_agents/multi_agents
#7 CACHED

#8 [langgraph-api 5/6] RUN set -ex &&     for line in '[project]'                 'name = "multi_agents"'                 'version = "0.1"'                 '[tool.setuptools.package-data]'                 '"*" = ["**/*"]'; do         echo "" >> /deps/__outer_multi_agents/pyproject.toml;     done
#8 CACHED

#9 [langgraph-api 2/6] ADD multi_agents/requirements.txt /deps/__outer_multi_agents/multi_agents/requirements.txt
#9 CACHED

#10 [langgraph-api 6/6] RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -c /api/constraints.txt -e /deps/*
#10 CACHED

#11 [langgraph-api] exporting to image
#11 exporting layers done
#11 writing image sha256:4baf2352d999dd5b079dbe8bbf3c39bf054613fc26a9268b20dbd4cc7812d549 done
#11 naming to docker.io/library/aiua-poc-system-langgraph-api done
#11 DONE 0.0s
Attaching to langgraph-api-1, langgraph-postgres-1
langgraph-postgres-1  | 
langgraph-postgres-1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
langgraph-postgres-1  | 
langgraph-api-1 exited with code 1
time="2024-08-27T15:04:57+10:00" level=warning msg="The \"line\" variable is not set. Defaulting to a blank string."
 Container aiua-poc-system-langgraph-postgres-1  Created
 Container aiua-poc-system-langgraph-api-1  Recreate
 Container aiua-poc-system-langgraph-api-1  Recreated
langgraph-postgres-1  | 2024-08-27 05:04:57.930 UTC [1] LOG:  starting PostgreSQL 16.4 (Debian 16.4-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
langgraph-postgres-1  | 2024-08-27 05:04:57.930 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
langgraph-postgres-1  | 2024-08-27 05:04:57.930 UTC [1] LOG:  listening on IPv6 address "::", port 5432
langgraph-postgres-1  | 2024-08-27 05:04:57.931 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
langgraph-postgres-1  | 2024-08-27 05:04:57.934 UTC [29] LOG:  database system was shut down at 2024-08-27 04:49:44 UTC
langgraph-postgres-1  | 2024-08-27 05:04:57.939 UTC [1] LOG:  database system is ready to accept connections
langgraph-api-1       | Traceback (most recent call last):
langgraph-api-1       |   File "/usr/local/bin/uvicorn", line 8, in <module>
langgraph-api-1       |     sys.exit(main())
langgraph-api-1       |              ^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
langgraph-api-1       |     return self.main(*args, **kwargs)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
langgraph-api-1       |     rv = self.invoke(ctx)
langgraph-api-1       |          ^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
langgraph-api-1       |     return ctx.invoke(self.callback, **ctx.params)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
langgraph-api-1       |     return __callback(*args, **kwargs)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main
langgraph-api-1       |     run(
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 577, in run
langgraph-api-1       |     server.run()
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
langgraph-api-1       |     return asyncio.run(self.serve(sockets=sockets))
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
langgraph-api-1       |     return runner.run(main)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
langgraph-api-1       |     return self._loop.run_until_complete(task)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
langgraph-api-1       |     await self._serve(sockets)
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
langgraph-api-1       |     config.load()
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
langgraph-api-1       |     self.loaded_app = import_from_string(self.app)
langgraph-api-1       |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
langgraph-api-1       |     module = importlib.import_module(module_str)
langgraph-api-1       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
langgraph-api-1       |     return _bootstrap._gcd_import(name[level:], package, level)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
langgraph-api-1       |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
langgraph-api-1       |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
langgraph-api-1       |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
langgraph-api-1       |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
langgraph-api-1       |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
langgraph-api-1       |   File "/api/langgraph_api/server.py", line 6, in <module>
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/langgraph_license/middleware.py", line 9, in <module>
langgraph-api-1       |     from langgraph_license.validation import get_license_status
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/langgraph_license/validation.py", line 9, in <module>
langgraph-api-1       |     from langgraph_api import config
langgraph-api-1       |   File "/api/langgraph_api/config.py", line 10, in <module>
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/starlette/config.py", line 98, in __call__
langgraph-api-1       |     return self.get(key, cast, default)
langgraph-api-1       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
langgraph-api-1       |   File "/usr/local/lib/python3.11/site-packages/starlette/config.py", line 115, in get
langgraph-api-1       |     raise KeyError(f"Config '{key}' is missing, and has no default.")
langgraph-api-1       | KeyError: "Config 'REDIS_URI' is missing, and has no default."
Aborting on container exit...
 Container aiua-poc-system-langgraph-api-1  Stopping
 Container aiua-poc-system-langgraph-api-1  Stopped
hwchase17 commented 2 months ago

we upgraded the images to use redis for some performance reasons. if you upgrade to the newest CLI pip install -U langgraph-cli this should be fixed, lmk if not

kbatsuren commented 2 months ago

After the upgrade you suggested, it works fine. Thanks so much for the prompt response. Langgraph rocks! :)