repo init -u hanging

2,422 views
Skip to first unread message

frank.sposaro

unread,
Aug 27, 2011, 2:01:55 PM8/27/11
to Repo and Gerrit Discussion
Hi all,

I have been working on setting up gerrit on my school's server. The
web interface it up and I have successfully created a project using
the ssh command.
However, when I run
repo init -u git://my.server.name/path/repo.git

It checks for the newest version of repo - OK
Then hangs when it tries to check out my repo.git

I suspect this could be a firewall issue.
Does repo init run on top of SSH?
That means repo upload will also.
If it does then I need to get my sysadmin to open up the SSH port,
just like they needed to for the web interface?

Any ideas?

Thank you

Magnus Bäck

unread,
Aug 27, 2011, 6:28:24 PM8/27/11
to Repo and Gerrit Discussion
On Saturday, August 27, 2011 at 20:01 CEST,
"frank.sposaro" <frank....@gmail.com> wrote:

> I have been working on setting up gerrit on my school's server. The
> web interface it up and I have successfully created a project using
> the ssh command.
> However, when I run
> repo init -u git://my.server.name/path/repo.git
>
> It checks for the newest version of repo - OK
> Then hangs when it tries to check out my repo.git
>
> I suspect this could be a firewall issue.
> Does repo init run on top of SSH?

No, it uses the Git URL that you specify with the -u option, so in
your case it uses the native port 9418 Git protocol *unless* you have
an insteadOf block in your ~/.gitconfig to rewrite your server URL to
a different one. That could explain why git://android.git.kernel.org
is accessible but git://my.server.name isn't. Please check your
~/.gitconfig for any insteadOf occurences and investigate what firewall
restrictions you have. For example, are you able to connect to port 9418
of your server using a telnet client?

> That means repo upload will also.
> If it does then I need to get my sysadmin to open up the SSH port,
> just like they needed to for the web interface?

Uploads always use SSH.

--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

frank.sposaro

unread,
Aug 28, 2011, 4:25:13 PM8/28/11
to Repo and Gerrit Discussion
Thank Magnus,

On Aug 27, 6:28 pm, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
> On Saturday, August 27, 2011 at 20:01 CEST,
>      "frank.sposaro" <frank.spos...@gmail.com> wrote:
>
> > I have been working on setting up gerrit on my school's server. The
> > web interface it up and I have successfully created a project using
> > the ssh command.
> > However, when I run
> > repo init -u git://my.server.name/path/repo.git
>
> > It checks for the newest version of repo - OK
> > Then hangs when it tries to check out my repo.git
>
> > I suspect this could be a firewall issue.
> > Does repo init run on top of SSH?
>
> No, it uses the Git URL that you specify with the -u option, so in
> your case it uses the native port 9418 Git protocol *unless* you have
> an insteadOf block in your ~/.gitconfig to rewrite your server URL to
> a different one. That could explain why git://android.git.kernel.org
> is accessible but git://my.server.name isn't. Please check your
> ~/.gitconfig for any insteadOf occurences and investigate what firewall
> restrictions you have. For example, are you able to connect to port 9418
> of your server using a telnet client?

No telnet connection from either inside or outside of my networks. So
I will have to get that port opened on both my server and the school's
sever. Thanks for this.

> > That means repo upload will also.
> > If it does then I need to get my sysadmin to open up the SSH port,
> > just like they needed to for the web interface?
>
> Uploads always use SSH.

Great. I already have a request into systems to open port 29418 which
should fix repo upload when I'm able to get that far.

Thanks again.

frank.sposaro

unread,
Aug 31, 2011, 5:21:24 PM8/31/11
to Repo and Gerrit Discussion
Hi Magnus,

I seem to having a lot of problems getting this
repo init -u command to work.
Should I be starting something on the gerrit that is listening on
9418?
I've tried allowing the port in my iptables, but that won't do
anything because I still have nothing actually listening on that port.
I downloaded git-daemon, but can't seem to find a command to get that
running.
By default when I do a /bin/gerrit.sh start it only opens up 29418 and
8080.
I was able to clone a git repo over ssh, but I don't want to have to
type long commands everytime I want to push back to gerrit for review.

Any suggestions would be a huge help please.






On Aug 27, 6:28 pm, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
> On Saturday, August 27, 2011 at 20:01 CEST,

Magnus Bäck

unread,
Sep 1, 2011, 2:39:05 AM9/1/11
to Repo and Gerrit Discussion
On Wednesday, August 31, 2011 at 23:21 CEST,
"frank.sposaro" <frank....@gmail.com> wrote:

> I seem to having a lot of problems getting this
> repo init -u command to work.
> Should I be starting something on the gerrit that is listening on
> 9418?

The Git protocol (git:// URLs) is typically set up to use port 9418, so
when you tried to sync from such a URL I assumed you had a Git daemon
set up. Gerrit doesn't provide such a daemon, so you'll have to set it
up yourself. If you don't want to do that you need to use Gerrit's SSH
daemon.

> I've tried allowing the port in my iptables, but that won't do
> anything because I still have nothing actually listening on that port.
> I downloaded git-daemon, but can't seem to find a command to get that
> running.
> By default when I do a /bin/gerrit.sh start it only opens up 29418 and
> 8080.
> I was able to clone a git repo over ssh, but I don't want to have to
> type long commands everytime I want to push back to gerrit for review.

If you clone from ssh://first...@hostname.example.com:29418 you can
push back with "git push origin ...". To avoid having to this lengthy
URL you can either set up an insteadOf rule to have Git rewrite the URL
for you, for example

[url "ssh://first...@hostname.example.com:29418"]
insteadOf = ssh://hostname

or you could set up an SSH client alias in your ~/.ssh/config:

Host hostname
HostName hostname.example.com
Port 29418
User first.last

frank.sposaro

unread,
Sep 1, 2011, 9:53:21 AM9/1/11
to Repo and Gerrit Discussion
Thank you.

**Resolved**
For anyone reading this thread.

I ended up using the SHH protocol, but also scrapping the REPO tool
all together.
I believe that Android only used REPO because they want to pull from
several repos into one. For our purposes this would only complicate
things, because we aren't receiving contributions from all over.

These are the following commands that I use

Making a copy of the repo
git clone ssh://myserver.address:29418/path/myreponame.git

Setting up references to go through gerrit code review system
git config remote.origin.push HEAD:refs/for/master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master


Now I can use my basic git commands
git commit -a
git push


Thanks for all the help.






On Sep 1, 2:39 am, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
> On Wednesday, August 31, 2011 at 23:21 CEST,
>      "frank.sposaro" <frank.spos...@gmail.com> wrote:
>
> > I seem to having a lot of problems getting this
> > repo init -u command to work.
> > Should I be starting something on the gerrit that is listening on
> > 9418?
>
> The Git protocol (git:// URLs) is typically set up to use port 9418, so
> when you tried to sync from such a URL I assumed you had a Git daemon
> set up. Gerrit doesn't provide such a daemon, so you'll have to set it
> up yourself. If you don't want to do that you need to use Gerrit's SSH
> daemon.
>
> > I've tried allowing the port in my iptables, but that won't do
> > anything because I still have nothing actually listening on that port.
> > I downloaded git-daemon, but can't seem to find a command to get that
> > running.
> > By default when I do a /bin/gerrit.sh start it only opens up 29418 and
> > 8080.
> > I was able to clone a git repo over ssh, but I don't want to have to
> > type long commands everytime I want to push back to gerrit for review.
>
> If you clone from ssh://first.l...@hostname.example.com:29418 you can
> push back with "git push origin ...". To avoid having to this lengthy
> URL you can either set up an insteadOf rule to have Git rewrite the URL
> for you, for example
>
>     [url "ssh://first.l...@hostname.example.com:29418"]

Anatol Pomazau

unread,
Sep 1, 2011, 2:10:11 PM9/1/11
to frank.sposaro, Repo and Gerrit Discussion
Hi

On Thu, Sep 1, 2011 at 6:53 AM, frank.sposaro <frank....@gmail.com> wrote:
Thank you.

**Resolved**
For anyone reading this thread.

I ended up using the SHH protocol, but also scrapping the REPO tool
all together.
I believe that Android only used REPO because they want to pull from
several repos into one. For our purposes this would only complicate
things, because we aren't receiving contributions from all over.

These are the following commands that I use

Making a copy of the repo
git clone ssh://myserver.address:29418/path/myreponame.git

Setting up references to go through gerrit code review system
git config remote.origin.push HEAD:refs/for/master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master


You might want to use GGH script. https://github.com/hobbs/ggh

It does what you described above but requires less efforts from a developer.
 

Reply all
Reply to author
Forward
0 new messages