Skip to content

Instantly share code, notes, and snippets.

@kjellski
Created November 28, 2013 13:20
Show Gist options
  • Save kjellski/7691736 to your computer and use it in GitHub Desktop.
Save kjellski/7691736 to your computer and use it in GitHub Desktop.
gitorious documentation improvement for resque debugging...

debugging in gitorious

In case you're experiencing any errors or unexpected behaviour, these are stept to follow in order to narrow down the problem. The goal is to get the most out of your system that would help the developers to identify the problem and help you fixing your problem.

is the problem reproducable?

This is the most important question you should be able to answer. If not, it's really hard to help. If it is not happening all the time, more like "every now and then", try to document what happened before, each time something unexpected happens, write it down. Collects all informations arround the event that should succeed, but does not.

Try to answer these questions:

What steps will reproduce the problem?

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information too.

how to debug a problem that is caused by resque

reque is the background worker of gitorious, it's used to do all the things that are not directly tied to the webfrontend of gitorious. In case you notice that something fails because external conditions are not proceeding as they shoul, e.g. a ssh-key is entered and saved correctly into the database, but the ready X is staying on the website. This normally means that the key is not getting inserted in the gitorious_installation_path/.ssh/authorized_keys (gitorious_installation_path path is normally /var/www/gitorious/) and is a job that is done by resque.

First off, make sure resque is running, by typing on the command line:

ps -efww | grep resque | grep -v grep | wc -l ⏎
1

If the command above, doesn't return the 1, resque is not runnning. Try restarting your gitorious host and rerun the command when everything is up. If it won't show 1, resque is not getting started and that is most likely your problem.

In order to find out what's going wrong inside of resque, you can ask the actually running resque system by firing up a rails console like this:

cd <gitorious_installation_path>/app/ ⏎          # normally /var/www/gitorious 
sudo -u git RAILS_ENV=production script/console ⏎

You'll get a console into you running rails app and will be able to inspect certain information, but be careful to not delete or modify things. Remember, this is about debugging, not fixing.

Into the console, have a look wether Resque is known as running to your rails app:

>> Resque ⏎
=> Resque Client connected to redis://localhost:6379/0 

That tells you that Resque is up and running, so something inside is wrong. Have a look at the Failures inside of resque like this:

>> Resque::Failure.all ⏎
=> nil 

If instead of that => nil a list of errors is shown, read the message of them carefully and try to figure out what they tell you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment