Git Commands Return Error Code 500

Problem

Git commands return error code 500 and the following can be seen in the atlassian-bitbucket.log:

 2016-01-28 08:38:01,201 ERROR [http-nio-7990-exec-9] 1651153 *4VVL4Bx518x66x0 127.0.0.1 "GET /scm/tis/teams.git/info/refs HTTP/1.1" c.a.s.i.s.g.p.h.GitSmartExitHandler TMS/teams[1]: Read request from 10.100.44.1 failed
The following was written to stderr:
git: 'http-backend' is not a git command. See 'git --help'.
com.atlassian.utils.process.ProcessException: Non-zero exit code: 1

Diagnose 

Running git http-backend on the server will also result in an error that http-backend is not a Git command.

Cause

Git was compiled from source the cURL libraries were not installed first.

Resolution

Option 1: 

Explicitly tell Bitbucket Server where to find git-http-backend, if it exists on the server. Find where the git-core directory lives and set the plugin.bitbucket-git.path.libexec property in bitbucket.properties. For example, git-core may live at one of the following locations:

  • /usr/libexec/git-core
  • /usr/local/libexec/git-core
  • /usr/lib/git-core

A search for git-http-backend should help confirm where this directory is located. Once found, specify the directory that contains git-core. So for example, if we determine that git-core lives at /usr/local/libexec/git-core, we'd set the following in bitbucket.properties:

 plugin.bitbucket-git.path.libexec=/usr/local/libexec

bitbucket.properties will be found in the shared folder of your $BITBUCKET_HOME directory. If it doesn't exist you will have to create it there with the above line. This change will require a restart of Bitbucket. See Bitbucket Server config properties for more information.


Option 2

Place /usr/local/libexec/git-core in the $PATH for the Bitbucket user.

Last modified on Nov 2, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.