This project is archived and is in readonly mode.

#2941 ✓stale
Joshua White

2.3.3 fcgi problem

Reported by Joshua White | July 22nd, 2009 @ 10:22 PM | in 2.x

I am hosting on Bluehost who just cowboyed through a update to 2.3.2, then the next day to 2.3.3. I got everything working fine in 2.3.2, but the 2.3.3 is just not happening.

Now there is this error coming from the fastcgi.crash.log on all my accounts there. They are usually pretty good about getting all the software updated properly. I am thinking it may be a rack/rails/fcgi issue. Has anyone else run into this using fcgi and rails 2.3.3.... the changlog mentions

[22/Jul/2009:14:43:49 :: 5136] Dispatcher failed to catch: uninitialized constant Rack::Handler::FastCGI (NameError) /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:440:in load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:inconst_missing' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:103:in process_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:153:inwith_signal_handler' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:101:in process_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:78:inprocess_each_request' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:117:in session' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:104:ineach_request' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:36:in each' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:77:inprocess_each_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:76:in catch' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:76:inprocess_each_request' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:51:in process!' /usr/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/fcgi_handler.rb:23:inprocess!' dispatch.fcgi:24

Here is the apache info
Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

Comments and changes to this ticket

  • Joshua White

    Joshua White July 22nd, 2009 @ 11:25 PM

    I found a workaround, it took me installing rails local gems, then I had to modify the file...

    rack-1.0.0/lib/rack/handler/fastcgi.rb
    And comment out the alias line, line 7

    alias _rack_read_without_buffer read

    Then kill my fcgi process and reload.

    .............. what does this line mean? ...?

    I also realized the error that truly describes the problem is this ... The error above comes after this error, but the fcgi process doesn't kill so thereafter it gives the above error because the Rack::Handler::FastCGI breaks down.

    [22/Jul/2009:16:18:36 :: 28096] starting [22/Jul/2009:16:18:36 :: 28096] Dispatcher failed to catch: undefined method read' for classFCGI::Stream' (NameError) /home1/jibwacom/.gem/ruby/1.8/gems/rack-1.0.0/lib/rack/handler/fastcgi.rb:7 /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:103:in process_request' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:153:inwith_signal_handler' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:101:in process_request' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:78:inprocess_each_request' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:117:in session' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:104:ineach_request' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:36:in each' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:77:inprocess_each_request' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:76:in catch' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:76:inprocess_each_request' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:51:in process!' /home1/jibwacom/.gem/ruby/1.8/gems/rails-2.3.2/lib/fcgi_handler.rb:23:inprocess!' dispatch.fcgi:24

  • Nathan Reckart

    Nathan Reckart July 23rd, 2009 @ 06:06 PM

    My apps died on Bluehost as well, with the same error as above.

    I agree, there is a bug in the rack 1.0.0 gem; however, instead of commenting out the line where the error occurs, I believe the line needs to be moved to just after the 'read' method definition. It's trying to alias a method before it's defined.

    So instead of:

    class FCGI::Stream
    alias _rack_read_without_buffer read

    def read(n, buffer=nil)

    buf = _rack_read_without_buffer n
    buffer.replace(buf.to_s)  if buffer
    buf
    

    end
    end

    It should be:

    class FCGI::Stream
    def read(n, buffer=nil)

    buf = _rack_read_without_buffer n
    buffer.replace(buf.to_s)  if buffer
    buf
    

    end

    alias _rack_read_without_buffer read end

    Once I installed the gem locally, modified it, and told my apps to use the local gem instead of the global system gem, my apps work fine again.

  • Joshua White

    Joshua White July 23rd, 2009 @ 08:17 PM

    I did the same thing on 4 of my rails sites and they all seem fine. Does mean we need to submit a patch?

  • Nathan Reckart

    Nathan Reckart July 23rd, 2009 @ 09:24 PM

    I sent a message to the Rack mailing list since this is a Rack issue.

    http://groups.google.com/group/rack-devel

  • Ron Barry

    Ron Barry July 25th, 2009 @ 08:30 AM

    I've tried just about everything I can find on this issue:

    • Editing ruby/gems/gems/rack-1.0.0/lib/rack/handler/fastcgi.rb to comment out the read alias, moving the read alias to after the read def.
    • Generating new rails apps with -D and copying their dispatchers (which turned out to be identical to the ones I had) into my existing app.
    • Every permutation of .htaccess I can find referred to by bluehost.

    The closest I've come, after seeing the Dispatcher failed to catch: undefined method read' for classFCGI::Stream' error, was when I switched from development to production. I don't know if the error I'm getting is a step forward or backward, but "require 'zip/zipfilesystem'" is causing fastcgi to puke:

    ......:in gem_original_require': no such file to load -- zip/zipfilesystem (MissingSourceFile)

    I have long since installed rubyzip in my local gems folder and I've checked that the permissions are open.

    I don't know if my issues are related or not, but I have the same code running on a different bluehost domain (still on 2.2.2) that is still working perfectly. After three hours of screwing around with this, I'm pretty annoyed.

  • nuttao

    nuttao July 28th, 2009 @ 07:00 AM

    I think it's problem of rails 2.3.3 and fcgi or other server's configuration with the last rails version.
    I don't have the recommended solutions for rails 2.3.3 on bluehost but if your app doesn't need to use rails 2.3.3. I have the easy solutions

    concepts
    - set your bluehost domain to be able to use local gem that you want to install. - and install gems that you want (my case is rails 2.2.2) - and config your app to use that gems in environtment.rb

    by follow this steps : http://sink.thinnnk.com/2008/11/30/how-do-i-install-my-own-gems

    This solutions doesn't good for only this case but, it's make me can have 'my gems' and not to worry about bluehost changes with rails.

  • Nathan Reckart

    Nathan Reckart July 28th, 2009 @ 09:41 PM

    I notified Bluehost about this issue. They replied and pointed me at
    the this blog post.

    It basically does the same thing as I mention in my previous message
    above. This appears to be their official method for fixing the error.

  • Nathan Reckart

    Nathan Reckart July 28th, 2009 @ 09:42 PM

    Ok, well my previous message didn't work out so well. Let's try again.

    I notified Bluehost about this issue. They replied and pointed me at the the following URL:

    http://www.bluehosttricks.com/2009/07/23/bluehost-hostmonster-and-f...

    It basically does the same thing as I mention in my previous message above. This appears to be their official method for fixing the error.

  • Michael Koziarski

    Michael Koziarski August 3rd, 2009 @ 06:00 AM

    • Tag changed from 2.3.3, crash, fcgi to 2.3.3, bugmash, crash, fcgi
  • Rizwan Reza

    Rizwan Reza January 20th, 2010 @ 10:53 AM

    • State changed from “new” to “stale”
    • Tag changed from 2.3.3, bugmash, crash, fcgi to 2.3.3, crash, fcgi

    Please update the ticket if this isn't solved yet.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages