#6372·webstudio

## [Bug] Dev login reports `User not found` when PostgREST database role is missing

Author: DW-MediaLabCreated Sep 12, 2026Updated Sep 12, 2026

Summary

During initial self-host setup, dev login failed with:

User not found

The actual underlying PostgREST error in the builder log was:

role "anon" does not exist

The User table was empty, which initially made User not found appear plausible. However, the dev-login code is supposed to create the user automatically.

After creating the required PostgreSQL anon role and granting the necessary permissions, login immediately succeeded and Webstudio created the user itself.

Problem

The user-visible/authentication error hides the actual infrastructure/database problem.

Suggested improvement

When createOrLoginWithDev() receives a PostgREST error other than the expected zero-row result, surface the underlying PostgREST error or at least report something like:

Database/PostgREST error while looking up user

instead of:

User not found

This would have reduced troubleshooting considerably.