repo init with -b <SHA1> fails

1,063 views
Skip to first unread message

Hari Kodungallur

unread,
May 8, 2015, 12:32:20 AM5/8/15
to repo-d...@googlegroups.com
Hello,

Something that was working until today morning broke this morning. We use gerrit repo plugin in jenkins to checkout a specific commit of the manifest. Essentially this translates to:

repo init -u <url> .... -b <SHA1>
repo sync

Starting this morning, the repo sync command fails with:

fatal: Couldn't find remote ref refs/heads/<SHA1>

We have been using this for a long long time without issues.

As far as I can tell, nothing else has changed. In case something did change, we don't know what it is. 
We tried to run this manually and it, obviously, fails as well. But if we do a "repo init" without -b, immediately followed by a "repo init -b", then all is well.

Can you please throw some light on what could be the problem?

thank you,
-Hari

David Pursehouse

unread,
May 8, 2015, 12:38:49 AM5/8/15
to Hari Kodungallur, repo-d...@googlegroups.com
On 05/08/2015 08:08 AM, Hari Kodungallur wrote:
> Hello,
>
> Something that was working until today morning broke this morning. We
> use gerrit repo plugin in jenkins to checkout a specific commit of the
> manifest. Essentially this translates to:
>
> repo init -u <url> .... -b <SHA1>
> repo sync
>
> Starting this morning, the repo sync command fails with:
>
> fatal: Couldn't find remote ref refs/heads/<SHA1>
>
> We have been using this for a long long time without issues.
>
> As far as I can tell, nothing else has changed. In case something did
> change, we don't know what it is.

What version of repo are you using? Are you sure it hasn't auto-updated
itself from an earlier version?

> We tried to run this manually and it, obviously, fails as well. But if
> we do a "repo init" without -b, immediately followed by a "repo init
> -b", then all is well.
>
> Can you please throw some light on what could be the problem?
>
> thank you,
> -Hari
>
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to repo-discuss...@googlegroups.com
> <mailto:repo-discuss...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Hari Kodungallur

unread,
May 8, 2015, 12:43:10 AM5/8/15
to David Pursehouse, repo-d...@googlegroups.com
On Thu, May 7, 2015 at 9:38 PM, David Pursehouse <david.pu...@sonymobile.com> wrote:
On 05/08/2015 08:08 AM, Hari Kodungallur wrote:
Hello,

Something that was working until today morning broke this morning. We
use gerrit repo plugin in jenkins to checkout a specific commit of the
manifest. Essentially this translates to:

repo init -u <url> .... -b <SHA1>
repo sync

Starting this morning, the repo sync command fails with:

fatal: Couldn't find remote ref refs/heads/<SHA1>

We have been using this for a long long time without issues.

As far as I can tell, nothing else has changed. In case something did
change, we don't know what it is.

What version of repo are you using?  Are you sure it hasn't auto-updated itself from an earlier version?

As far as I can tell repo, the python file, hasn't been updated March. I know there is an auto-update for repo. I am not entirely sure what that means. What is it that gets auto-updated? May something like that happened and I don't know what to look for. But would that break the -b <sha> support?

David Pursehouse

unread,
May 8, 2015, 12:51:34 AM5/8/15
to Hari Kodungallur, repo-d...@googlegroups.com
On 05/08/2015 01:43 PM, Hari Kodungallur wrote:
>
>
> On Thu, May 7, 2015 at 9:38 PM, David Pursehouse
> <david.pu...@sonymobile.com
> <mailto:david.pu...@sonymobile.com>> wrote:
>
> On 05/08/2015 08:08 AM, Hari Kodungallur wrote:
>
> Hello,
>
> Something that was working until today morning broke this
> morning. We
> use gerrit repo plugin in jenkins to checkout a specific commit
> of the
> manifest. Essentially this translates to:
>
> repo init -u <url> .... -b <SHA1>
> repo sync
>
> Starting this morning, the repo sync command fails with:
>
> fatal: Couldn't find remote ref refs/heads/<SHA1>
>
> We have been using this for a long long time without issues.
>
> As far as I can tell, nothing else has changed. In case
> something did
> change, we don't know what it is.
>
>
> What version of repo are you using? Are you sure it hasn't
> auto-updated itself from an earlier version?
>
>
> As far as I can tell repo, the python file, hasn't been updated March. I
> know there is an auto-update for repo. I am not entirely sure what that
> means. What is it that gets auto-updated? May something like that
> happened and I don't know what to look for. But would that break the -b
> <sha> support?
>

The repo file (meaning the one shown if you do `which repo`) is the
wrapper script and doesn't change very often. The latest version of
that is 1.21.

To get the version of repo you're actually using, run `repo version` in
the workspace. The latest version is v1.12.22.

Hari Kodungallur

unread,
May 8, 2015, 12:58:12 AM5/8/15
to David Pursehouse, repo-d...@googlegroups.com
Looks like it is not the latest. So likely didn't auto update.

$ repo version
repo version v1.12.20
repo launcher version 1.21
       (from /usr/local/bin/repo)

David Pursehouse

unread,
May 11, 2015, 5:22:04 AM5/11/15
to Hari Kodungallur, repo-d...@googlegroups.com
It should have been fixed with this commit:

https://gerrit-review.googlesource.com/#/c/67571/


On 05/08/2015 01:58 PM, Hari Kodungallur wrote:
>
>
> On Thu, May 7, 2015 at 9:51 PM, David Pursehouse
> <david.pu...@sonymobile.com
> <mailto:david.pu...@sonymobile.com>> wrote:
>
> On 05/08/2015 01:43 PM, Hari Kodungallur wrote:
>
>
>
> On Thu, May 7, 2015 at 9:38 PM, David Pursehouse
> <david.pu...@sonymobile.com
> <mailto:david.pu...@sonymobile.com>
> <mailto:david.pu...@sonymobile.com

Hari Kodungallur

unread,
May 11, 2015, 4:05:11 PM5/11/15
to David Pursehouse, repo-d...@googlegroups.com
Thank you. We will check it out.

thanks,
-Hari

Clyde Trent

unread,
Jun 16, 2015, 7:42:16 AM6/16/15
to repo-d...@googlegroups.com, david.pu...@sonymobile.com
Hi
It seems that this problem has started to appear for me in the last couple of days. I am using 

repo version v1.12.22
repo launcher version 1.21

It seems that the repo launcher is using the v1.12.22 tag, sha id 4ccad7554b958c701653c41a72442cccf301e71a but the fix Change 67571, 382582728ea779aa4cc5e8a7eba2b7b2167efabc , is not included in the tag. 

I have been able get it to work by changing, in ~/bin/repo 
REPO_REV = 'stable' to master
and commenting out
 if can_verify and not opt.no_repo_verify:
       rev = _Verify(dst, branch, opt.quiet)
 else:

Then I get the change in .repo/repo/project.py and everything works. I do not however like using it this way and was wondering if there is a better way to have the repo launcher use another tag or a sha id? When will a new tag come that includes the fix Change 67571?

Thank you,
Clyde Trent
Reply all
Reply to author
Forward
0 new messages