Tuesday 20 July 2010

Gitorious installation gotchas

Again I spent couple of days just setting up Gitorious. It's much easier than it used to be thanks to good instructions but still a bit of a pain. The part where most people hit the biggest problems is not setting up the site but repository creation phase which never seems to work on the first go. Here's a few hints on that:
  1. Double and triple check you have every package and gem installed and with correct version (config/environment.rb hardcodes versions for some gems). It's really easy to miss one package.
  2. Check that you have created all the directories required and that they are owned by the git user. tmp/pids is one nasty directory that is easy to forget.
  3. If you copy-paste stuff from the instructions, fix the quotation and other special characters! This one is extremely annoying, bit me again. Not only are the quotation marks anything but the ones required I spent a good hour figuring out why the poller wouldn't start. There was nothing in any log to suggest any problems, but it turned out one of the hyphens in the init script was in fact some odd character (an extended hyphen) that I just didn't pick up when looking at the script.
  4. I figured out that there was a problem with initialisation by the fact that tmp/pids had nothing in it. So check if there is. You can also do ps -ef | grep poller.
  5. You can also try to run the poller from the command line by giving "run" as a parameter. This will print any errors to the stdout.
  6. Logs that are of interest that you might want to check: anything in /var/www/gitorious/log, /var/www/gitorious/tmp/pids and /var/log/apache2 as well as /var/log/boot.log, /var/log/boot and /var/log/syslog. All of these might sometimes include clues to what went wrong.
  7. Check also that stompserver and git-daemon are running (ps -ef).
  8. Make absolutely sure that you have edited the correct section in the config files, it's easy to accidentally edit the development section instead of production.
  9. And finally, don't try to recreate a repo that failed because the poller wasn't running - doesn't work for me and I again spent an hour trying to find an error that wasn't. Test your setup by creating a completely new repository. I think this is a bug in Gitorious.

No comments:

Post a Comment