stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC

user1927233 picture user1927233 · Dec 27, 2012 · Viewed 13k times · Source

Before anyone guns me down..I have looked at all the messages that has this error but they seem to manifest from a different problem,I couldn't get any substantial information. Following are the errors I'm running into in the git polling log...

  1. I don't have a clue regarding error #1,please provide inputs

  2. For this,I read on other questions that $GERRIT_REFSPEC gets filled in dynamically when there is a gerrit trigger but i don't understand why I keep seeing this in the git poll log. How can I fix this ?


Error messages:

  1. ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway

  2. hudson.plugins.git.GitException: Command "/usr/bin/git fetch -t ssh://company.com:29418/platform/vendor/proprietary/mla.git $GERRIT_REFSPEC" returned status code 128: stdout: stderr: fatal: Couldn't find remote ref $GERRIT_REFSPEC

Answer

Rado picture Rado · Jun 12, 2014
  • Go to the Job's Configure page and search to check This build is parameterized box.
  • Then set Name to GERRIT_REFSPEC
  • and Default value to refs/heads/master.

It took me some time to search for how to add this string parameter mentioned in the Gerrit Trigger plugin manual. I use Jenkins 1.567 with Gerrit Trigger 2.11.1.