Defect #7688

Redmine's trunk (rails 2.3.11) doesn't work with Mongrel 1.1.x

Added by Jean-Baptiste Barth almost 4 years ago. Updated over 2 years ago.

Status:ClosedStart date:2011-02-22
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Gems support
Target version:-
Resolution:Wont fix Affected version:

Description

I reproduce here Etienne's comment in #6887 (Rails upgrade) :

Note that Mongrel 1.1.5 does not work anymore with Rails 2.3.8 or later because of 2 bugs respectively in rack 1.1.x and Mongrel 1.1.5.

See ticket 4690 in Rails tracker and ticket 5 in Mongrel's.

Until Mongrel 1.2.0 is out, it is required to add a mongrel.rb initializer to config/initializers.

I can't reproduce with "mongrel + script/server", but I confirm "mongrel_rails" crashes, and I confirm the proposed initializer solves the problem on a development instance.

A few questions :
  • does anybody know if it affects Thin too ?
  • can anybody test it some days in production to see if it doesn't have any drawback ? There's no feedback on rails lighthouse tracker for the moment..

mongrel.rb Magnifier - mongrel.rb (2.83 KB) Giuseppe Lippolis, 2011-12-11 22:35


Related issues

Related to Feature #6887: Upgrade to Rails 2.3.11 Closed 2010-11-13
Related to Defect #8520: "Error 500" on login to a fresh Redmine 1.2.0 install Closed 2011-06-03

History

#1 Updated by Etienne Massip almost 4 years ago

I'm running it in production (low traffic, only 4-5 daily users) since this morning and had no problem until now.

Do you plan to commit it into config/initializers ?

I thought to simply add a HowTo when 1.2.0 is out...

#2 Updated by Jean-Baptiste Barth almost 4 years ago

Yes, I think we should add it to config/initializers so it will be transparent for users. Or we will have tons of support requests for this, and Rails ticket isn't an easy read for everybody...

#3 Updated by Ivan Cenov almost 4 years ago

Hmmmm..., Mongrel 1.1.5 is released on May 22, 2008. Is this project developed at all?

#4 Updated by Etienne Massip almost 4 years ago

Last commit is dated of July 24, 2010.

But it is still used.

#5 Updated by Ivan Cenov almost 4 years ago

Most Active This Week shows 96.90% activity.
On the other side, http://mongrel.rubyforge.org/svn/ does not respond just now.

Besides of this, I have installed patch_for_mongrel.rb that resolves what is described in this thread. This is related to Mongrel_rails service "--prefix" that does not work well with Rails 2.3.x.

Regarding this, are both patches mongrel.rb and patch_for_mongrel.rb compatible? Are both needed in Rails 2.3.11 ?

Note that I do not understand Ruby, Ruby on Rails and it is possibly that I do not describe these things exactly.

#6 Updated by Etienne Massip almost 4 years ago

Hit a bug with AJAX which I supposed is due to this path but not necessarily :

After some time of use, an AJAX request like parent task auto-complete lookup or adding a new category / version directly from the issue form will perform well but the next request (e.g. new parent task lookup or issue submission) will redirect the user to the login page (with a 401 "non authorized" HTTP error code).

As if last set cookie value was invalid.

#7 Updated by Patrice Bonhomme almost 4 years ago

Same for me since Redmine 1.1.2, when i try to add a relation between two issues. I am using Apache2/Passenger 2.2.8.

#8 Updated by Etienne Massip almost 4 years ago

See issue #7843 for latest comments.

#9 Updated by Etienne Massip over 3 years ago

  • Category set to Gems support

#10 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from New to Closed
  • Target version deleted (1.2.0)
  • Resolution set to Wont fix

#11 Updated by bo ye over 3 years ago

We use patch_for_mongrel.rb and mongrel.rb together, it is fine for now.

Ivan Cenov wrote:

Most Active This Week shows 96.90% activity.
On the other side, http://mongrel.rubyforge.org/svn/ does not respond just now.

Besides of this, I have installed patch_for_mongrel.rb that resolves what is described in this thread. This is related to Mongrel_rails service "--prefix" that does not work well with Rails 2.3.x.

Regarding this, are both patches mongrel.rb and patch_for_mongrel.rb compatible? Are both needed in Rails 2.3.11 ?

Note that I do not understand Ruby, Ruby on Rails and it is possibly that I do not describe these things exactly.

#12 Updated by Ivan Cenov over 3 years ago

bo ye wrote:

We use patch_for_mongrel.rb and mongrel.rb together, it is fine for now.

Ivan Cenov wrote:

Most Active This Week shows 96.90% activity.
On the other side, http://mongrel.rubyforge.org/svn/ does not respond just now.

Besides of this, I have installed patch_for_mongrel.rb that resolves what is described in this thread. This is related to Mongrel_rails service "--prefix" that does not work well with Rails 2.3.x.

Regarding this, are both patches mongrel.rb and patch_for_mongrel.rb compatible? Are both needed in Rails 2.3.11 ?

Note that I do not understand Ruby, Ruby on Rails and it is possibly that I do not describe these things exactly.

I am running now Redmine 1.2.0 and use mongrel.rb only and it seems all is OK. I never tried to see what would happen if both patches are in.

#13 Updated by Alfredo Bonilla over 3 years ago

Hi, I placed both files mongrel.rb and patch_for_mongrel.rb in /<my-redmine-path>/config/initializers/ plus rails_6440_patch.rb

and I'm still "redirected"... and mongrel fails (log:

Error calling Dispatcher.dispatch #<NoMethodError: undefined method `[]' for nil:NilClass>
/usr/lib/ruby/1.8/mongrel/cgi.rb:108:in `send_cookies'.....
)

Please, let me know if I'm missing something or doing something wrong!!):
Thx in advance

#14 Updated by Etienne Massip over 3 years ago

Did you restart your server ?

#15 Updated by Etienne Massip over 3 years ago

  • Assignee deleted (Jean-Baptiste Barth)

#16 Updated by Alfredo Bonilla over 3 years ago

Thanks for your answer Etienne... I found the problem... We did not install mongrel gems. We installed mongrel directly with apt-get.

The first IF in mongrel.rb patch asks for the RAILS version (2.3.11), ok... and for the GEM MONGREL 1.1.5... and, obviously, no gem, no condition satisfied... the patch was useless.

Now we are working without patch_for_mongrel.rb and without rails_6440_patch.rb.

#17 Updated by Etienne Massip over 3 years ago

Thanks for the clarification. I see a lot of trouble with Debian ruby gems packages...

#18 Updated by Sooraj B over 3 years ago

Hi,
I just got this issue again. But, when i tried to login from a different browser, it worked.
Failed to login from Ubuntu 10.04, Firefox 3.6.18
Logged in successfully from Chrome ( same pc)

#19 Updated by sword alone about 3 years ago

using this method , it works for me.
thks.

Alfredo Bonilla wrote:

Hi, I placed both files mongrel.rb and patch_for_mongrel.rb in /<my-redmine-path>/config/initializers/ plus rails_6440_patch.rb

and I'm still "redirected"... and mongrel fails (log: [...])

Please, let me know if I'm missing something or doing something wrong!!):
Thx in advance

#20 Updated by Giuseppe Lippolis about 3 years ago

I have same issue with redmine 1.3.0 . for fix it i have update mongrel.rb adding '2.3.14' to rails version on first line. I send fixed file as attached.

#21 Updated by Abhishek Singh over 2 years ago

  • Status changed from Closed to Reopened

I'm using redmine 1.3.2 and I'm also facing this problem. I'm using this on a CentOS 6.2 system with cpanel and mongrel installed from the repository. I tried putting mongrel.rb and patch_for_mongrel.rb in my <my_redmine_path>/config/initializers, but it didn't work. I tried other cases too like putting just mongrel.rb or just patch_for_mongrel.rb in the initializers, but all in vain. The error that I get in mongrel.log is:

Thu Mar 29 03:07:50 +0000 2012: Error calling Dispatcher.dispatch #<NoMethodError: private method `split' called for nil:NilClass>
<my_redmine>/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:52:in `dispatch_cgi'
<my_redmine>/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:101:in `dispatch_cgi'
<my_redmine>/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:27:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:159:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:282:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:281:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/bin/mongrel_rails:19:in `load'
/usr/bin/mongrel_rails:19

Any idea what might be causing this? Any solutions are welcome. Thank You.

#22 Updated by Etienne Massip over 2 years ago

  • Status changed from Reopened to Closed

This is not a Redmine issue.

Mongrel is no maintained anymore, you should consider switching to Unicorn or Thin.

#23 Updated by Justin Ryan over 2 years ago

Abhishek Singh wrote:

I'm using redmine 1.3.2 and I'm also facing this problem. I'm using this on a CentOS 6.2 system with cpanel and mongrel installed from the repository. I tried putting mongrel.rb and patch_for_mongrel.rb in my <my_redmine_path>/config/initializers, but it didn't work. I tried other cases too like putting just mongrel.rb or just patch_for_mongrel.rb in the initializers, but all in vain. The error that I get in mongrel.log is:
[...]

Any idea what might be causing this? Any solutions are welcome. Thank You.

Did you try what Giuseppe Lippolis suggested (Comment 20), adding '2.3.14' to the list of version numbers in the first line of mongrel.rb? I had the same exact error, and mongrel.rb didn't resolve it, until I opened it up and saw the list version numbers - dropping '2.3.14' in the list after '2.3.11' did the trick for me. (I would have saved myself twenty minutes and a headache if I'd just read the whole thread here...)

Also available in: Atom PDF