How to fix the error "Unauthenticated desc = Invalid username or password" during certificate export
Issue Description:
While exporting the TLS certificates using configureUiPathAS.sh, we get the error "Unauthenticated desc = Invalid username or password"
# ./configureUiPathAS.sh tls-cert get --outpath /tmp/certs/
FATA[0001] rpc error: code = Unauthenticated desc = Invalid username or password
[ERROR][2024-06-28T12:41:43+0000]: Failed to log in
#
Root Cause: The admin password secret is not in sync with argocd webportal password.
Resolution:
- Extract the admin secret using following command
# kubectl -n argocd get secret argocd-admin-password -o jsonpath="{.data.password}" |base64 -d
- Run the configureUiPathAS.sh script with bash -x option and note down the secret in argocd command listed in script output.
# bash -x configureUiPathAS.sh tls-cert get --outpath /tmp/certs/
- The extracted output would like look this:
+ argocd login alm.:443 --grpc-web --grpc-web-root-path / --username admin --password --insecure
FATA[0000] rpc error: code = Unauthenticated desc = Invalid username or password
+ error 'Failed to log in'
- Compare the secret/password in step 1 and step 2 and you will notice different value at both places.
- Encode the password shown in step 2 using command
# echo "" | base64
- Update the [.data.password] value in "argocd-admin-password" secret in argocd namespace with the secret value received in step 4.
# kubectl -n argocd edit secret argocd-admin-password -o yaml
- Now, export the certificates and it should be possible to export certificates.