AsyncPostgresSaver 2.0.23 fails to read channel values: NoneType not a mapping
Fixes LangGraph's AsyncPostgresSaver failing to read checkpoints with a NoneType error on version 2.0.23. Use when alist/get_tuple raises about NoneType not being a mapping on langgraph-checkpoint-postgres 2.0.23. Fixed in the next release; upgrade past 2.0.23. Not for connection or table-missing errors.
AsyncPostgresSaver 2.0.23 fails to read channel values: NoneType object is not a mapping
TL;DR: version 2.0.23 of langgraph-checkpoint-postgres shipped a bug in checkpoint reads. Upgrade the package and the error goes away. Your data is fine; the bug is in the read path, not the stored checkpoints.
TypeError: NoneType object is not a mapping
# raised when reading checkpoints, e.g. checkpointer.alist(config) or
# checkpointer.aget_tuple(config), on langgraph-checkpoint-postgres 2.0.23When this applies
pip show langgraph-checkpoint-postgressays 2.0.23.- Writes succeed but READS fail:
get_state,get_state_history,alistraise the NoneType error. - Sync
PostgresSaveron the same version may work whileAsyncPostgresSaverfails.
When it does not
Undefined table 'checkpoints'means you never ransetup(). Different fix.- Connection refused / timeout means the database is unreachable. Different fix.
Fix it
1. Upgrade the checkpoint package
# terminal
pip install -U "langgraph-checkpoint-postgres"Then confirm:
# terminal
pip show langgraph-checkpoint-postgres | grep Version
# expect anything newer than 2.0.23Expected: reads work again with zero code changes. The stored checkpoints were never corrupted, so history comes back.
2. Verify the read path
config = {"configurable": {"thread_id": "thread-1"}}
state = graph.get_state(config)
print(state.values.keys()) # your channels, not an exceptionExpected: get_state returns the latest checkpoint instead of raising.
3. If you pin versions, bump the pin
If your lockfile pins langgraph-checkpoint-postgres==2.0.23, update the pin and redeploy. The bug is version-specific; staying pinned keeps you broken.
Why it happens
The 2.0.23 release changed how channel values are deserialized on the async read path and mishandled a null case, so a perfectly good checkpoint row came back as None where a mapping was expected. The fix release restored the correct deserialization. Writes were unaffected the whole time.
Edge cases
- If you ALSO see the error after upgrading, clear any cached/old package:
pip install --force-reinstall "langgraph-checkpoint-postgres". - The sync saver and async saver are separate code paths; a version can be broken for one and fine for the other. Always check the exact package and class you use.
- Downgrading below 2.0.23 also avoids the bug, but upgrading is better: you keep the other fixes.
Compatibility
langgraph-checkpoint-postgres 2.0.23 (broken) and the release that followed (fixed). Python only.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.