When creating a Spring Cloud Service Config Server Instance with a git url using SSH protocol we might see below error.
2025-03-11T10:50:29.593Z INFO 6 --- [ scheduling-1] i.p.s.c.mirrorservice.mirrors.ShellUtil : Running shell command: git -c "core.sshCommand=ssh -i /var/vcap/store/mirror/ed2343e4435942b2f8e6e2db244f0c4d/private-key -o StrictHostKeyChecking=no" fetch origin
2025-03-11T10:50:30.026Z INFO 6 --- [ scheduling-1] i.p.s.c.mirrorservice.mirrors.ShellUtil : Load key "/var/vcap/store/mirror/ed2343e4435942b2f8e6e2db244f0c4d/private-key": error in ibcrypto
2025-03-11T10:50:30.026Z INFO 6 --- [ scheduling-1] i.p.s.c.mirrorservice.mirrors.ShellUtil : [email protected]: Permission denied (publickey).
2025-03-11T10:50:30.026Z INFO 6 --- [ scheduling-1] i.p.s.c.mirrorservice.mirrors.ShellUtil : fatal: Could not read from remote repository.
VMware Tanzu Application Service for VMs
This issue is due to the configuration or formatting of the private keys.
Follow below steps to resolve mirror sync issue.
We followed below steps to resole mirror sync issue.
1) Generating the new ssh keys
-rw------- 1 ubuntu ubuntu 3389 Apr 14 04:39 id_rsa
-rw-r--r-- 1 ubuntu ubuntu 748 Apr 14 04:39 id_rsa.pub
2) Update the private key to config server with below format.
cf update-service si1 -c '{"git": { "uri": "[email protected]:kmk371661/testing.git", "privateKey": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaCxxxxxxxxxxxxxbQECAwQF\n-----END OPENSSH PRIVATE KEY-----\n"}}'
awk -v ORS='\\n' '1' id_rsa
ubuntu@opsmanager-3-0:~/.ssh$ ls -l
total 32
-rw------- 1 ubuntu ubuntu 3389 Apr 14 04:39 id_rsa
-rw-r--r-- 1 ubuntu ubuntu 748 Apr 14 04:39 id_rsa.pub
ubuntu@opsmanager-3-0:~/.ssh$ awk -v ORS='\\n' '1' id_rsa
3) Verify the status of the service update.
ubuntu@opsmanager-3-0:~/.ssh$ cf services
Getting service instances in org test3 / space ns1 as admin...
name offering plan bound apps last operation broker upgrade available
si1 p.config-server standard update succeeded scs-service-broker no