Git file bridge not connecting to Bit Bucket


(Mitch Kerry) #1

**Matrix Version:**5.4.5.1

Hi

I’m following the instructions on setting up a git file bridge to a bit bucket repository using ssh but am getting the following error when cloning (after the spinning):

Error occurred when running git command “/usr/bin/git ls-remote ‘git@bitbucket.org:XXXX/XXXX.git’”: fatal: The remote end hung up unexpectedly

I’ve set the access key.
Am I missing something in the set up?

Thanks

Mitch


(Aleks Bochniak) #2

Can you log onto the host and try to clone that repo as a test?


(Mitch Kerry) #3

Aleks…we’re on a managed solution so can’t I access the host unfortunately.


(Bart Banda) #4

That might be because the Matrix server doesn’t have access to the bitbucker repo server.
Can you get/connect to it using something like REST asset to see if that connects?

If it’s hosted and managed by Squiz, I’d send a ticket in for the sys admins to take a look for you.


#5

Squiz Matrix v5.3.1.0

I am trying to do this on dev server. I confirm that I can do git clone on the dev server via command line but when adding this to Matrix and click Clone button, I got the following:

Error occurred when running git command "/usr/bin/git ls-remote 'git@bitbucket.org:xxx/yyy.git'": Host key verification failed.

, fatal: The remote end hung up unexpectedly

And if I ssh in and run the following command it works just fine:

/usr/bin/git ls-remote 'git@bitbucket.org:xxx/yyy.git'


(David Schoen) #6

Prior to Matrix 5.3.5.1/5.4.0.1 Matrix was not telling ssh to use a known_hosts file other than what’s set as default for the current unix user.

Assuming your Matrix installation is running as the apache user you could create a ~apache/.ssh/config file to work around the problem with this contents:

Host bitbucket.org
StrictHostKeyChecking no
BatchMode yes

Note: you will likely need to mkdir -p ~apache/.ssh before trying to create the file.

It’s generally nessasarry to reset permissions on the file and dir, e.g:

# chown -R apache.apache ~apache/.ssh
# chmod 0700 ~apache/.ssh
# chmod 0600 ~apache/.ssh/config

Edit: Just want to point out that this is only applicable to the Host key verification failed style of failure.