Project

General

Profile

Quoting issue comments fails with Cherokee + spawn-fcgi

Added by Ismael Barros² over 10 years ago

I've got Redmine installed from hg's 2.5-stable branch, updated today, on a Debian 6 also up to date.

I have everything setup so it runs perfectly with WEBrick

sudo -u www-data script/rails server webrick -e production

However, when I setup Cherokee 1.0.8 to serve Redmine using spawn-fcgi 1.6.3 as data source, everything seems to workflawlessly except for issue comment quoting. When I press the "quote" littlle icon on any issue comment, on the browser I see this message:

POST http://redmine.xxxxxxx.com/issues/461/quoted?journal_id=16889 500 (Internal Server Error) 

And on the server:

/var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/handler/fastcgi.rb:11:in `_rack_read_without_buffer': unsupported version (FCGI::Stream::UnsupportedVersionError)
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/handler/fastcgi.rb:11:in `read'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/rewindable_input.rb:87:in `make_rewindable'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/rewindable_input.rb:28:in `read'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/request.rb:202:in `POST'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/methodoverride.rb:26:in `method_override'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/methodoverride.rb:14:in `call'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
        from /var/lib/gems/1.8/gems/activesupport-3.2.17/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
        from /var/lib/gems/1.8/gems/actionpack-3.2.17/lib/action_dispatch/middleware/static.rb:63:in `call'
        from /var/lib/gems/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
        from /var/lib/gems/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
        from /var/lib/gems/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
        from /var/lib/gems/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
        from /var/lib/gems/1.8/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
        from /var/lib/gems/1.8/gems/railties-3.2.17/lib/rails/engine.rb:484:in `call'
        from /var/lib/gems/1.8/gems/railties-3.2.17/lib/rails/application.rb:231:in `call'
        from /var/lib/gems/1.8/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `send'
        from /var/lib/gems/1.8/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /home/raziel/redmine-2.5/public/dispatch.fcgi:16:in `call'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/handler/fastcgi.rb:66:in `serve'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/handler/fastcgi.rb:28:in `run'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/handler/fastcgi.rb:27:in `each'
        from /var/lib/gems/1.8/gems/rack-1.4.5/lib/rack/handler/fastcgi.rb:27:in `run'
        from /home/raziel/redmine-2.5/public/dispatch.fcgi:20

On cherokee, I have three data sources configured as:

spawn-fcgi -n -d /home/raziel/redmine-2.5 -f /home/raziel/redmine-2.5/public/dispatch.fcgi -p 40448
spawn-fcgi -n -d /home/raziel/redmine-2.5 -f /home/raziel/redmine-2.5/public/dispatch.fcgi -p 40449
spawn-fcgi -n -d /home/raziel/redmine-2.5 -f /home/raziel/redmine-2.5/public/dispatch.fcgi -p 40450

Where /home/raziel/redmine-2.5/public/dispatch.fcgi is a copy of public/dispatch.fcgi.example

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../config/boot'
require File.dirname(__FILE__) + '/../config/environment'

class Rack::PathInfoRewriter
  def initialize(app)
    @app = app
  end

  def call(env)
    env.delete('SCRIPT_NAME')
    parts = env['REQUEST_URI'].split('?')
    env['PATH_INFO'] = parts[0]
    env['QUERY_STRING'] = parts[1].to_s
    @app.call(env)
  end
end

Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(RedmineApp::Application)

Does anyone know what could be wrong on my setup? What's up with this FCGI::Stream::UnsupportedVersionError error on this particular message, when the rest of Redmine works flawlessly?