# Supabase .single() fails with PGRST116 for a row you know exists

> Row Level Security only had a read policy for the row's owner. A second role that also needed the row got zero rows back, which .single() reports as PGRST116, not a permission error.

Web page: https://davidewins.com/errors/postgrest-pgrst116-rls-hides-row

Supabase. Confirmed fix, 13 September 2026.

Versions: supabase-js 2.89

Error:

```
{"code": "PGRST116", "details": "The result contains 0 rows", "message": "JSON object requested, multiple (or no) rows returned"}
```

## Cause

Row Level Security only had a read policy for the row's owner. A second role that also needed the row got zero rows back, which `.single()` reports as PGRST116, not a permission error.

## Fix

Either add an RLS policy for that role, or read the data through a backend endpoint that checks the relationship and uses the service role. Use `.maybeSingle()` if zero rows is a legitimate result.

## More Supabase errors

- [PostgREST 500: canceling statement due to statement timeout on a jsonb filter](https://davidewins.com/errors/postgrest-jsonb-filter-statement-timeout)
- [Reversal runs twice when two requests race](https://davidewins.com/errors/idempotency-read-then-write-race)

[Search all errors](https://davidewins.com/errors)
