Error "The new password can not be same with the old one" when updating Harbor user
search cancel

Error "The new password can not be same with the old one" when updating Harbor user

book

Article ID: 425160

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

  • When attempting to change a local Harbor user's password back to a previously used password, the operation fails with the error
  • The reason this might be required is if the same user is used on multiple projects/clusters
  • You will see image pull issue on the Pods while the harbor is in this state
  • This occurs even if manual database resets of the salt and password fields are attempted.
    1. docker exec -it harbor-db psql -U postgres -d registry -c "SELECT user_id, username FROM harbor_user WHERE username = '###';"
    2. UPDATE harbor_user SET salt='', password='' WHERE user_id = <ID>; (user_id from Step 1)

Environment

3.2

Cause

Harbor validation logic prevents a password update if the new entry matches the current stored hash. Standard database manipulation may fail if the harbor-core service is not restarted or if the API prevents transitions from a null state.

Resolution

  1. Backup: Take a snapshot of the Harbor VM or perform a restic backup of the Harbor database.
  2. Navigate to Administration > Users, select the user, and click Delete. Note: This will remove the user from all project memberships.
  3. Click + New User, use the same username, and enter the desired original password.
  4. Add the user back to their respective Projects with the appropriate roles (Developer, Maintainer, etc.).