Symptoms
When enabling Two-Factor Authentication in the WHM interface, you are presented with a failure to load and parse errors relating to the tfa_userda.json file.
Description
When enabling Two-Factor Authentication, the following error is brought up and Two-Factor is not enabled.
Failed to fetch user configurations: (XID kyf29j) The system failed to load and to
parse the file “/var/cpanel/authn/twofactor_auth/tfa_userdata.json” because of an
error: (XID uzway2) The system failed to parse the JSON stream data “‘{}’ ” for
the caller “(eval)” because of an error: malformed JSON string, neither tag, array,
object, number, string or atom, at character offset 0 (before "\x{e2}\x{80}\x{98}{}...")
at /usr/local/cpanel/Cpanel/JSON.pm line 123.
Workaround
Verify your JSON file is valid. This can be done with the json_pp library if it is loaded or through python directly.
json_pp < /var/cpanel/authn/twofactor_auth/tfa_userdata.json
python -m json.tool /var/cpanel/authn/twofactor_auth/tfa_userdata.json
If you get an error, verify the contents of the file are only "{}"
Comments
0 comments
Article is closed for comments.