Back to OP5 Monitor FAQ

How to solve Login issues caused by empty or NULL password in auth_users.yml?

The problem Copied

If you get the following error message:

'NULL' is not valid for password 'password', in table: 'users'

This means there is a literal password value of NULL in /etc/op5/auth_users.yml.

The Solution Copied

Step 1 Copied

From the Monitor shell, look for any users in /etc/op5/auth_users.ymlthat do not have a password entry (or simply run grep -B 5 -i null /etc/op5/auth_users.yml). In a valid entry, you will see both password and password_algo fields and values:

john:
  username: "john"
  password: "$1$7th39pXa$IV0PUeEJDY752corXIWGr."
  password_algo: "crypt"
  modules:
    - "Default"
  groups:
    - "admins"
  realname: "John Doe"

When you get a failing entry, you will not likely have a password_algo field and the password value will not be in double-quotes:

jane:
  username: "jane"
  password: null
  modules:
    - "Default"
  groups:
    - "admins"
  realname: "Jane Doe"

Step 2 Copied

Copy each of the user entries that do not have passwords. You will need to re-enter this content when you add the password since any update via op5-manage-userswill purge existing content. Please see https://support.itrsgroup.com/hc/en-us/articles/360020252513-How-to-reset-the-password-for-local-users for details.

Step 3 Copied

Use /usr/bin/op5-manage-users to set the password, and provide the original values along with the password. Based on the example above:

op5-manage-users --update --username=jane --password=PASSWORD--realname="Jane Doe" --group=admins
["Geneos"] ["FAQ"]

Was this topic helpful?