"ID is already taken" error message with every new user

Summary

New system with first users invited. When user tries to create account " ID is already taken" error appears. However the account is successfully created.

Steps to reproduce

How can we reproduce the issue (what version are you using?)
Invite a new member. Running 4.0.1 on Ubuntu 16.04

Expected behavior

No error message

Observed behavior

Error Message “ID is already taken”

Thanks @richardiriwn for the report!

What authentication method are you using? Email/password, LDAP or something else?

Does this happen to all users or only for a few?