Pipeline doesn't start due to error running 'git rev-parse --abbrev-ref HEAD'

853 views
Skip to first unread message

Hans Dushanthakumar

unread,
Sep 24, 2016, 2:00:33 AM9/24/16
to go-cd
Hi,

Just wondering if anyone can shed some light into an error I'm seeing. This is on GoCD version 16.7.0, build 3819.

The below errors happen when I try to trigger a pipeline (to build a rails app). The pipeline doesn't start at all.

Modification check failed for material: URL: ssh://git@code.<hidden by Hans>.git, Branch: master [Sep-24 02:41:19]
Error performing command: --- Command --- git rev-parse --abbrev-ref HEAD --- Environment --- {GIT_ALLOW_PROTOCOL=http:https:ssh:git:file:rsync} --- INPUT ---- --OUTPUT --- HEAD --- ERROR --- STDERR: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. STDERR: Use '--' to separate paths from revisions, like this: STDERR: 'git <command> [<revision>...] -- [<file>...]' --- 
Could not trigger pipeline 'Poseidon' [Sep-24 02:41:19]
Material update failed for material 'ssh://git@code.<hidden by Hans>.git' because: Error performing command: --- Command --- git rev-parse --abbrev-ref HEAD --- Environment --- {GIT_ALLOW_PROTOCOL=http:https:ssh:git:file:rsync} --- INPUT ---- --OUTPUT --- HEAD --- ERROR --- STDERR: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. STDERR: Use '--' to separate paths from revisions, like this: STDERR: 'git <command> [<revision>...] -- [<file>...]' --- . Cause: Error performing command: --- Command --- git rev-parse --abbrev-ref HEAD --- Environment --- {GIT_ALLOW_PROTOCOL=http:https:ssh:git:file:rsync} --- INPUT ---- --OUTPUT --- HEAD --- ERROR --- STDERR: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. STDERR: Use '--' to separate paths from revisions, like this: STDERR: 'git <command> [<revision>...] -- [<file>...]' --- 

Any idea what causes this? Is the above 'modification check' done on the GoCD server or the agent?

I've noticed that the pipeline starts fine immediately after I change the 'Destination Directory' in the Materials setting, just for one time. But the next time I try to kick it off, it wont start, and the same error is shown. However if I change the Destination Dir again (say to a blank), then it starts fine, for one time.

The git repo is a bitbucket repo, and the branch is 'master'. It connects fine, as shown here:


Also, I've enabled 'Clean Working Directory' for each stage, however this didn't help (I saw this as a recommendation when I searched for this error in this forum): 

Thanks,
Hans


Ketan Padegaonkar

unread,
Sep 24, 2016, 5:04:35 AM9/24/16
to go-cd

This is likely a cause of having a remote named HEAD. Could you see what you see when you run 'git ls-remote URL'  - feel free to remove any sensitive branch names.


--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hans Dushanthakumar

unread,
Sep 24, 2016, 5:42:03 AM9/24/16
to go-cd
Thanks.

Here's the output of ls-remote:

/opt/go-agent/pipelines/Poseidon_new# git ls-remote ssh://git@<removed by Hans>.net:7999/aweb/poseidon.git
9115713caeb293e6a046520b9f7417f487e6f5d9        HEAD
9115713caeb293e6a046520b9f7417f487e6f5d9        refs/heads/master


Currently, the repo only has a master, no other branches or tags:

Thanks,
Hans
Reply all
Reply to author
Forward
0 new messages