Actions

Developer Area/Contributing Code/Troubleshooting your Gerrit connection

From Mahara Wiki

< Developer Area‎ | Contributing Code
Revision as of 15:13, 13 November 2015 by Aaronw (talk | contribs) (wip)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Troubleshooting your Gerrit connection

This page contains instructions to help you troubleshoot your connection to the Mahara gerrit site, https://reviews.mahara.org . This page may be helpful if you've been following the instructions on these pages but receiving errors:

These instructions assume you are using Ubuntu Linux. They will probably be almost equally applicable to any type of Linux, somewhat helpful in Unix or Mac OS X, and of limited help in Windows.

Step 1: git fetch

The first step to figuring out what's wrong with your connection to gerrit is to run this command. It should be run in your terminal, while in the directory where your Mahara git repository is located.

git fetch

If this is successful, you will see output similar to this, fetching the list of branches from Gerrit.

From ssh://reviews.mahara.org:29418/mahara
 * [new branch]      1.0_STABLE -> gerrit/1.0_STABLE
 * [new branch]      1.10_STABLE -> gerrit/1.10_STABLE
 * [new branch]      1.1_STABLE -> gerrit/1.1_STABLE
 * [new branch]      1.2_STABLE -> gerrit/1.2_STABLE
 * [new branch]      1.3_STABLE -> gerrit/1.3_STABLE
 * [new branch]      1.4_STABLE -> gerrit/1.4_STABLE
 * [new branch]      1.5_STABLE -> gerrit/1.5_STABLE
 * [new branch]      1.6_STABLE -> gerrit/1.6_STABLE
 * [new branch]      1.7_STABLE -> gerrit/1.7_STABLE
 * [new branch]      1.8_STABLE -> gerrit/1.8_STABLE
 * [new branch]      1.9_STABLE -> gerrit/1.9_STABLE
 * [new branch]      15.04_STABLE -> gerrit/15.04_STABLE
 * [new branch]      15.10_STABLE -> gerrit/15.10_STABLE
 * [new branch]      master     -> gerrit/master

If you see that, then you're able to pull successfully. If you see an error, see if it's one of these:

fatal: not a git repository

Do you see this error when you do git fetch?

fatal: Not a git repository (or any parent up to mount point /var)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

This indicates that you're not running the git command in the location where your mahara git repository is located. The mahara repo will be a directory sitting inside the directory where you did the "git clone" command earlier. It will be named "mahara" unless you renamed it. It will have an "invisible" directory called ".git" in it, which you can see if you run the command "ls -a" while in the directory.

  • If you are following the instructions on the Developer Environment setup page, then your Mahara git repository will be the directory ~/code/mahara. The ~ is a linux shortcut for your home directory; e.g. /home/YOURUSERNAME.
  • If you are following the Developer Area/Contributing Code instructions, we don't specifically tell you where to put your Mahara codebase, so you'll need to remember where you checked it out, find it, or just check out a new copy.

Finding your local Mahara repo

(If you are very new to working with the command-line, it may be helpful to you to know that you can use the cd command to move around into different directories, and cd .. to move into the parent directory of your current directory, and pwd to print your current directory.)

The easiest way to search for Mahara's location on your computer is to use the find command, which will search the files on your computer in real-time. This can take a long time if you search your entire hard drive, so it is best to limit the search to a few specific likely locations. Mahara contains two files called "mahara.php"; searching for those should show you where it's located. (I add "2> /dev/null" to the end of the command to avoid warning messages about being unable to search private directories.)

find ~ /var/www /Library/WebServer /srv/www -name "mahara.php" -type f 2> /dev/null

If this is successful, then you'll see your Mahara directory. It'll be the directory which contains the "htdocs/lib/mahara.php" and "htdocs/lang/en.utf8/mahara.php"

aaronw@vegas:~$ find ~ /var/www /Library/WebServer /srv/www -name "mahara.php" -type f 2> /dev/null
/home/aaronw/code/mahara/htdocs/lib/mahara.php
/home/aaronw/code/mahara/htdocs/lang/en.utf8/mahara.php
# My mahara repo is /home/aaronw/code/mahara

If that doesn't work, then you may have put your Mahara repo somewhere unusual. You can try running find / -name "mahara.php" -type f 2> /dev/null to search your entire filesystem, but it may take several minutes. If you have root access, you can also try updating your "locate" index and using the locate command.

<source lang="bash"> aaronw@vegas:~$ sudo updatedb [sudo] password for aaronw: <enter your password>

  1. ... wait several minutes

aaronw@vegas:~$ locate mahara.php