[SOLVED]Cannot reset master password

I forgot the master password, and I received the message “we have detected…change token…”
I decided to delete all and start all over.
I’ve tried
sudo -u www-data php /var/www/nextcloud/occ passwords:user:delete myuser
answered “yes”, relogin to nextcloud and … the master password dialog keeps showing and blocking me.
What to do to start from scratch?

The passwords:user:delete command should be the right way. But you need to make sure to give it the internal NC user id (which might be different from your user login), otherwise it will just do nothing.

Thank you very much. It was case sensitive. Strange that occ accepts non-existing users.

If you update to 2021.5.0, there should be a warning if the user can’t be found.

The command just deletes any data related to that user id. Since the related user could already be deleted (e.g. when user management is done outside NC) there is no check performed (prior to 2021.5.0) if the id is valid or if any data is attached to it.