Debugging Foreman

Occasionally I will have missed a bug, and you might see the following page when you click a link:

internalservererrorPlease raise a ticket and I’ll try and fix it – add a screenshot of the command line error you see and also what you did to create the error. However, if you’d like to try and debug this yourself, I suggest you turn on debug mode. The default config file has debug turned off but you can easily turn this on by changing┬ádebug = true. The config files are located at <foreman root>\foreman\config, and should have an entry┬álike this:

# Debugging options. Set to true if Foreman errors and you would like an interactive debugger.
debug = true

Restart the Foreman server with the edited config file, and now, instead of the page above, you will get an interactive Python debugger!


If you hover over one of the light blue lines, a little black command line icon in the right-hand corner will appear. Click on that and you can now type in Python to interact with Foreman. The best starting point is to type dump() which will show all the variables currently in use:


This should help in working out what is wrong. Usually Foreman is expecting a value and the variable is actually null (None in Python).

Happy bug hunting!


Foreman Forensics Blog

This will be a place for me to add some detailed posts on any Foreman features, common setup issues and how Foreman does the case management process. Hopefully a helpful blog to those using Foreman or those interested in what it looks like and what it can do.