harbordocker-repository

How can we enable the expired robot account from Harbor Database without changing the credentials?


We are using Harbor as Docker Repository in the organization. To push/pull the docker images through Jenkins CI/CD or K8S deployment, we have created a Robot account.

This robot account expired and we wish to extend the expiry without changing the credentials for it. We made an attempt to modify the robot table in the registry schema of Harbor by changing the expiry date to -1. However, this change was reflected only in the Harbor UI but the credentials are still not valid. While trying to login through the Harbor Robot credentials, we are encountering the below error message:

unauthorized: unauthorized to access repository: abc-def/pqr

Updated change on the Harbor UI

Updated change on the Harbor UI:

Which tables shall be referred for this change in Harbor DB?

Links already referred:

Harbor Version - 2.0


Solution

  • Update from the Harbor Github Repo contributor:

    This is supported by robot v2 which is introduced from v2.2, you can upgrade to this version and create some new robot accounts(v2) instead.

    For the robotv1, it's no way to update the expiration date as it's encapsulated into the JWT token.

    BTW, it's not recommended to update the DB directly for any reason, as it may cause some unexpected behaviors.

    Reference: https://github.com/goharbor/harbor/issues/15051