portainer/portainer · error · httperror.HandlerError

Current password doesn't match. Password left unchanged

Error message

Current password doesn't match. Password left unchanged

What it means

Error "Current password doesn't match. Password left unchanged" thrown in portainer/portainer.

Source

Thrown at api/http/handler/users/user_update.go:122

			return httperror.Conflict("Another user with the same username already exists", errUserAlreadyExists)
		}

		user.Username = payload.Username
	}

	if payload.Password != "" && payload.NewPassword == "" {
		if tokenData.Role == portainer.AdministratorRole {
			return httperror.BadRequest("Existing password field specified without new password field.", errors.New("To change the password as an admin, you only need 'newPassword' in your request"))
		}

		return httperror.BadRequest("Existing password field specified without new password field.", errors.New("To change the password, you must include both 'password' and 'newPassword' in your request"))
	}

	if payload.NewPassword != "" {
		// Non-admins need to supply the previous password
		if tokenData.Role != portainer.AdministratorRole {
			if err := handler.CryptoService.CompareHashAndData(user.Password, payload.Password); err != nil {
				return httperror.Forbidden("Current password doesn't match. Password left unchanged", errors.New("Current password does not match the password provided. Please try again"))
			}
		}

		if !handler.passwordStrengthChecker.Check(payload.NewPassword) {
			return httperror.BadRequest("Password does not meet the minimum strength requirements", nil)
		}

		user.Password, err = handler.CryptoService.Hash(payload.NewPassword)
		if err != nil {
			return httperror.InternalServerError("Unable to hash user password", errCryptoHashFailure)
		}
		user.TokenIssueAt = time.Now().Unix()
	}

	if payload.Theme != nil {
		user.ThemeSettings.Color = *cmp.Or(payload.Theme.Color, &user.ThemeSettings.Color)
	}

View on GitHub (pinned to 17e74456ff)

When it happens

Trigger: Thrown at api/http/handler/users/user_update.go:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of portainer/portainer@17e74456ff (2026-08-26). Data as JSON: /api/errors/cb92e31312aca0a7. Report an issue: GitHub.