# X_KEYSET_NULL_KEY

## Means

a keyset page holds a null in one of its sort keys

## Typical cause

a raw read paged with keyset() orders by a nullable column: a row comparison has no null order, so the null rows fall off every page

## Fix

keyset({ keys: [{ column: sql`coalesce(p.published_at, p.created_at)`, kind: 'timestamptz', direction: 'desc' }, …] })  # or order by a not-null column

[Entity and database](/error-codes#entity-and-database)
