RocketChat/Rocket.Chat · error · Meteor.Error
error-status-not-allowed
error-status-not-allowed
Error message
Invisible status is disabled
What it means
Thrown by POST users.setStatus when the effective status resolves to 'offline' but the instance setting Accounts_AllowInvisibleStatusOption is disabled. The effective status is computed as the supplied status, else the user's statusDefault, else 'online' - so a user whose statusDefault is 'offline' can hit this even without explicitly sending status:'offline'.
Source
Thrown at apps/meteor/server/api/v1/users.ts:2039
const statusExpiresAt = expiresAt ? new Date(expiresAt) : undefined;
if (statusExpiresAt && Number.isNaN(statusExpiresAt.getTime())) {
throw new Meteor.Error('error-invalid-date', 'Invalid expiresAt date string', {
method: 'users.setStatus',
});
}
if (statusExpiresAt && statusExpiresAt.getTime() <= Date.now()) {
throw new Meteor.Error('error-invalid-date', 'expiresAt must be a future date', {
method: 'users.setStatus',
});
}
// If status is missing (message-only update), keep the user's chosen status (statusDefault),
// not the computed status — otherwise a transient auto-away/offline gets pinned as a manual claim.
const effectiveStatus = status || user.statusDefault || ('online' as UserStatus);
if (effectiveStatus === 'offline' && !settings.get('Accounts_AllowInvisibleStatusOption')) {
throw new Meteor.Error('error-status-not-allowed', 'Invisible status is disabled', {
method: 'users.setStatus',
});
}
await Presence.setStatus(user._id, effectiveStatus, message, statusExpiresAt);
return API.v1.success();
},
)
.get(
'users.getStatus',
{
authRequired: true,
query: isUsersGetStatusParamsGET,
response: {
200: ajv.compile<{ _id: string; status: string; connectionStatus?: string; statusSource?: string; statusExpiresAt?: string }>({
type: 'object',
properties: {View on GitHub (pinned to f9d3ec372b)
Solutions
- Enable Accounts_AllowInvisibleStatusOption if invisible/appear-offline is intended to be allowed.
- When the setting is off, explicitly send a non-offline status, or reset the user's statusDefault away from 'offline' first.
- Client: check the public setting and hide the 'invisible' option when disabled.
Example fix
// before - setting off, statusDefault is offline
POST('/api/v1/users.setStatus', { message: 'busy' }) // effectiveStatus -> offline -> error
// after
POST('/api/v1/users.setStatus', { status: 'away', message: 'busy' }) Defensive patterns
Strategy: validation
Validate before calling
const allowInvisible = await getSetting('Accounts_AllowInvisibleStatusOption');
const effective = body.status || user.statusDefault || 'online';
if (effective === 'offline' && !allowInvisible) {
body.status = user.statusDefault === 'offline' ? 'away' : (user.statusDefault || 'online');
} Type guard
function isInvisibleAllowed(settingValue, effectiveStatus) {
return effectiveStatus !== 'offline' || settingValue === true;
} Try / catch
try { await POST('/api/v1/users.setStatus', body); }
catch (e) {
if (e?.error === 'error-status-not-allowed') {
body.status = 'away'; await POST('/api/v1/users.setStatus', body); return;
}
throw e;
} Prevention
- Read Accounts_AllowInvisibleStatusOption and hide 'invisible' when off.
- When doing a message-only update, also ensure statusDefault is not 'offline' under that setting.
- Send an explicit non-offline status to avoid relying on statusDefault.
When it happens
Trigger: POST /api/v1/users.setStatus with status:'offline', or with status omitted while the user's statusDefault is 'offline', while Accounts_AllowInvisibleStatusOption is false.
Common situations: Admin disabled invisible status but a user previously set their default to offline. A client omits status in a message-only update and the user's pinned default is offline.
Related errors
- error-two-factor-not-enabled
- error-invalid-date
- error-endpoint-disabled
- error-shield-disabled
- error-not-allowed
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/57d3f78d9b092b6a.
Report an issue: GitHub.