Hi,
a user reported the following message when trying to perform a login: Login failed: No such user
The user account exists but I noticed that there was a space character into the username. I don’t know if this is the cause of the issue.
Anyway, since, as far as I know, the user account cannot be deleted, I would like to ask you if there is a way to change the username of a registered user, also acting under the hood on the db.
Also, it would be good to know how the user managed to get a space there - AFAIK we strip surrounding whitespace everywhere, so if there’s a way to create an indico account with surrounding whitespace in the username that’d be a bug.
I don’t know what happened from the user side, so, I’m sorry, I cannot say anything about that.
This is what I have done on the Indico server:
[root@indico ~]# su - indico
Last login: Fri Oct 30 11:48:29 CET 2020 on pts/0
[indico@indico ~]$ source ~/.venv/bin/activate
(.venv)[indico@indico ~]$ indico shell
^[[A^[[A^[[A/opt/indico/.venv/lib/python2.7/site-packages/indico/core/logger.py:112: UserWarning: Logging config file not found; using defaults. Copy /opt/indico/.venv/lib/python2.7/site-packages/indico/logging.yaml.sample to /opt/indico/etc/logging.yaml to get rid of this warning.
.format(path=path, default_path=default_path))
^[[A^[[A^[[B^[[B^[[A^[[AIndico v2.3 is ready for your commands
In [1]: identity = Identity.query.filter_by(identifier='name surname').first()
In [2]: identity.identifier = identity.identifier.strip()
In [3]: db.session.commit()
In [4]: exit
(.venv)[indico@indico ~]$ exit
logout
[root@indico ~]# systemctl restart uwsgi.service httpd.service indico-celery.service
But now, from the Indico web interface, on the user account window, the “Modify credentials” button is disabled.
The username field is always the same: “name surname” (without double quotes).
umm I think we are mixing up things… spaces in the middle of the username should be ok; I thought you were talking about a space at the end of the username - strip() only removes surrounding whitespace.
Maybe look at the identity.identifier and make sure the user users that when logging in…
Yes, the space is in the middle.
I asked the user to perform a login also with “name surname”, like in the very first attempt.
Also in this case the login fails.
A quick solution could be to create a new user manually, even if this is not the best way to operate.
Ok, I tried that instruction from the Indico Shell but it seems it doesn’t change anything, I don’t know why.
As previously, I committed the changes and restarted the services.
Is the user absolutely sure he’s entering the correct username? Maybe have him use the “reset password” function, iirc we include the username in the email as well…
Thank you ThiefMaster,
I asked the user to perform a password reset.
In the meantime I noticed that the username field has changed to name.surname (the modification I made previously).
It seems the modification of the identifier succeeded but with a delay.
I will report you more details as soon as possible.
In the mean time, thank you for your hints.
There is no such delay on the indico side. However, if your just refreshed the page your browser may have kept the old form data. CTRL+F5 or simply navigating away and then to correct page again avoids this.