Compiled graph aget_state() throws exception: 'NoneType' object has no attribute 'pending_writes' #200

Closed
opened 2026-02-20 17:31:23 -05:00 by yindo · 4 comments
Owner

Originally created by @HiraveBapu on GitHub (Aug 22, 2024).

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

compiled_graph = stategraph.compile(checkpointer=checkpointer, interrupt_before=["human_review_node"])

snapshot = await compiled_graph.aget_state(config)

Error Message and Stack Trace (if applicable)

exception: 'NoneType' object has no attribute 'pending_writes'

Description

aget_state throws exception

async def aget_state(self, config: RunnableConfig) -> StateSnapshot:
    """Get the current state of the graph."""
    if not self.checkpointer:
        raise ValueError("No checkpointer set")

    saved = await self.checkpointer.aget_tuple(config)
    checkpoint = saved.checkpoint if saved else empty_checkpoint()

    config = saved.config if saved else config
    async with AsyncChannelsManager(
        self.channels, checkpoint, config, skip_context=True
    ) as (channels, managed):
        next_tasks = prepare_next_tasks(
            checkpoint,
            self.nodes,
            channels,
            managed,
            config,
            saved.metadata.get("step", -1) + 1 if saved else -1,
            for_execution=False,
        )
        return StateSnapshot(
            read_channels(channels, self.stream_channels_asis),
            tuple(t.name for t in next_tasks),
            saved.config if saved else config,
            saved.metadata if saved else None,
            saved.checkpoint["ts"] if saved else None,
            saved.parent_config if saved else None,
            tasks_w_writes(next_tasks, saved.pending_writes), # this line causing issue ?
        )

System Info

python = ">=3.9,<3.13"
uvicorn = "^0.30.3"
pydantic = {extras = ["email"], version = "^2.7.4"}
langchain-community = "^0.2.12"
langchain-text-splitters = "^0.2.1"
langchain-chroma = "^0.1.3"
langchain-google-vertexai = "^1.0.7"
distro = "^1.9.0"
langchain-openai = "^0.1.22"
langchain-aws = "^0.1.17"
aiosqlite = "^0.20.0"
watchfiles = "^0.22.0"
filelock = "^3.15.4"
python-multipart = "*"
langchain-core = "^0.2.34"
sentence-transformers = "^3.0.1"
pypdf = "^4.3.1"
gunicorn = "^22.0.0"
langchain-groq = "^0.1.6"
pydantic-settings = "^2.3.4"
langchain-mistralai = "^0.1.12"
langgraph-checkpoint-sqlite = "^1.0.0"
grpcio = "^1.65.4"
langgraph = "^0.2.10"

Originally created by @HiraveBapu on GitHub (Aug 22, 2024). ### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the [LangGraph](https://langchain-ai.github.io/langgraph/)/LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangGraph/LangChain rather than my code. - [X] I am sure this is better as an issue [rather than a GitHub discussion](https://github.com/langchain-ai/langgraph/discussions/new/choose), since this is a LangGraph bug and not a design question. ### Example Code ```python compiled_graph = stategraph.compile(checkpointer=checkpointer, interrupt_before=["human_review_node"]) snapshot = await compiled_graph.aget_state(config) ``` ### Error Message and Stack Trace (if applicable) ```shell exception: 'NoneType' object has no attribute 'pending_writes' ``` ### Description aget_state throws exception async def aget_state(self, config: RunnableConfig) -> StateSnapshot: """Get the current state of the graph.""" if not self.checkpointer: raise ValueError("No checkpointer set") saved = await self.checkpointer.aget_tuple(config) checkpoint = saved.checkpoint if saved else empty_checkpoint() config = saved.config if saved else config async with AsyncChannelsManager( self.channels, checkpoint, config, skip_context=True ) as (channels, managed): next_tasks = prepare_next_tasks( checkpoint, self.nodes, channels, managed, config, saved.metadata.get("step", -1) + 1 if saved else -1, for_execution=False, ) return StateSnapshot( read_channels(channels, self.stream_channels_asis), tuple(t.name for t in next_tasks), saved.config if saved else config, saved.metadata if saved else None, saved.checkpoint["ts"] if saved else None, saved.parent_config if saved else None, tasks_w_writes(next_tasks, saved.pending_writes), # this line causing issue ? ) ### System Info python = ">=3.9,<3.13" uvicorn = "^0.30.3" pydantic = {extras = ["email"], version = "^2.7.4"} langchain-community = "^0.2.12" langchain-text-splitters = "^0.2.1" langchain-chroma = "^0.1.3" langchain-google-vertexai = "^1.0.7" distro = "^1.9.0" langchain-openai = "^0.1.22" langchain-aws = "^0.1.17" aiosqlite = "^0.20.0" watchfiles = "^0.22.0" filelock = "^3.15.4" python-multipart = "*" langchain-core = "^0.2.34" sentence-transformers = "^3.0.1" pypdf = "^4.3.1" gunicorn = "^22.0.0" langchain-groq = "^0.1.6" pydantic-settings = "^2.3.4" langchain-mistralai = "^0.1.12" langgraph-checkpoint-sqlite = "^1.0.0" grpcio = "^1.65.4" langgraph = "^0.2.10"
yindo closed this issue 2026-02-20 17:31:23 -05:00
Author
Owner

@HiraveBapu commented on GitHub (Aug 22, 2024):

saved = await self.checkpointer.aget_tuple(config) method is not implemented in langgraph side

@HiraveBapu commented on GitHub (Aug 22, 2024): saved = await self.checkpointer.aget_tuple(config) method is not implemented in langgraph side
Author
Owner

@vbarda commented on GitHub (Aug 22, 2024):

saved = await self.checkpointer.aget_tuple(config) method is not implemented in langgraph side

no, it's implemented on AsyncSqliteSaver, but the bug was still there -- thanks for reporting

@vbarda commented on GitHub (Aug 22, 2024): > saved = await self.checkpointer.aget_tuple(config) method is not implemented in langgraph side no, it's implemented on `AsyncSqliteSaver`, but the bug was still there -- thanks for reporting
Author
Owner

@vbarda commented on GitHub (Aug 22, 2024):

Should be fixed in 0.2.11, let me know if you're still running into issues

@vbarda commented on GitHub (Aug 22, 2024): Should be fixed in 0.2.11, let me know if you're still running into issues
Author
Owner

@HiraveBapu commented on GitHub (Aug 22, 2024):

its fixed in 2.11, thank you for prompt reply !

@HiraveBapu commented on GitHub (Aug 22, 2024): its fixed in 2.11, thank you for prompt reply !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#200