1891: KeyError

getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
chipx86
chipx86
Nov. 24, 2010
What version are you running?
ReviewBoard-1.5.1
Python-2.7


What is the expected output? What do you see instead?
I installed the reviewboard by the steps descripted in http://www.reviewboard.org/docs/manual/dev/admin/installation/linux/.
But when open the root url which be configured at the configuration file of apache, i received the error message of 500. So, i open the debug , you can got the trace message from attached file.

I will be very appreciate if anybody could help me.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta name="robots" content="NONE,NOARCHIVE">
  <title>KeyError at /</title>
  <style type="text/css">
    html * { padding:0; margin:0; }
    body * { padding:10px 20px; }
    body * * { padding:0; }
    body { font:small sans-serif; }
    body>div { border-bottom:1px solid #ddd; }
    h1 { font-weight:normal; }
    h2 { margin-bottom:.8em; }
    h2 span { font-size:80%; color:#666; font-weight:normal; }
    h3 { margin:1em 0 .5em 0; }
    h4 { margin:0 0 .5em 0; font-weight: normal; }
    table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; }
    tbody td, tbody th { vertical-align:top; padding:2px 3px; }
    thead th { padding:1px 6px 1px 3px; background:#fefefe; text-align:left; font-weight:normal; font-size:11px; border:1px solid #ddd; }
    tbody t
chipx86
#1 chipx86
You don't have any sort of PATH set for the user running Apache.

What distro is this?

You may have to set a PATH in your Apache config file, pointing it to /bin:/usr/bin:/usr/local/bin
  • +NeedInfo
#2 getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Thank chipx86, for your quickly reply.
But the PATH for the user running Apache had been pointing to /bin:/usr/bin:/usr/local/bin
. 

#3 getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
and the reviewboard is been installed by easy-install
chipx86
#4 chipx86
Regardless, Apache, or the process Apache launches for handling the Python code for Review Board, isn't seeing the PATH variable in the environment.

Is this using mod_python, wsgi, or fastcgi?
#5 getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
It is using fastcgi
chipx86
#6 chipx86
You may need to modify your reviewboard.fcgi file then and specifically set the environment in it. Then restart Apache or kill off your existing reviewboard.fcgi processes and try again.
#7 getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Yeah, it works. 
Thanks very much. 
chipx86
#8 chipx86
Glad it works :)
  • -NeedInfo
    +SetupIssue
  • +chipx86
#9 getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
The error of KeyError disappeared after set PATH to reviewboard.fcgi, but the system got 404 error when request 500.html which happens when add repository.
#10 getin*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Attached the config files 
  • +
    # Site-specific configuration settings for Review Board
    # Definitions of these settings can be found at
    # http://docs.djangoproject.com/en/dev/ref/settings/
    # Database configuration
    DATABASE_ENGINE = 'sqlite3'
    DATABASE_NAME = '/home/ting/reviewboard/data/reviewboard.db'
    # Unique secret key. Don't share this with anybody.
    SECRET_KEY = '*b2p+v2@6#e)x9r5hug16ej97b6x=gp=7w*wu91=q=*#@!ofjq'
    # Cache backend settings.
    CACHE_BACKEND = 'memcached://localhost:11211/'
    # Extra site information.
    SITE_ID = 1
    SITE_ROOT = '/'
    FORCE_SCRIPT_NAME = ''
    DEBUG = True
    +
    #
    # Based upon the NCSA server configuration files originally by Rob McCool.
    #
    # This is the main Apache server configuration file.  It contains the
    # configuration directives that give the server its instructions.
    # See <URL:http://httpd.apache.org/docs/2.0/> for detailed information about
    # the directives.
    #
    # Do NOT simply read the instructions in here without understanding
    # what they do.  They're here only as hints or reminders.  If you are unsure
    # consult the online docs. You have been warned.  
    #
    # The configuration directives are grouped into three basic sections:
    #  1. Directives that control the operation of the Apache server process as a
    #     whole (the 'global environment').
    #  2. Directives that define the parameters of the 'main' or 'default' server,
    #     which responds to requests that aren't handled by a virtual host.
    #     These directives also provide default values for the settings
    #     of all virtual hosts.
    #  3. Settings for virtual hosts, which allow Web reque
    +
    <IfModule mod_fcgid.c>
    	AddHandler fcgid-script .fcgi
    </IfModule>
    <IfModule mod_fastcgi.c>
    	AddHandler fastcgi-script .fcgi
    	FastCGIServer "/home/ting/reviewboard/htdocs/reviewboard.fcgi" -socket "/home/ting/reviewboard/tmp/fastcgi.sock"
    </IfModule>
    <VirtualHost *:1180>
    	ServerName localhost
    	DocumentRoot "/home/ting/reviewboard/htdocs"
    	# Alias static media requests to filesystem
    	Alias /media "/home/ting/reviewboard/htdocs/media"
    	Alias /errordocs "/home/ting/reviewboard/htdocs/errordocs"
    	# Error handlers
    	ErrorDocument 500 /errordocs/500.html
    	<Directory "/home/ting/reviewboard/htdocs">
    		AllowOverride All
    	</Directory>
    	# Direct all other requests to the fastcgi server
    	RewriteEngine on
    	<IfModule mod_fcgid.c>
    		RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
    		RewriteRule ^/(docs.*)$ /$1 [QSA,L,PT]
    	</IfModule>
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteRule ^/(.*)$ /reviewboard.fcgi/$1 [QSA,L]
    </VirtualHost>
    +
    #!/usr/bin/env python
    import os, sys
    sys.path.insert(0, "/home/ting/reviewboard/conf")
    os.environ["DJANGO_SETTINGS_MODULE"] = "reviewboard.settings"
    os.environ["PYTHON_EGG_CACHE"] = "/home/ting/reviewboard/tmp/egg_cache"
    os.environ["HOME"] = "/home/ting/reviewboard/data"
    os.environ["PATH"] = "/usr/kerberos/bin:/usr/bin:/bin:/usr/local/bin:/bin:/usr/X11R6/bin:/home/ting/bin:/home/ting/bin/python/bin:/home/ting/reviewboard/conf"
    from django.core.servers.fastcgi import runfastcgi
    runfastcgi(method="threaded", daemonize="false")
chipx86
#11 chipx86
Hi Ting,

I recommend e-mailing reviewboard@googlegroups.com with a link to this ticket and a description of the problem. Very few people other than me monitor the tickets, but there are hundreds of admins on the mailing list.