Smart server fails: error reading data from FastCGI server

Asked by Václav Šmilauer

I am trying to setup a bzr smartserver atop Apache2 with the following configuration (simplified):

<VirtualHost *:80>
       # +ExecCGI is allowed
       # fcgid module handles *.fcgi files automatically
       DocumentRoot /some/path
       # in /some/path/bzr
       <Location "/bzr">
               RewriteEngine on
               RewriteBase /bzr
               # /some/path/bzr-smart.fcgi
               RewriteRule ^(.*/)?\.bzr/smart$ /bzr-smart.fcgi
        </Location>
</VirtualHost>

The file /some/path/bzr-smart.fcgi is the following:

    import trac.web._fcgi as fcgi # use the module packaged with
    from bzrlib.transport.http import wsgi

    smart_server_app = wsgi.make_app(
        root='/home/profesori/eudoxos/host/gpu/bzr',
        prefix='/bzr/',
        path_var='REQUEST_URI',
        readonly=True,
        load_plugins=True,
        enable_logging=True)

    fcgi.WSGIServer(smart_server_app).run()

Every time I test the configuration, I get

    $ bzr log bzr+http://mysite/bzr/branch
    bzr: ERROR: Generic bzr smart protocol error: Invalid http response for http://mysite/bzr/branch/.bzr/smart: Unable to handle http code 500: Internal Server Error

and in apache2's error.log:

   [Mon May 07 16:33:41 2012] [warn] [client 111.222.111.222] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
    [Mon May 07 16:33:41 2012] [error] [client 111.222.111.222] Premature end of script headers: bzr-smart.fcgi

Obviously, the script is run byt the fcgid module, but the execution somehow fails. How could I find out about the cause of that?

Thanks, Vaclav

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
John A Meinel (jameinel) said :
#1

I don't know the answer, but you might look at $HOME/.bzr.log for the web
server user to find the bzr server log files.

John
=:->
On May 7, 2012 4:45 PM, "Václav Šmilauer" <
<email address hidden>> wrote:

> New question #196349 on Bazaar:
> https://answers.launchpad.net/bzr/+question/196349
>
> I am trying to setup a bzr smartserver atop Apache2 with the following
> configuration (simplified):
>
> <VirtualHost *:80>
> # +ExecCGI is allowed
> # fcgid module handles *.fcgi files automatically
> DocumentRoot /some/path
> # in /some/path/bzr
> <Location "/bzr">
> RewriteEngine on
> RewriteBase /bzr
> # /some/path/bzr-smart.fcgi
> RewriteRule ^(.*/)?\.bzr/smart$ /bzr-smart.fcgi
> </Location>
> </VirtualHost>
>
> The file /some/path/bzr-smart.fcgi is the following:
>
> import trac.web._fcgi as fcgi # use the module
> packaged with
> from bzrlib.transport.http import wsgi
>
> smart_server_app = wsgi.make_app(
> root='/home/profesori/eudoxos/host/gpu/bzr',
> prefix='/bzr/',
> path_var='REQUEST_URI',
> readonly=True,
> load_plugins=True,
> enable_logging=True)
>
> fcgi.WSGIServer(smart_server_app).run()
>
> Every time I test the configuration, I get
>
> $ bzr log bzr+http://mysite/bzr/branch
> bzr: ERROR: Generic bzr smart protocol error: Invalid http response for
> http://mysite/bzr/branch/.bzr/smart: Unable to handle http code 500:
> Internal Server Error
>
> and in apache2's error.log:
>
> [Mon May 07 16:33:41 2012] [warn] [client 111.222.111.222]
> (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI
> server
> [Mon May 07 16:33:41 2012] [error] [client 111.222.111.222] Premature
> end of script headers: bzr-smart.fcgi
>
> Obviously, the script is run byt the fcgid module, but the execution
> somehow fails. How could I find out about the cause of that?
>
> Thanks, Vaclav
>
> --
> You received this question notification because you are an answer
> contact for Bazaar.
>

Can you help with this problem?

Provide an answer of your own, or ask Václav Šmilauer for more information if necessary.

To post a message you must log in.