Deploying code from your control repo fails with a Failed to authenticate SSH
or Connection refused
error. This error is common for BitBucket, which requires ssh://
at the beginning of the SSH URL, but it might also occur with other Git providers like GitHub and GitLab when a port is specified.
Error messages
Original exception: Failed to authenticate SSH session: Unable to send userauth-publickey request
Unable to determine current branches for Git source 'puppet' (/etc/puppetlabs/code-staging/environments) Original exception: Invalid credential type
or
Unable to determine current branches for Git source 'puppet' (/etc/puppetlabs/code-staging/environments)\nOriginal exception:\nfailed to connect to puppet-server.example.com: Connection refused\n"
If the SSH URL for the repo doesn’t match what’s set in r10k_remote
, Code Manager deployments fail.
Version and installation information
PE version: All supported
Installation type: Any
Solution
For Code Manager to pull code from your control repo, the r10k_remote
parameter value must match the format of your Git host’s SSH URL exactly.
-
Check the value of the SSH URL for your control repo on your Git host. See your provider’s documentation for this information and note it for the next step. The format is
<GIT PROVIDER SSH URL>:<PORT>/puppet/control_repo.git>
, which might or might not include a port number. For example,git@example.gitserver.com:puppet/control.git:2222
orssh://git@example.gitserver.com:puppet/control.git:2222
. -
On the primary server, check the value of
r10k_remote
by runningcat /etc/puppetlabs/r10k/r10k.yaml
. -
If the
r10k_remote
value on the primary server does not match your Git repo’s SSH URL, update the value in either Hiera or the console.Tip: Not including
ssh://
at the beginning of the URL value forr10k_remote
is a common misconfiguration.
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles