I'm trying to set up a spring cloud config server which fetches configs from a git repo using SSH key. It is running with springBootVersion 2.1.0.RELEASE and springCloudVersion Greenwich.M3.
The config service works fine without issues when using https bitbucket URI with username and password with below config:
security.user:
name: xxxxx
password: xxxxx
cloud.config.server:
git:
uri: https://bitbucket.org/abc/configs.git
username: uname
password: pass
But we had to migrate to use ssh key instead of username and password with the below configuration:
security.user:
name: xxxxx
password: xxxxx
cloud.config.server:
git:
uri: [email protected]:abc/configs.git
The id_rsa private key file is in .ssh folder with the config file:
Host bitbucket.org
StrictHostKeyChecking no
IdentityFile /home/user/.ssh/id_rsa
The initial git clone works fine and we are able to fetch the configs without any issues when I hit http://xxxx:xxxx@localhost:8899/app/dev.
But after that, there are lots of WARNs in the logs that its not able to fetch from remote. After the initial clone, further updates to the configs are also fetched properly. But not sure why there these many WARNs in the logs and it concerns me.
2020-07-31 11:38:51.636 WARN 1 --- [io-48899-exec-7] .c.s.e.MultipleJGitEnvironmentRepository : Could not fetch remote for master remote: [email protected]:abc/configs.git
As I mentioned earlier, this is only happening when we use SSH key to clone. The same project works fine with https clone. Is there anything that I'm missing?