RocketChat/Rocket.Chat · error · Error
Failed to parse custom user field map
Error message
Failed to parse custom user field map
What it means
Error "Failed to parse custom user field map" thrown in RocketChat/Rocket.Chat.
Source
Thrown at apps/meteor/server/lib/saml/lib/Utils.ts:269
}
return cert
.replace(/-+BEGIN CERTIFICATE-+\r?\n?/, '')
.replace(/-+END CERTIFICATE-+\r?\n?/, '')
.replace(/\r\n/g, '\n')
.trim();
}
public static getUserDataMapping(): IUserDataMap {
const { userDataFieldMap, immutableProperty } = globalSettings;
let map: Record<string, any>;
try {
map = JSON.parse(userDataFieldMap);
} catch (err) {
SAMLUtils.log({ userDataFieldMap, err });
throw new Error('Failed to parse custom user field map');
}
const parsedMap: IUserDataMap = {
attributeList: new Set(),
email: {
fieldName: 'email',
},
username: {
fieldName: 'username',
},
name: {
fieldName: 'cn',
},
identifier: {
type: '',
},
};
View on GitHub (pinned to 2a7de45707)
Solutions
- Fix the custom user field map setting so it contains valid JSON in the expected format.
When it happens
Trigger: Thrown when the custom SAML user field map setting contains JSON that cannot be parsed.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of RocketChat/Rocket.Chat@2a7de45707 (2026-08-18).
Data as JSON: /api/errors/fa54852537426f93.
Report an issue: GitHub.