[SOLVED] Login issues, no such user

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.

Thank you in advance for your time.

Cheers.

As an admin, search for the user, and you should be able to do it when viewing their profile (I hope we don’t require the current password for this).

Otherwise, via indico shell:

identity = Identity.query.filter_by(identifier='usernamewiththespace').first()
identity.identifier = identity.identifier.strip()
db.session.commit()

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.

Hi,
thank you very much for your hints.

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).

Is the user able to login now?

The submit button of a form is usually disabled unless you changed some field.

The submit button of a form is usually disabled unless you changed some field.

Yes, sure, you are right, sorry.

After the change via Indico shell, the user tried to login with “namesurname” in place of “name surname” as username, but the login did not succeed.

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.

that sounds like an incredibly ugly option. better assign a new username identity.identifier = 'something' and then have the user login with that.

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.

Restarting shouldn’t be needed.

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.

EDIT: The change was made by the user, and now he can login. So, we solved!

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.

CTRL+F5 or simply navigating away and then to correct page again avoids this.

Yes, I did it. I thought there was a delay but I realized that probably the modification was made by the user, not by me.

Thank you very much for the support!