octobercms/october · error · SystemException
There is no an authenticated user to load or save…
Error message
There is no an authenticated user to load or save preferences for.
What it means
Thrown by UserPreference::resolveUser when BackendAuth::getUser() returns null — the preference store was asked to load or save preferences without an authenticated backend user. It is a session/context guard: preferences are per-user, and code paths running outside an authenticated backend session (queues, console, unauthenticated AJAX) trigger it.
Solutions
- Ensure the code runs within an authenticated backend session before touching preferences
- Pass an explicit user object where the API allows it instead of relying on the session
- In queued/console contexts, resolve and supply the user id before calling preference methods
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/models/UserPreference.php:41 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/112372118382cd54.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/models/UserPreference.php:41
public $timestamps = false;
/**
* @var array cache
*/
protected static $cache = [];
/**
* resolveUser checks for a supplied user or uses the default logged in. You should
* override this method
*
* @param mixed $user An optional back-end user object.
* @return User object
*/
public function resolveUser($user)
{
$user = BackendAuth::getUser();
if (!$user) {
throw new SystemException(trans('backend::lang.user.preferences.not_authenticated'));
}
return $user;
}
}
View on GitHub (pinned to b608633a7e)