Repository

This page contains solutions to common issues encountered while connecting and configuring git repositories.

Use the FAQ below to find answers to common questions.  Feel free to contact our support team (support@bigbrassband.com) if you don't see what you're looking for.

Repository Questions

  1. I have an existing git repository on a Jira server.  How can I figure out what values should be used for repository origin and repository root fields?
  2. Where is the location of the local git repository?
  3. How do you configure the Repository Root which is not located in a Jira home directory with Git Integration for Jira?
  4. I use GitLab.  Is there a special utility to export repository configuration to connect all its repositories to Jira?
  5. I get the following error: "Host or port specified in <git_repository_url> are inaccessible". Do I also need a git instance on the Jira server?
  6. We use GitBlit without SSH keys and use only HTTPS instead.  Does Git Integration Plugin for Jira support this?
  7. I am using Jira which is hosted on Windows.  I changed the password of the Active Directory account running Jira.  Now, I cannot access my repository.  Why?
  8. Why I am getting the error, "git-upload-pack not permitted"?

Repository Questions

1. I have an existing git repository on a Jira server.  How can I figure out what values should be used for repository origin and repository root fields?
  1. Change current directory to the folder where repository is located.
  2. Run pwd.
  3. Response should go to repository root field.
  4. Run git remote show origin.
  5. Find origin url in command response.
  6. Set this value for repository origin field.
2. Where is the location of the local git repository?

The Repository Root (in settings) must be a local path for server which is used to run Jira.

In other words, the plugin must point to a clone of the repository and this clone must run locally with Jira.

Update/edit repository screen
3. How do you configure the Repository Root which is not located in a Jira home directory with Git Integration for Jira?

There are three possible ways to do this:

  • Clone the repository outside of Jira then connect to it via Connect to Git Repository  >  Advanced Setup.
  • Clone the repository with the standard Connect to Git Repository Wizard into the Jira home directory.  Soon afterwards, move the cloned repository and update the settings on the repository.
  • You could symlink the {$Jira_HOME}/data/git-plugin directory to a different volume.  The standard Connect to Git Repository Wizard will still write there, but the data will reside on the different volume.  But be aware, that the Git add-on treats anything in the Git-Plugin folder as a clone that it owns.
4. I use GitLab.  Is there a special utility to export repository configuration to connect all its repositories to Jira?

There's a utility that helps GitLab users export repository settings from GitLab server.  Get the JAR file and follow instructions at GitLab to TSV.  Requires Git Integration Plugin for Jira to work.

This utility will create a TSV import file which can be imported via Bulk Change feature of the Git Integration Plugin for Jira.

How to import a TSV file generated from this utility:

GitLab to TSV, how to
5. I get the following error: "Host or port specified in <git_repository_url> are inaccessible". Do I also need a git instance on the Jira server?

If your Jira and Git servers are running through a firewall, configure the firewall to allow access using the URL schemes for git repositories.  For authentication issues, make sure to check first the correct port for its connection.

Below are the default ports for common git URL protocols:

Protocol Default port
ssh:// port 22
git:// port 9418
http:// port 80
https:// port 443

Test git connection and repository URL by doing the following:

  1. Install git client (or run sudo apt-get install git)
  2. Place your ssh key into ~/.ssh
  3. Clone the repository (or run git clone <your_repository_url>)
The Git Integration for Jira will run successfully if the above connection test ran without errors.
6. We use GitBlit without SSH keys and use only HTTPS instead.  Does Git Integration Plugin for Jira support this?

Yes. The Git add-on definitely supports GitBlit via HTTPS authentication.  Use the Connect to Git Repository wizard to connect to your repositories.  Towards the end of the process, a username and password will be required for connection authentication.

7. I am using Jira which is hosted on Windows.  I changed the password of the Active Directory account running Jira.  Now, I cannot access my repository.  Why?

When using Active Directory accounts for repository access, changing the password of the AD account running Jira can cause repository authentication issues.

You need to restart Jira to regain access to repositories.

8. Why I am getting the error, "git-upload-pack not permitted"?

You are getting this error because of wrong login credentials or a permission issue.

Having Invalid Credentials

The most common cause is a wrong login credentials input.

Go to Git Repositories configuration list.  Select Actions on a particular repository then Edit Repository:

Edit a repository/tracked folder/connected server

Check the repository properties for the Username and Password fields and verify that they are filled with correct values.  Retype login credentials just to make sure and save the settings.

Not Having Enough Access Permissions

The other cause is not having enough access permissions to clone repositories.  Try to clone a repository via the git client console using the correct <JIRA_user> on a Jira server.  If an error is raised, the Git for Jira add-on will also do the same.

To install Git Integration for Jira add-on and clone a repository:

  1. Go to your Jira server.
  2. Install the git client: sudo apt-get install git or sudo yum install git.
  3. Verify the correct <JIRA_user> (Go to Jira Administration > System > System Info. Scroll to User Name. How?).
  4. Re-login as <JIRA_user>
  5. Run git clone http://<your-repo>/

The command should be successful.  If not, ask your administrator to setup your environment.

Using Proxies

If you are using proxy, configure your Jira with the following parameter format:

Dhttp.proxyHost=<your-proxy-host>
Dhttps.proxyHost=<your-proxy-host>
Dhttp.proxyPort=<your-proxy-port>
Dhttps.proxyPort=<your-proxy-port>
Dhttp.proxyUser=*****
Dhttps.proxyUser=*****
Dhttp.proxyPassword=*****
Dhttps.proxyPassword=*****
Dhttp.=*.some.mask|localhost|1.1.1.1<someIP>
Dhttps.=.some.mask|localhost|1.1.1.1<someIP>

Enter <your-git-server-host> to nonProxyHosts entries.

Examining Logs and Errors

To get a better view of the cause of the error:

  1. See the debug logs of the jgit library in Jira generated during cloning/re-indexing of your repository.
  2. Enable debug logging for jgit library in Jira:
    • Go to Administration > System.
    • On the sidebar, under Troubleshooting and Support, select Logging & Profiling.
    • Scroll down to the Default Loggers section, then click Configure.
    • Enter org.apache.http for Package Name then set Logging Level to DEBUG.
    • Click Add to add this configuration to the Debug Loggers list.
    Collect logs generated during reindex of your repository:
    • Write down the current time right before doing a reindex – let's call it time1.
    • Do a reindex for your repository via Git Integration for JIRA > Git Repositories.
    • After the reindex is complete, write down the current time – let's call it time2.
    • Collect logs created between time1 and time2.
  3. See the verbose logs of successful clone of your repository cloned by the console git client.
    • From the command line, run set GIT_CURL_VERBOSE=1
    • Do a git clone of the affected repository git clone http://<your-repo>.
    The output is a verbose log of this process.

Compare the debug and the verbose logs and see the difference between them or send us both logs to support@bigbrassband.com for in-depth review.

Examine used authentication schemes. If you are seeing Basic authentication, you can verify that the right login credentials are passed.

How to find supported authentication schemes?

Below is an example of the debug logs of the jgit library in JIRA generated during cloning/re-indexing of your repository:

...
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [http.impl.client.TargetAuthenticationStrategy] Authentication schemes in the order of preference: [Negotiate, Kerberos, NTLM, Digest, Basic]
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [http.impl.client.TargetAuthenticationStrategy] Challenge for Negotiate authentication scheme not available
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [http.impl.client.TargetAuthenticationStrategy] Challenge for Kerberos authentication scheme not available
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [http.impl.client.TargetAuthenticationStrategy] Challenge for NTLM authentication scheme not available
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [http.impl.client.TargetAuthenticationStrategy] Challenge for Digest authentication scheme not available
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [http.client.protocol.RequestAddCookies] CookieSpec selected: default
...

In this case, the Basic authentication was used because all other authentication methods have been rejected.

How to find login credentials used in Basic authentication?

Below is another example of the debug logs of the jgit library in JIRA generated during cloning/re-indexing of your repository:

...
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> GET /<your-git-server-url>/<your-repo-name>.git/info/refs?service=git-upload-pack HTTP/1.1
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> Accept-Encoding: gzip
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> Pragma: no-cache
2016-10-24 19:46:21,504 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> User-Agent: JGit/unknown
2016-10-24 19:46:21,519 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> Authorization: Basic amlyYTpqaXJhcGFzc3dvcmQ=
2016-10-24 19:46:21,519 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> Accept: application/x-git-upload-pack-advertisement, */*
2016-10-24 19:46:21,519 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> Host: 123.123.123.123
2016-10-24 19:46:21,519 xiplink-gitplugin-RevisionIndexerImpl:thread - 0 DEBUG      [org.apache.http.headers] http-outgoing-9 >> Connection: Keep-Alive
...

From the above log:

  1. Find the header, Authorization.
  2. In the example it contains Basic amlyYTpqaXJhcGFzc3dvcmQ=, where amlyYTpqaXJhcGFzc3dvcmQ= is the login credentials encoded in base64. Decode the base64 string using any online decoder. Result: jira:jirapassword.
  3. Verify that jira is the expected username and jirapassword is the expected password.