Problem with git push and clone

120 views
Skip to first unread message

desaperados

unread,
Aug 28, 2010, 7:52:16 AM8/28/10
to Gitorious
After a couple of false starts I've managed to get a copy of Gitorious
up and running on my ubuntu production server. The app itself seems to
be running ok - I can add and remove SSH keys, and create Repositories
via the web interface and see the changes reflected on the file
system.

It seems that I have a problem somewhere with some of the supporting
components as I still can't get remote git clone or push commands to
work. I'd appreciate any suggestions for where to look as I've run out
of ideas after a couple of days working on it.

- I've got each of the /etc/init.d/git-ultrasphinx /etc/init.d/git-
daemon /etc/init.d/stomp and /etc/init.d/git-poller up and running
without any errors.

- The script at /var/www/gitorious/script/gitorious has been symlinked
to /usr/bin/gitorious

- The application is being run by the git user. As far as I can make
out I don't have any permissions issues as I can create repositories
and add ssh keys via the web interface.

I have a custom ssh port set up on the server and port 22 is blocked.
I've defined the custom port in .ssh/config on my local machine and
can successfully ssh into the server using this file.

Host gitorious
Hostname mygitoriousurl.com - (as defined by gitorious_host: in
config/gitorious.yml)
Port XXXX - my custom port
User git

However when I try to clone from a repository which I've created via
the web interface I get an error which suggests that the gitorious
script is not passing on the repository address.

git clone gitorious:my-project-name/my-repository.git

fatal: 'my-project-name/my-repository.git': unable to chdir or not a
git archive
fatal: The remote end hung up unexpectedly

I don't fully understand how the gitorious script handles
authentication so I'm not sure where to start looking to solve this.
The log files don't show any errors. I know that the ssh side of
things is working because 'ssh gitorious' logs me onto the server as
the git user. And I know that the repository exists. I just don't seem
to be able to access it via the url issued by the gitorious web
interface.

Any suggestions much appreciated.

Peter Kjellerstedt

unread,
Aug 30, 2010, 3:32:12 AM8/30/10
to gito...@googlegroups.com

If you do "ssh git@gitorious" you are supposed to get something
like this:

PTY allocation request failed on channel 0
Need SSH_ORIGINAL_COMMAND
Connection to gitorious closed.

Which indicates that Gitorious has answered the ssh request.
If you instead get a login prompt for the git user it probably
means that you have not registered any ssh key with you gitorious
account yet.

//Peter

desaperados

unread,
Aug 30, 2010, 9:40:46 AM8/30/10
to Gitorious
Many thanks for the reply.

I actually figured out the problem as I was waking up this morning, as
is often the case - the solution comes when you least expect it:) -
and then switched on my computer to find it confirmed here.

I hadn't fully understood how gitorious intercepts ssh requests. When
I realised that it was happening in the .ssh/authorized_keys file then
the light came on. I checked the authorized_keys file and found that
my public key had been added in the usual way before I installed
gitorious so that the gitorious command="" entry came further down in
the file and wasn't being recognised. I removed the earlier duplicate
key and everything started working.

And everything became clear.

Dave


On Aug 30, 8:32 am, Peter Kjellerstedt <peter.kjellerst...@axis.com>
wrote:
Reply all
Reply to author
Forward
0 new messages