Post
Topic
Board Beginners & Help
Re: [ANNOUNCE] Abe 0.7: Open Source Block Explorer Knockoff
by
nxtar
on 21/05/2014, 04:30:44 UTC
I have tried all I know to get the fcgi module working under apache 2.4.7 Ubuntu 14.04

Here is my /etc/apache2/sites-available/abe.conf
Code:

        ServerName chain.distroblitz.co.in
        Alias /static/ /usr/local/lib/python2.7/dist-packages/Abe/htdocs
        Alias /robots.txt /usr/local/lib/python2.7/dist-packages/Abe/htdocs/robots.txt
        Alias /favicon.ico /usr/local/lib/python2.7/dist-packages/Abe/htdocs/favicon.ico
        Alias / /usr/lib/cgi-bin/abe.fcgi

       
        Order allow,deny
        Allow from all
        Require all granted
       

       
        Order allow,deny
        Allow from all
        Require all granted
       

        # Raise this if you get server errors mentioning "mod_fcgid:
        # read data timeout in 40 seconds"
        #FcgidIOTimeout 40

        # Uncomment to log Abe requests.
        ErrorLog /var/log/abe_error.log
        LogLevel info
        CustomLog /var/log/abe_access.log combined



I have checked filesystem permissions and I am able to run the fcgi with
Code:
sudo -u www-data /usr/lib/cgi-bin/abe.fcgi
The output when run from the command line generates errors which I assume are caused by not running it with fcgi
Code:
Abe initialized.
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py", line 558, in run
    protocolStatus, appStatus = self.server.handler(self)
  File "/usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py", line 1118, in handler
    result = self.application(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/Abe/abe.py", line 191, in __call__
    if fix_path_info(env):
  File "/usr/local/lib/python2.7/dist-packages/Abe/abe.py", line 2059, in fix_path_info
    if pi[-1] != '/' and env['PATH_INFO'][-1] == '/':
IndexError: string index out of range
Content-Type: text/html




 

 
<type 'exceptions.IndexError'>
>
>Python 2.7.6: /usr/bin/python
Wed May 21 00:27:41 2014


A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.









 /usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py in run(self=<flup.server.fcgi_base.CGIRequest object>)
    556         """Runs the handler, flushes the streams, and ends the request."""

    557         try:

=>  558             protocolStatus, appStatus = self.server.handler(self)

    559         except:

    560             traceback.print_exc(file=self.stderr)

protocolStatus undefined, appStatus undefined, self = <flup.server.fcgi_base.CGIRequest object>, self.server = [Suspicious link removed]GIServer object>, self.server.handler = <bound method WSGIServer.handler of [Suspicious link removed]GIServer object>>








 /usr/lib/python2.7/dist-packages/flup/server/fcgi_base.py in [Suspicious link removed]GIServer object>, req=<flup.server.fcgi_base.CGIRequest object>)
   1116         try:

   1117             try:

=> 1118                 result = self.application(environ, start_response)

   1119                 try:

   1120                     for data in result:

result = None, self = [Suspicious link removed]GIServer object>, self.application = <__main__.Abe instance>, environ = {'HOME': '/root', 'LANG': 'en_US.UTF-8', 'LOGNAME': 'distroblitz', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:d...*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'MAIL': '/var/mail/distroblitz', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PATH_INFO': '', 'PWD': '/home/distroblitz', 'PYTHONUNBUFFERED': '1', 'QUERY_STRING': '', ...}, start_response = <function start_response>








 /usr/local/lib/python2.7/dist-packages/Abe/abe.py in __call__(abe=<__main__.Abe instance>, env={'HOME': '/root', 'LANG': 'en_US.UTF-8', 'LOGNAME': 'distroblitz', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:d...*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'MAIL': '/var/mail/distroblitz', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PATH_INFO': '', 'PWD': '/home/distroblitz', 'PYTHONUNBUFFERED': '1', 'QUERY_STRING': '', ...}, start_response=<function start_response>)
    189             page['params'] = urlparse.parse_qs(env['QUERY_STRING'])

    190 

=>  191         if fix_path_info(env):

    192             abe.log.debug("fixed path_info")

    193             return redirect(page)

global fix_path_info = <function fix_path_info>, env = {'HOME': '/root', 'LANG': 'en_US.UTF-8', 'LOGNAME': 'distroblitz', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:d...*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'MAIL': '/var/mail/distroblitz', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PATH_INFO': '', 'PWD': '/home/distroblitz', 'PYTHONUNBUFFERED': '1', 'QUERY_STRING': '', ...}








 /usr/local/lib/python2.7/dist-packages/Abe/abe.py in fix_path_info(env={'HOME': '/root', 'LANG': 'en_US.UTF-8', 'LOGNAME': 'distroblitz', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:d...*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'MAIL': '/var/mail/distroblitz', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PATH_INFO': '', 'PWD': '/home/distroblitz', 'PYTHONUNBUFFERED': '1', 'QUERY_STRING': '', ...})
   2057     pi = env['PATH_INFO']

   2058     pi = posixpath.normpath(pi)

=> 2059     if pi[-1] != '/' and env['PATH_INFO'][-1] == '/':

   2060         pi += '/'

   2061     if pi == env['PATH_INFO']:

pi = '.', env = {'HOME': '/root', 'LANG': 'en_US.UTF-8', 'LOGNAME': 'distroblitz', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:d...*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'MAIL': '/var/mail/distroblitz', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'PATH_INFO': '', 'PWD': '/home/distroblitz', 'PYTHONUNBUFFERED': '1', 'QUERY_STRING': '', ...}

<type 'exceptions.IndexError'>: string index out of range

      args =
('string index out of range',)

      message =
'string index out of range'




any advice is greatly appreciated