Mintplex-Labs/anything-llm · error
User is suspended.
Error message
User is suspended.
What it means
After token and approval checks pass, validDeviceToken loads the device's owning user (MobileDevice.get with { user: true }); if that user has suspended = true it responds 400 { error: 'User is suspended.' } and never attaches the user to response.locals. A suspended owner blocks the device even when the device itself is approved.
Source
Thrown at server/endpoints/mobile/middleware/index.js:31
try {
const token = request.header("x-anythingllm-mobile-device-token");
if (!token)
return response.status(400).json({ error: "Device token is required" });
const device = await MobileDevice.get(
{ token: String(token) },
{ user: true }
);
if (!device)
return response.status(400).json({ error: "Device not found" });
if (!device.approved)
return response.status(400).json({ error: "Device not approved" });
// If the device is associated with a user then we can associate it with the locals
// so we can reuse it later.
if (device.user) {
if (device.user.suspended)
return response.status(400).json({ error: "User is suspended." });
response.locals.user = device.user;
}
delete device.user;
response.locals.device = device;
next();
} catch (error) {
console.error("validDeviceToken", error);
response.status(500).json({ error: "Invalid middleware response" });
}
}
/**
* Validates a temporary registration token that is passed in the request
* and associates the user with the token (if valid). Temporary token is consumed
* and cannot be used again after this middleware is called.
* @param {*} request
* @param {*} responseView on GitHub (pinned to 3aec848f28)
Solutions
- Admin must unsuspend the account (multi-user settings) to restore device access
- Or pair the device to a different active account via fresh connect-info
- On the client, surface 'account suspended — contact admin' and stop retrying
Defensive patterns
Strategy: fallback
Try / catch
try {
await api.command('workspaces');
} catch (e) {
if (e.status === 400 && e.body?.error === 'User is suspended.') {
return showFatal('Account suspended — contact your administrator');
}
throw e;
} Prevention
- Treat suspension as a terminal state in the app — no auto-retry
- Show a clear 'contact admin' message instead of a generic error
- Admins: prefer unapproving/deleting the device rather than suspending owners when only device access should end
When it happens
Trigger: Admin suspends the user account that owns the device while the paired app keeps making requests; a device registered under an account that is later suspended.
Common situations: Employee offboarding: account suspended but the phone app still installed and polling; suspension during an active pairing.
Related errors
- User is suspended - cannot register device
- User account suspended.
- Device token is required
- Device not found
- Device not approved
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/868e9ce62e84c638.
Report an issue: GitHub.