git-resource icon indicating copy to clipboard operation
git-resource copied to clipboard

Better diagnostics when required settings not found

Open JohannesRudolph opened this issue 9 years ago • 3 comments

I just wasted a non-trivial amount of time figuring out why git-resource wouldn't work for checking out a repo via ssh.

Turns out I was using private-key: instead of private_key: in my pipeline.yml

In both cases, fly set-pipeline happily accepted my inputs, letting me down only when trying to check the resource, with this error

$ fly -t local cr -r test/resource-tutorial
error: check failed with exit status '128':
Cloning into '/tmp/git-resource-repo-cache'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

(see also https://github.com/concourse/git-resource/issues/66#issuecomment-246106658)

At least git-resource should both provide proper diagnostics and check that it actually has a private key specified when trying to check out an ssh repo. A warning statement about missing settings in the output returned by fly would be good enough already.

Bettery yet, fly set-pipeline should validate the yml file, though that may be a lot more difficult

JohannesRudolph avatar Sep 10 '16 13:09 JohannesRudolph

Hi there!

We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

The current status is as follows:

  • [ ] #130143347 Better diagnostics when required settings not found

This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

concourse-bot avatar Sep 10 '16 13:09 concourse-bot

This just bit me as well. Perhaps some stricter validation of the Yaml is required so that if keys that it's not expecting exist it reports them as errors. Misspellings are a bitch.

sybrandy avatar Nov 18 '16 17:11 sybrandy

This hit me just now. Spent a lot of time looking for bad sshd settings (its a local network repository), bad keys, bad ~/.ssh/ directory/file permissions, even set sshd to DEBUG3. I hardly looked at the YML even though I was trying different keys all the time. The - vs. _ is difficult to spot.

Maybe fly could complain when there's a git resource with git@... URI but no private key? I think the key can be considered mandatory when there's a user name, as password prompting is impossible in this scenario.

Thanks, Johannes, for pointing me in the right direction! I spent about a day on this and would have never found the cause without your post.

cjmenke avatar Sep 14 '19 06:09 cjmenke