Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

langgraph up with syntax errors creates dangling Docker images (and eats up available disk) #1348

Open
5 tasks done
ewalker11 opened this issue Aug 14, 2024 · 1 comment
Open
5 tasks done
Assignees

Comments

@ewalker11
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph/LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph/LangChain rather than my code.
  • I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code

from typing import Any, Dict, List, Optional
from pydantic import BaseModel
from langgraph.graph import StateGraph, START, END


class State(BaseModel):
    string_default: Optional[str] = None
    int_default: Optional[int] = None
    float_default: Optional[float] = None
    dict_default: Optional[Dict[str, Any]] = None
    list_default: Optional[List[str]] = None


def node(state: State):
    return {
        'string_default': state.string_default,
        'int_default': state.int_default,
        'float_default': state.float_default,
        'dict_default': state.dict_default,
        'list_default': state.list_default,
    }


graph_builder = StateGraph(State)
graph_builder.add_node("default", node)
graph_builder.add_edge(START, "syntax_error")
graph_builder.add_edge("default", END)

graph = graph_builder.compile()

Error Message and Stack Trace (if applicable)

Doing this enough times will result in Docker errors like:

failed to solve: failed to copy files: userspace copy failed: write /var/lib/docker/overlay2/f89z6c11ya4bjzmal3lonj3tk/merged/deps/[repo]/.env.dev: no space left on device

Description

Initial state

> docker system df           
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          0         0         0B        0B
Containers      0         0         0B        0B
Local Volumes   0         0         0B        0B
Build Cache     0         0         0B        0B

Amend graph code to have one syntax error and langgraph up

> docker system df
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          3         2         1.042GB   257.3MB (24%)
Containers      2         0         5.002MB   5.002MB (100%)
Local Volumes   1         1         40.85MB   0B (0%)
Build Cache     21        0         98.84MB   98.84MB

Amend graph code to have a different syntax error and langgraph

> docker system df
docker system df          
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          4         2         1.143GB   685.5MB (59%)
Containers      2         0         5.002MB   5.002MB (100%)
Local Volumes   1         1         40.85MB   0B (0%)
Build Cache     25        0         98.84MB   98.84MB

Doing a verbose df reveals that dangling images are not being cleaned up:

docker system df --verbose
 Images space usage:

REPOSITORY                        TAG       IMAGE ID       CREATED         SIZE      SHARED SIZE   UNIQUE SIZE   CONTAINERS
ewalker-langgraph-langgraph-api   latest    ad138f07385a   4 minutes ago   686MB     584.1MB       101.4MB       1
<none>                            <none>    bfe00bd0a94c   4 minutes ago   686MB     584.1MB       101.4MB       0
<none>                            <none>    46d4c46c4981   6 minutes ago   686MB     584.1MB       101.4MB       0
langchain/langgraph-api           3.11      799a89355392   17 hours ago    257MB     257.3MB       0B            0
postgres                          16        35042a754d27   6 days ago      453MB     97.11MB       356.3MB       1
...

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 23.5.0: Wed May 1 20:17:33 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6031
Python Version: 3.12.3 (main, May 28 2024, 11:22:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Package Information

langchain_core: 0.2.28
langchain: 0.2.12
langchain_community: 0.2.11
langsmith: 0.1.96
langchain_anthropic: 0.1.22
langchain_openai: 0.1.20
langchain_text_splitters: 0.2.2
langgraph: 0.2.2

Packages not installed (Not Necessarily a Problem)

The following packages were not found:

langserve

@vbarda vbarda closed this as completed Aug 30, 2024
@vbarda vbarda reopened this Aug 30, 2024
@Deadsec69
Copy link

hi @ewalker11 can you run this code standalone
I think the default node is unreachable here also syntax_error node is defined anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants