From lists at ruby-forum.com Sat Jun 6 19:15:17 2009 From: lists at ruby-forum.com (Rusty Rustybucket) Date: Sun, 7 Jun 2009 01:15:17 +0200 Subject: [Mongrel] Mongrel not wanting to start... any ideas? Message-ID: I'm in the process of moving an old Rails app to a new server and i can't seem to get mongrel to start. I issue the command: mongrel_rails start and I get this: ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment ... /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__': no such file to load -- ruby-debug (MissingSourceFile) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from /home/vhosts/dealer.benningtonmarine.com/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:147:in `require' from /home/vhosts/dealer.benningtonmarine.com/config/environment.rb:68 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/rails.rb:144:in `rails' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:112:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:832:in `listener' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:96:in `cloaker_' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:750:in `initialize' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:83:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/command.rb:199:in `run' from /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:235 from /usr/local/bin/mongrel_rails:18 I should note that this app is Ruby V 1.8.4 and Rails V 1.1.6 and Mongrel V 0.3.13.3 Thanks in advance for any assistance or guidance you may be able to provide. -- Posted via http://www.ruby-forum.com/. From rgo at aspgems.com Mon Jun 8 05:02:01 2009 From: rgo at aspgems.com (Rafael G.) Date: Mon, 08 Jun 2009 11:02:01 +0200 Subject: [Mongrel] Mongrel not wanting to start... any ideas? In-Reply-To: References: Message-ID: <4A2CD389.5050600@aspgems.com> It likes that you don't have a ruby-debug gem (perhaps you forgot any "debugger" in your app). Try installing it: gem install ruby-debug Rusty Rustybucket wrote: > I'm in the process of moving an old Rails app to a new server and i > can't seem to get mongrel to start. > > I issue the command: > mongrel_rails start > > and I get this: > ** Starting Mongrel listening at 0.0.0.0:3000 > ** Starting Rails with development environment ... > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require__': no such file to load -- ruby-debug (MissingSourceFile) > from > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require' > from > /home/vhosts/dealer.benningtonmarine.com/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:147:in > `require' > from /home/vhosts/dealer.benningtonmarine.com/config/environment.rb:68 > from > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in > `require' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/rails.rb:144:in > `rails' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:112:in > `cloaker_' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:832:in > `listener' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:96:in > `cloaker_' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:750:in > `initialize' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:83:in > `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/command.rb:199:in > `run' > from > /usr/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:235 > from /usr/local/bin/mongrel_rails:18 > > > I should note that this app is Ruby V 1.8.4 and Rails V 1.1.6 and > Mongrel V 0.3.13.3 > > Thanks in advance for any assistance or guidance you may be able to > provide. > -- Rafa From mcr at simtone.net Wed Jun 10 21:16:20 2009 From: mcr at simtone.net (mcr at simtone.net) Date: Wed, 10 Jun 2009 21:16:20 -0400 Subject: [Mongrel] Non-Cache Handling for Bots In-Reply-To: <9fbe0e780906101554w128e5b4di2418ea16500da5ec@mail.gmail.com> References: <9fbe0e780906101554w128e5b4di2418ea16500da5ec@mail.gmail.com> Message-ID: <20090611011621.496F43D207@navajo.ottawa.xdsinc.net> What kind of caches are you talking about? Are these full page caches? The kind that get stored into /public? My question is, can you instead of adding /robot to the URL when apache finds the robot, can you instead change Apache's DocumentRoot? It seems to be that this would prevent apache from finding the cached page. Also, if you actually point to another copy of your /public, you could get the normal static pages... I think perhaps since you are talking about changing mongrel's caching behaviour that you aren't talking about the page caches that get stored into /public. (Well, I'm rusty on terminology here) -- Michael Richardson Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, Canada Personal: http://www.sandelman.ca/mcr/ SIMtone Corporation fundamentally transforms computing into simple, secure, and very low-cost network-provisioned services pervasively accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com From bodaro at gmail.com Wed Jun 10 21:41:42 2009 From: bodaro at gmail.com (Mike Papper) Date: Wed, 10 Jun 2009 18:41:42 -0700 Subject: [Mongrel] Non-Cache Handling for Bots In-Reply-To: <20090611011621.496F43D207@navajo.ottawa.xdsinc.net> References: <9fbe0e780906101554w128e5b4di2418ea16500da5ec@mail.gmail.com> <20090611011621.496F43D207@navajo.ottawa.xdsinc.net> Message-ID: I am talking about Rails standard page-caching mechanism. Rails by default puts full pages into public/... and if mongrel sees them there, it serves them (without running rails dispatch et al). This is fine for normal but not good for the bot user agents. Here is a new solution: 1) set rails to cache in public/cache 2) Use Apache rewrite to serve these files directly (if found) 3) If not found, pass to mongrel which will not find the cached files either since MONGREL ONLY LOOKS IN public for cached files. Mongrel does not honor the config.action_controller.page_cache_directory rails setting 4) Rails processes the file and puts it into public/cache/... ...on the next request, apache serves from cache. I am working on the reqwrite rules etc. for this. Mike On Jun 10, 2009, at 6:16 PM, mcr at simtone.net wrote: > > What kind of caches are you talking about? > Are these full page caches? The kind that get stored into /public? > > My question is, can you instead of adding /robot to the URL when > apache > finds the robot, can you instead change Apache's DocumentRoot? > It seems to be that this would prevent apache from finding the cached > page. Also, if you actually point to another copy of your /public, > you > could get the normal static pages... > > I think perhaps since you are talking about changing mongrel's caching > behaviour that you aren't talking about the page caches that get > stored > into /public. (Well, I'm rusty on terminology here) > > -- > Michael Richardson > Director -- Consumer Desktop Development, Simtone Corporation, > Ottawa, Canada > Personal: http://www.sandelman.ca/mcr/ > > SIMtone Corporation fundamentally transforms computing into simple, > secure, and very low-cost network-provisioned services pervasively > accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com > > From mcr at simtone.net Wed Jun 10 22:20:08 2009 From: mcr at simtone.net (mcr at simtone.net) Date: Wed, 10 Jun 2009 22:20:08 -0400 Subject: [Mongrel] Non-Cache Handling for Bots In-Reply-To: References: <9fbe0e780906101554w128e5b4di2418ea16500da5ec@mail.gmail.com> <20090611011621.496F43D207@navajo.ottawa.xdsinc.net> Message-ID: <20090611022008.6A68D3C2E2@navajo.ottawa.xdsinc.net> >>>>> "Mike" == Mike Papper writes: Mike> I am talking about Rails standard page-caching mechanism. Rails by default Mike> puts full pages into public/... and if mongrel sees them there, it serves Mike> them (without running rails dispatch et al). This is fine for normal but not Mike> good for the bot user agents. right, so that's what I thought you were talking about. Only, it's not mongrel that serves up the pages, but Apache, usually. In your apache config, you have something like: # Rewrite all non-static requests to cluster RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://spartan_cluster%{REQUEST_URI} [P,QSA,L] which basically serves up any files found in /public, otherwise, punts to the mongrel. I thought that rails put the files directly there for apache to use/see. (there are caveats if your mongrel and apache do not share the same file system, such as because they are on different machines) If you are telling me that actually mongrel does this, it's news to me. Mike> Here is a new solution: Mike> 1) set rails to cache in public/cache Mike> 2) Use Apache rewrite to serve these files directly (if found) Mike> 3) If not found, pass to mongrel which will not find the cached files either Mike> since MONGREL ONLY LOOKS IN public for cached files. Mongrel does not honor Mike> the config.action_controller.page_cache_directory rails setting Mike> 4) Rails processes the file and puts it into public/cache/... Mike> ...on the next request, apache serves from cache. Mike> I am working on the reqwrite rules etc. for this. So, basically have apache pick a different cache location when it sees a robot. -- Michael Richardson Director -- Consumer Desktop Development, Simtone Corporation, Ottawa, Canada Personal: http://www.sandelman.ca/mcr/ SIMtone Corporation fundamentally transforms computing into simple, secure, and very low-cost network-provisioned services pervasively accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com From shawn at brmethod.com Wed Jun 10 22:26:48 2009 From: shawn at brmethod.com (Shawn Hill) Date: Wed, 10 Jun 2009 21:26:48 -0500 Subject: [Mongrel] Non-Cache Handling for Bots In-Reply-To: References: <9fbe0e780906101554w128e5b4di2418ea16500da5ec@mail.gmail.com> <20090611011621.496F43D207@navajo.ottawa.xdsinc.net> Message-ID: <000e01c9ea3c$13a249f0$3ae6ddd0$@com> "Serving up different results based on user agent may cause your site to be perceived as deceptive and removed from the Google index." http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=66355 -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Mike Papper Sent: Wednesday, June 10, 2009 8:42 PM To: mongrel-users at rubyforge.org Subject: Re: [Mongrel] Non-Cache Handling for Bots I am talking about Rails standard page-caching mechanism. Rails by default puts full pages into public/... and if mongrel sees them there, it serves them (without running rails dispatch et al). This is fine for normal but not good for the bot user agents. Here is a new solution: 1) set rails to cache in public/cache 2) Use Apache rewrite to serve these files directly (if found) 3) If not found, pass to mongrel which will not find the cached files either since MONGREL ONLY LOOKS IN public for cached files. Mongrel does not honor the config.action_controller.page_cache_directory rails setting 4) Rails processes the file and puts it into public/cache/... ...on the next request, apache serves from cache. I am working on the reqwrite rules etc. for this. Mike On Jun 10, 2009, at 6:16 PM, mcr at simtone.net wrote: > > What kind of caches are you talking about? > Are these full page caches? The kind that get stored into /public? > > My question is, can you instead of adding /robot to the URL when > apache > finds the robot, can you instead change Apache's DocumentRoot? > It seems to be that this would prevent apache from finding the cached > page. Also, if you actually point to another copy of your /public, > you > could get the normal static pages... > > I think perhaps since you are talking about changing mongrel's caching > behaviour that you aren't talking about the page caches that get > stored > into /public. (Well, I'm rusty on terminology here) > > -- > Michael Richardson > Director -- Consumer Desktop Development, Simtone Corporation, > Ottawa, Canada > Personal: http://www.sandelman.ca/mcr/ > > SIMtone Corporation fundamentally transforms computing into simple, > secure, and very low-cost network-provisioned services pervasively > accessible by everyone. Learn more at www.simtone.net and www.SIMtoneVDU.com > > _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Thu Jun 11 02:56:24 2009 From: lists at ruby-forum.com (Tahir Rauf) Date: Thu, 11 Jun 2009 08:56:24 +0200 Subject: [Mongrel] Mongrel crashes while running 'exec' through ruby. Message-ID: Hi All, I have a ruby on rails application and in the controller, I try to run a shell script using exec command like this --- variable = 'sh /home/abc.sh' exec variable --- But when the control comes at this line, the mongrel server immediately crashes, and when I check its status its says "missing pid file". The shell script contains nothing wrong, it works fine on the linux console, I have also commented everything in that shell script and put just a single variable declaration, but even then the serer crashes.. Any Ideas, or is there any other way to run a shell script using ruby on rails ?? Thanks in advance.. Tahir Rauf -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jun 11 05:48:30 2009 From: lists at ruby-forum.com (Tahir Rauf) Date: Thu, 11 Jun 2009 11:48:30 +0200 Subject: [Mongrel] Mongrel crashes while running 'exec' through ruby. In-Reply-To: References: Message-ID: <13c84616720cb6f519da44e003c55c45@ruby-forum.com> Got the solution, exec starts a new process so don't use it.. just use the shell command in ruby like this `sh /home/abc.sh` in the controller.. It runs fine -- Posted via http://www.ruby-forum.com/. From gollomm at gmail.com Fri Jun 12 09:46:13 2009 From: gollomm at gmail.com (gollomm) Date: Fri, 12 Jun 2009 09:46:13 -0400 Subject: [Mongrel] Limit Request Body Size (Disallow very large File-uploads) Message-ID: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> Hello all, For the last couple of days I was trying to get my Apache/mod_proxy/mongrel setup to limit the size of the request body. The setup is as follows: 1.) Apache acts as a reverse proxy by facilitating mod_rewrite and mod_proxy 2.) Requests for non-static files are passed on to a mongrel_cluster 3.) We use mongrel for our Ruby on Rails application Note that due to some restrictions we are unable to use Apache/Passenger for our production deployment. Is there a way to tell mongrel to skip requests which exceed a certain limit (say 20MB) and return a 400 (Bad Request) response or the like? I have tried to use the LimitRequestBody directive of Apache httpd, but this obviously does not work, since Apache httpd passes most of it's requests directly on to mongrel. Thanks for your help! Regards, Severin From stephanwehner at gmail.com Fri Jun 12 11:07:29 2009 From: stephanwehner at gmail.com (Stephan Wehner) Date: Fri, 12 Jun 2009 08:07:29 -0700 Subject: [Mongrel] Limit Request Body Size (Disallow very large File-uploads) In-Reply-To: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> References: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> Message-ID: On Fri, Jun 12, 2009 at 6:46 AM, gollomm wrote: > Hello all, > > For the last couple of days I was trying to get my > Apache/mod_proxy/mongrel setup to limit the size of the request body. > The setup is as follows: > > 1.) Apache acts as a reverse proxy by facilitating mod_rewrite and mod_proxy > 2.) Requests for non-static files are passed on to a mongrel_cluster > 3.) We use mongrel for our Ruby on Rails application ModSecurity? Stephan > Note that due to some restrictions we are unable to use > Apache/Passenger for our production deployment. > > Is there a way to tell mongrel to skip requests which exceed a certain > limit (say 20MB) and return a 400 (Bad Request) response or the like? > I have tried to use the LimitRequestBody directive of Apache httpd, > but this obviously does not work, since Apache httpd passes most of > it's requests directly on to mongrel. Thanks for your help! > > Regards, > Severin > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > -- Stephan Wehner -> http://stephan.sugarmotor.org (blog and homepage) -> http://www.thrackle.org -> http://www.buckmaster.ca -> http://www.trafficlife.com -> http://stephansmap.org -- http://blog.stephansmap.org From gollomm at gmail.com Fri Jun 12 11:50:28 2009 From: gollomm at gmail.com (gollomm) Date: Fri, 12 Jun 2009 11:50:28 -0400 Subject: [Mongrel] Limit Request Body Size (Disallow very large File-uploads) In-Reply-To: References: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> Message-ID: <44c36e180906120850l22f5f069p404b4fed17a66739@mail.gmail.com> On Fri, Jun 12, 2009 at 11:07 AM, Stephan Wehner wrote: > On Fri, Jun 12, 2009 at 6:46 AM, gollomm wrote: >> Hello all, >> >> For the last couple of days I was trying to get my >> Apache/mod_proxy/mongrel setup to limit the size of the request body. >> The setup is as follows: >> >> 1.) Apache acts as a reverse proxy by facilitating mod_rewrite and mod_proxy >> 2.) Requests for non-static files are passed on to a mongrel_cluster >> 3.) We use mongrel for our Ruby on Rails application > > ModSecurity? Well, we are very confined regarding Apache modules. That does not seem to be an option. >> Note that due to some restrictions we are unable to use >> Apache/Passenger for our production deployment. >> >> Is there a way to tell mongrel to skip requests which exceed a certain >> limit (say 20MB) and return a 400 (Bad Request) response or the like? >> I have tried to use the LimitRequestBody directive of Apache httpd, >> but this obviously does not work, since Apache httpd passes most of >> it's requests directly on to mongrel. Thanks for your help! I am currently looking into how mongrel handlers work and how I would configure them. No luck so far. Ideally, I would like to change mongrel's own file upload handler to drop requests which exceed a certain limit. Here is an interesting thread I came across: http://rubyforge.org/pipermail/mongrel-users/2006-September/001511.html The question is now, where is the code handling file-uploads in the mongrel source? Alternatively, could somebody provide me some pointers concerning mongrel handlers? I am a totally new to mongrel... Thanks, Severin > -> http://stephan.sugarmotor.org (blog and homepage) > -> http://www.thrackle.org > -> http://www.buckmaster.ca > -> http://www.trafficlife.com > -> http://stephansmap.org -- http://blog.stephansmap.org > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > From rs at pccl.info Fri Jun 12 11:15:34 2009 From: rs at pccl.info (Ryan Stenhouse) Date: Fri, 12 Jun 2009 16:15:34 +0100 Subject: [Mongrel] Limit Request Body Size (Disallow very large File-uploads) In-Reply-To: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> References: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> Message-ID: <4A327116.7000902@pccl.info> gollomm wrote: > Hello all, > > For the last couple of days I was trying to get my > Apache/mod_proxy/mongrel setup to limit the size of the request body. > The setup is as follows: > > 1.) Apache acts as a reverse proxy by facilitating mod_rewrite and mod_proxy > 2.) Requests for non-static files are passed on to a mongrel_cluster > 3.) We use mongrel for our Ruby on Rails application > > Note that due to some restrictions we are unable to use > Apache/Passenger for our production deployment. > > Is there a way to tell mongrel to skip requests which exceed a certain > limit (say 20MB) and return a 400 (Bad Request) response or the like? > I have tried to use the LimitRequestBody directive of Apache httpd, > but this obviously does not work, since Apache httpd passes most of > it's requests directly on to mongrel. Thanks for your help! > > Regards, > Severin > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > Hello Severin, mod_security may very well be your friend there. It can be configured to drop any request over a certain size, and by its nature will drop it with standard HTTP error messages. Regards, Ryan From wyhaines at gmail.com Fri Jun 12 12:40:59 2009 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 12 Jun 2009 10:40:59 -0600 Subject: [Mongrel] Limit Request Body Size (Disallow very large File-uploads) In-Reply-To: <44c36e180906120850l22f5f069p404b4fed17a66739@mail.gmail.com> References: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> <44c36e180906120850l22f5f069p404b4fed17a66739@mail.gmail.com> Message-ID: Look at http_request.rb. Mongrel already has a limit to the length of the headers that it will accept, so you are covered there. If you look at HttpRequest#initialize, there is a "remain" variable that is set to the content length of the body of the request. You could simply insert a check there. If it's too high, bail out right there and throw back whatever error response you deem appropriate. It could be a 400, but it's probably better if it is a 413 Request Entity Too Large. Kirk Haines From gollomm at gmail.com Fri Jun 12 13:32:13 2009 From: gollomm at gmail.com (gollomm) Date: Fri, 12 Jun 2009 13:32:13 -0400 Subject: [Mongrel] Limit Request Body Size (Disallow very large File-uploads) In-Reply-To: References: <44c36e180906120646r6ef066d7i986436ed57d2b15e@mail.gmail.com> <44c36e180906120850l22f5f069p404b4fed17a66739@mail.gmail.com> Message-ID: <44c36e180906121032s4cb1a4bby929f928d77ed0c16@mail.gmail.com> On Fri, Jun 12, 2009 at 12:40 PM, Kirk Haines wrote: > Look at http_request.rb. > > Mongrel already has a limit to the length of the headers that it will > accept, so you are covered there. ?If you look at > HttpRequest#initialize, there is a "remain" variable that is set to > the content length of the body of the request. > > You could simply insert a check there. ?If it's too high, bail out > right there and throw back whatever error response you deem > appropriate. > > It could be a 400, but it's probably better if it is a 413 Request > Entity Too Large. Oh, I did that already. I had mongrel sending an error to the client, when I realized that when that check is performed the provided file (for upload) is stored on server side already. Instead, I'd like to do something before all that. For processing the content_length, and the remain variable respectively, the file has to be in its entirety on the server. I'd like mongrel to abort processing the request body if the HTTP header 'Content-Length' reports it'll be too large anyways. What I'd like to do is checking the 'Content-Length' (something fast) and bail out appropriately... The most challenging part here is to figure out at what point mongrel has access to the request's HTTP headers but has not begun processing the request body in any way. There is 'request_begins' for HttpHandlers, but providing code in there never seems to be executed. Maybe I'd need some configuration changes for handlers to be run or something similar. But I have no idea how I'd do so or where to find some documentation about it... Thank you very much for the great help, Severin From lists at ruby-forum.com Thu Jun 18 09:23:33 2009 From: lists at ruby-forum.com (Jonathan McCoy) Date: Thu, 18 Jun 2009 15:23:33 +0200 Subject: [Mongrel] Building access data from Mongrel & Production log files Message-ID: <43e80f9f531735e903a574df59442fdf@ruby-forum.com> Hi, We've had NGINX logs trashed through a crash, so I'm trying to work out a way of building or assembling some access data from mongrel..log and production.log files. Any suggestions, tools or ideas folks?! Thanks! -- Posted via http://www.ruby-forum.com/. From lists at ruby-forum.com Thu Jun 18 22:21:06 2009 From: lists at ruby-forum.com (Cyril Cyril) Date: Fri, 19 Jun 2009 04:21:06 +0200 Subject: [Mongrel] How to start the server with no network connection? Message-ID: <285df570cd529b3bab99dd520177c891@ruby-forum.com> Hi there, I'm working locally and everything worked fine. But today I wanted to work somewhere where there is no network connection, and I had this error: script/server => Booting Mongrel => Rails 2.3.2 application starting on http://0.0.0.0:3000 /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError) How should I configure my server to start even if I'm not connected to any network? -- Posted via http://www.ruby-forum.com/. From rochkind at jhu.edu Fri Jun 19 11:38:46 2009 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Fri, 19 Jun 2009 11:38:46 -0400 Subject: [Mongrel] advice for jetty setup? In-Reply-To: <4A3BACCF.5000405@jhu.edu> References: <4A3BACCF.5000405@jhu.edu> Message-ID: <4A3BB106.5070206@jhu.edu> Oops, sorry, sent that to wrong list, ignore it. Jonathan Rochkind wrote: > Are any of you guys in fact using jetty for deploying a > publically-available version of blacklight? > > Using the demo app, can anyone give me some advice for ensuring that > jetty automatically starts on machine bootup (or when the rails app is > started?) I know how to make a rails app deployed with mongrel start up > automatically, not sure how to get the jetty-deployed Solr to do the same. > > Thanks a lot for any advice. I will happily write up some documentation > (on the wiki?) for others coming along who might have the same question. > > Also, am I right that for an ultimate production deployment, jetty would > not be reccommended, it's really just for testing? > > Jonathan > > From rochkind at jhu.edu Fri Jun 19 11:20:47 2009 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Fri, 19 Jun 2009 11:20:47 -0400 Subject: [Mongrel] advice for jetty setup? Message-ID: <4A3BACCF.5000405@jhu.edu> Are any of you guys in fact using jetty for deploying a publically-available version of blacklight? Using the demo app, can anyone give me some advice for ensuring that jetty automatically starts on machine bootup (or when the rails app is started?) I know how to make a rails app deployed with mongrel start up automatically, not sure how to get the jetty-deployed Solr to do the same. Thanks a lot for any advice. I will happily write up some documentation (on the wiki?) for others coming along who might have the same question. Also, am I right that for an ultimate production deployment, jetty would not be reccommended, it's really just for testing? Jonathan From lists at ruby-forum.com Tue Jun 23 08:54:48 2009 From: lists at ruby-forum.com (Ritesh Pareek) Date: Tue, 23 Jun 2009 14:54:48 +0200 Subject: [Mongrel] ERROR: Error installing mongrel: Message-ID: <7d2180da5ba3bc3702cee297ee77c175@ruby-forum.com> Hi, I am getting some problem while installing mongrel on GoDaddy(fedora) server. Env is :: [root at ip-97-74-86-181 bin]# gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.3.4 - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [i386-linux] - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /usr/lib/ruby/gems/1.8 - /root/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://gems.rubyforge.org/ While installing mongrel i am getting :: [root at ip-97-74-86-181 bin]# gem install mongrel Building native extensions. This could take a while... ERROR: Error installing mongrel: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb can't find header files for ruby. Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7 for inspection. Results logged to /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7/ext/fastthread/gem_make.out [root at ip-97-74-86-181 bin]# And the gems list is:: [root at ip-97-74-86-181 bin]# gem list --local *** LOCAL GEMS *** actionmailer (2.3.2) actionpack (2.3.2) activemerchant (1.4.2) activerecord (2.3.2) activerecord-jdbc-adapter (0.9.1) activerecord-jdbcmysql-adapter (0.9.1) activeresource (2.3.2) activesupport (2.3.2) builder (2.1.2) calendar_date_select (1.15) cgi_multipart_eof_fix (2.5.0) daemons (1.0.10) gem_plugin (0.2.3) google-geocode (1.2.1) hoe (2.2.0) jdbc-mysql (5.0.4) money (2.1.3) rails (2.3.2) rake (0.8.7) rc-rest (2.2.1) rubyforge (1.0.3) rubygems-update (1.3.4) sources (0.0.1) ZenTest (4.1.1) Please let me know where i am wrong. Thanks in advance. Thanks Ritesh PAreek -- Posted via http://www.ruby-forum.com/. From luislavena at gmail.com Thu Jun 25 08:19:58 2009 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 25 Jun 2009 09:19:58 -0300 Subject: [Mongrel] Mongrel service keeps re-starting ruby In-Reply-To: References: Message-ID: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> On Thu, Jun 25, 2009 at 2:07 AM, Michael Pliskin wrote: > Hi all, > > > > Some disclaimer first: I am a complete newbie in mongrel and this list, so > please forgive me if I say something weird. I have a problem, I?ve googled > for a solution for quite a while and failed so far, so decided to ask here. > > > > I am trying to set up my Rails application on Windows according to this > manual: > http://nlakkakula.wordpress.com/2008/11/24/10-steps-for-deploying-your-ruby-on-rails-application-on-a-windows-server-2008-apache-mongrel-cluster/ > . Everything is ok however when I completed all the steps, Apache complains > that it cannot contact proxy ? meaning there is something wrong with > mongrel. I digged further and found mongrel keeping re-starting the ruby > process. If I look into a task manager, the picture is like: > > -????????? A ruby.exe process is started > > -????????? It eats 100% CPU for 5 seconds > > -????????? It also eats about 25MB RAM > > -????????? It dies then > > And the process repeats forever. It looks like there is some error happening > but I don?t know any way to capture it. > > > > My OS is Win2k Advanced Server SP4. Any ideas? > > > > Thanks, > > ? Mike Pliskin > That behavior is normal with mongrel_service. has been implemented in a way that the ruby process automatically restart in case of a failure, which is seems is happening in the background. To debug this, please start mongrel standalone: cd my_app mongrel_rails start Doing that, you should see, on the console, what is happening. Please paste the results on your reply so I can help you out. Cheers, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From mike at comapping.com Thu Jun 25 08:46:56 2009 From: mike at comapping.com (Michael Pliskin) Date: Thu, 25 Jun 2009 16:46:56 +0400 Subject: [Mongrel] Mongrel service keeps re-starting ruby In-Reply-To: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> References: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> Message-ID: Dear Luis, Thanks a lot for replying, I followed your advice and it revealed the problem: it was the --prefix switch that caused it. When I start it like E:\RailsApps\3vi>mongrel_rails start -e development -p 3001 -a 127.0.0.1 -l "e:/RailsApps/3vi/log/1.log" -P "e:/RailsApps/3vi/log/mongrel.pid" -t 0 -r "public" -n 1024 --prefix "/labelyzer" I am given a ton of errors: ** Starting Mongrel listening at 127.0.0.1:3001 ** Starting Rails with development environment... ** Mounting Rails at /labelyzer... D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError) from D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:151:in `rails' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:113:in `cloaker_' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `call' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `listener' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:99:in `cloaker_' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `call' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `initialize' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `new' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `run' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run' from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281 from D:/Ruby/bin/mongrel_rails:19:in `load' from D:/Ruby/bin/mongrel_rails:19 And if I skip --prefix, it's all fine. Any ideas? Thanks in advance, Mike -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena Sent: Thursday, June 25, 2009 4:20 PM To: mongrel-users at rubyforge.org Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby On Thu, Jun 25, 2009 at 2:07 AM, Michael Pliskin wrote: > Hi all, > > > > Some disclaimer first: I am a complete newbie in mongrel and this list, so > please forgive me if I say something weird. I have a problem, I've googled > for a solution for quite a while and failed so far, so decided to ask here. > > > > I am trying to set up my Rails application on Windows according to this > manual: > http://nlakkakula.wordpress.com/2008/11/24/10-steps-for-deploying-your-ruby-on-rails-application-on-a-windows-server-2008-apache-mongrel-cluster/ > . Everything is ok however when I completed all the steps, Apache complains > that it cannot contact proxy - meaning there is something wrong with > mongrel. I digged further and found mongrel keeping re-starting the ruby > process. If I look into a task manager, the picture is like: > > -????????? A ruby.exe process is started > > -????????? It eats 100% CPU for 5 seconds > > -????????? It also eats about 25MB RAM > > -????????? It dies then > > And the process repeats forever. It looks like there is some error happening > but I don't know any way to capture it. > > > > My OS is Win2k Advanced Server SP4. Any ideas? > > > > Thanks, > > ? Mike Pliskin > That behavior is normal with mongrel_service. has been implemented in a way that the ruby process automatically restart in case of a failure, which is seems is happening in the background. To debug this, please start mongrel standalone: cd my_app mongrel_rails start Doing that, you should see, on the console, what is happening. Please paste the results on your reply so I can help you out. Cheers, -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From rochkind at jhu.edu Thu Jun 25 10:04:21 2009 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Thu, 25 Jun 2009 10:04:21 -0400 Subject: [Mongrel] Mongrel service keeps re-starting ruby In-Reply-To: References: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> Message-ID: <4A4383E5.6090103@jhu.edu> Are you using Rails 2.2? The latest version of mongrel available by gem is broken with --prefix and Rails 2.2. I'd still expect it to simply report an error instead of consuming all CPU, so that's odd (but I've never developed Rails on Windows before either). But if you are using Rails 2.2 that could still be it, since I too have discovered that you can't use --prefix with a Rails 2.2 app, without either patching mongrel or patching your rails app. (I find patching the Rails app to be easier and less scary, and can tell you how I've done it if this is indeed your issue). I do think it's a big odd that Rails 2.2 has been out for so long, but mongrel hasn't released a gem that's compatible with it, or warned people on the project page that there's a problem, or what have you. Makes me kind of worried that there aren't very many (any?) people on the mongrel development team, and one shouldn't count on future versions. Jonathan Michael Pliskin wrote: > Dear Luis, > > Thanks a lot for replying, I followed your advice and it revealed the problem: it was the --prefix switch that caused it. When I start it like > E:\RailsApps\3vi>mongrel_rails start -e development -p 3001 -a 127.0.0.1 -l "e:/RailsApps/3vi/log/1.log" -P "e:/RailsApps/3vi/log/mongrel.pid" -t 0 -r "public" -n 1024 --prefix "/labelyzer" > I am given a ton of errors: > ** Starting Mongrel listening at 127.0.0.1:3001 > ** Starting Rails with development environment... > ** Mounting Rails at /labelyzer... > D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError) > from D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:151:in `rails' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:113:in `cloaker_' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `call' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `listener' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:99:in `cloaker_' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `call' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `initialize' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `new' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `run' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281 > from D:/Ruby/bin/mongrel_rails:19:in `load' > from D:/Ruby/bin/mongrel_rails:19 > > And if I skip --prefix, it's all fine. Any ideas? > > Thanks in advance, > Mike > > -----Original Message----- > From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena > Sent: Thursday, June 25, 2009 4:20 PM > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby > > On Thu, Jun 25, 2009 at 2:07 AM, Michael Pliskin wrote: > >> Hi all, >> >> >> >> Some disclaimer first: I am a complete newbie in mongrel and this list, so >> please forgive me if I say something weird. I have a problem, I've googled >> for a solution for quite a while and failed so far, so decided to ask here. >> >> >> >> I am trying to set up my Rails application on Windows according to this >> manual: >> http://nlakkakula.wordpress.com/2008/11/24/10-steps-for-deploying-your-ruby-on-rails-application-on-a-windows-server-2008-apache-mongrel-cluster/ >> . Everything is ok however when I completed all the steps, Apache complains >> that it cannot contact proxy - meaning there is something wrong with >> mongrel. I digged further and found mongrel keeping re-starting the ruby >> process. If I look into a task manager, the picture is like: >> >> - A ruby.exe process is started >> >> - It eats 100% CPU for 5 seconds >> >> - It also eats about 25MB RAM >> >> - It dies then >> >> And the process repeats forever. It looks like there is some error happening >> but I don't know any way to capture it. >> >> >> >> My OS is Win2k Advanced Server SP4. Any ideas? >> >> >> >> Thanks, >> >> Mike Pliskin >> >> > > That behavior is normal with mongrel_service. has been implemented in > a way that the ruby process automatically restart in case of a > failure, which is seems is happening in the background. > > To debug this, please start mongrel standalone: > > cd my_app > mongrel_rails start > > Doing that, you should see, on the console, what is happening. > > Please paste the results on your reply so I can help you out. > > Cheers, > -- > Luis Lavena > AREA 17 > - > Perfection in design is achieved not when there is nothing more to add, > but rather when there is nothing more to take away. > Antoine de Saint-Exup?ry > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From rochkind at jhu.edu Thu Jun 25 10:08:19 2009 From: rochkind at jhu.edu (Jonathan Rochkind) Date: Thu, 25 Jun 2009 10:08:19 -0400 Subject: [Mongrel] Mongrel service keeps re-starting ruby In-Reply-To: References: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> Message-ID: <4A4384D3.3030204@jhu.edu> Ah, actually reading your stack trace, I see it is indeed the --prefix and modern versions of Rails issue. I still don't know why that consumes all CPU instead of just reporting an error. But mongrel is trying to call a method that no longer exists in RAils 2.3 like you have. (I think it dissappeared in Rails 2.2, but could be wrong, it's definitely gone in Rails 2.3). Try dropping this file in your app's config/initializers directory, to basically restore the method that mongrel is trying to call, as a wrapper for the new way to trigger this functionality. config/initializers/patch_for_mongrel.rb [name of file can be anything] # Fix for mongrel which still doesn't know about Rails 2.2's changes, grr. # We provide a backwards compatible wrapper around the new ActionController::base.relative_url_root, # so it can still be called off of the actually non-existing AbstractRequest class. module ActionController class AbstractRequest < ActionController::Request def self.relative_url_root=(path) ActionController::Base.relative_url_root=(path) end def self.relative_url_root ActionController::Base.relative_url_root end end end Michael Pliskin wrote: > Dear Luis, > > Thanks a lot for replying, I followed your advice and it revealed the problem: it was the --prefix switch that caused it. When I start it like > E:\RailsApps\3vi>mongrel_rails start -e development -p 3001 -a 127.0.0.1 -l "e:/RailsApps/3vi/log/1.log" -P "e:/RailsApps/3vi/log/mongrel.pid" -t 0 -r "public" -n 1024 --prefix "/labelyzer" > I am given a ton of errors: > ** Starting Mongrel listening at 127.0.0.1:3001 > ** Starting Rails with development environment... > ** Mounting Rails at /labelyzer... > D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError) > from D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:151:in `rails' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:113:in `cloaker_' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `call' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `listener' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:99:in `cloaker_' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `call' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `initialize' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `new' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `run' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281 > from D:/Ruby/bin/mongrel_rails:19:in `load' > from D:/Ruby/bin/mongrel_rails:19 > > And if I skip --prefix, it's all fine. Any ideas? > > Thanks in advance, > Mike > > -----Original Message----- > From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena > Sent: Thursday, June 25, 2009 4:20 PM > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby > > On Thu, Jun 25, 2009 at 2:07 AM, Michael Pliskin wrote: > >> Hi all, >> >> >> >> Some disclaimer first: I am a complete newbie in mongrel and this list, so >> please forgive me if I say something weird. I have a problem, I've googled >> for a solution for quite a while and failed so far, so decided to ask here. >> >> >> >> I am trying to set up my Rails application on Windows according to this >> manual: >> http://nlakkakula.wordpress.com/2008/11/24/10-steps-for-deploying-your-ruby-on-rails-application-on-a-windows-server-2008-apache-mongrel-cluster/ >> . Everything is ok however when I completed all the steps, Apache complains >> that it cannot contact proxy - meaning there is something wrong with >> mongrel. I digged further and found mongrel keeping re-starting the ruby >> process. If I look into a task manager, the picture is like: >> >> - A ruby.exe process is started >> >> - It eats 100% CPU for 5 seconds >> >> - It also eats about 25MB RAM >> >> - It dies then >> >> And the process repeats forever. It looks like there is some error happening >> but I don't know any way to capture it. >> >> >> >> My OS is Win2k Advanced Server SP4. Any ideas? >> >> >> >> Thanks, >> >> Mike Pliskin >> >> > > That behavior is normal with mongrel_service. has been implemented in > a way that the ruby process automatically restart in case of a > failure, which is seems is happening in the background. > > To debug this, please start mongrel standalone: > > cd my_app > mongrel_rails start > > Doing that, you should see, on the console, what is happening. > > Please paste the results on your reply so I can help you out. > > Cheers, > -- > Luis Lavena > AREA 17 > - > Perfection in design is achieved not when there is nothing more to add, > but rather when there is nothing more to take away. > Antoine de Saint-Exup?ry > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > From luislavena at gmail.com Thu Jun 25 10:23:40 2009 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 25 Jun 2009 11:23:40 -0300 Subject: [Mongrel] Mongrel service keeps re-starting ruby In-Reply-To: <4A4383E5.6090103@jhu.edu> References: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> <4A4383E5.6090103@jhu.edu> Message-ID: <71166b3b0906250723i769468a8m8cd55b9654193b9e@mail.gmail.com> On Thu, Jun 25, 2009 at 11:04 AM, Jonathan Rochkind wrote: > Are you using Rails 2.2? > The latest version of mongrel available by gem is broken with --prefix and > Rails 2.2. ?I'd still expect it to simply report an error instead of > consuming all CPU, so that's odd (but I've never developed Rails on Windows > before either). > Is consuming the CPU since mongrel_service is trying to restart the ruby process once it failed. Mea culpa,ruby 1.8.5 used to segfault from time to time and I've implemented that automatic restart at that time to workaround it. Since ruby is raising an error and exiting, mongrel_service is trying to restart it :P > But if you are using Rails 2.2 that could still be it, since I too have > discovered that you can't use --prefix ?with a Rails 2.2 app, without either > patching mongrel or patching your rails app. (I find patching the Rails app > to be easier and less scary, and can tell you how I've done it if this is > indeed your issue). > > I do think it's a big odd that Rails 2.2 has been out for so long, but > mongrel hasn't released a gem that's compatible with it, or warned people on > the project page that there's a problem, or what have you. ?Makes me kind of > worried that there aren't very many (any?) people on the mongrel development > team, and one shouldn't count on future versions. > I'm here, but basically being focused on updated One-Click Ruby Installer project, which will make life more easy at least for me on Windows ;-) I think there is time for a 1.1.6 release with fixes for this and other details. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From mike at comapping.com Fri Jun 26 05:48:15 2009 From: mike at comapping.com (Michael Pliskin) Date: Fri, 26 Jun 2009 13:48:15 +0400 Subject: [Mongrel] Mongrel service keeps re-starting ruby In-Reply-To: <4A4384D3.3030204@jhu.edu> References: <71166b3b0906250519y68c00193l8c47e9e136b70809@mail.gmail.com> <4A4384D3.3030204@jhu.edu> Message-ID: Hi Jonathan, Thanks a million, your fix worked like a charm! Everything is ok now. Thanks again for fast and superb response! Mike -----Original Message----- From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Jonathan Rochkind Sent: Thursday, June 25, 2009 6:08 PM To: mongrel-users at rubyforge.org Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby Ah, actually reading your stack trace, I see it is indeed the --prefix and modern versions of Rails issue. I still don't know why that consumes all CPU instead of just reporting an error. But mongrel is trying to call a method that no longer exists in RAils 2.3 like you have. (I think it dissappeared in Rails 2.2, but could be wrong, it's definitely gone in Rails 2.3). Try dropping this file in your app's config/initializers directory, to basically restore the method that mongrel is trying to call, as a wrapper for the new way to trigger this functionality. config/initializers/patch_for_mongrel.rb [name of file can be anything] # Fix for mongrel which still doesn't know about Rails 2.2's changes, grr. # We provide a backwards compatible wrapper around the new ActionController::base.relative_url_root, # so it can still be called off of the actually non-existing AbstractRequest class. module ActionController class AbstractRequest < ActionController::Request def self.relative_url_root=(path) ActionController::Base.relative_url_root=(path) end def self.relative_url_root ActionController::Base.relative_url_root end end end Michael Pliskin wrote: > Dear Luis, > > Thanks a lot for replying, I followed your advice and it revealed the problem: it was the --prefix switch that caused it. When I start it like > E:\RailsApps\3vi>mongrel_rails start -e development -p 3001 -a 127.0.0.1 -l "e:/RailsApps/3vi/log/1.log" -P "e:/RailsApps/3vi/log/mongrel.pid" -t 0 -r "public" -n 1024 --prefix "/labelyzer" > I am given a ton of errors: > ** Starting Mongrel listening at 127.0.0.1:3001 > ** Starting Rails with development environment... > ** Mounting Rails at /labelyzer... > D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError) > from D:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:151:in `rails' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:113:in `cloaker_' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `call' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:149:in `listener' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:99:in `cloaker_' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `call' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:50:in `initialize' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `new' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:84:in `run' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run' > from D:/Ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281 > from D:/Ruby/bin/mongrel_rails:19:in `load' > from D:/Ruby/bin/mongrel_rails:19 > > And if I skip --prefix, it's all fine. Any ideas? > > Thanks in advance, > Mike > > -----Original Message----- > From: mongrel-users-bounces at rubyforge.org [mailto:mongrel-users-bounces at rubyforge.org] On Behalf Of Luis Lavena > Sent: Thursday, June 25, 2009 4:20 PM > To: mongrel-users at rubyforge.org > Subject: Re: [Mongrel] Mongrel service keeps re-starting ruby > > On Thu, Jun 25, 2009 at 2:07 AM, Michael Pliskin wrote: > >> Hi all, >> >> >> >> Some disclaimer first: I am a complete newbie in mongrel and this list, so >> please forgive me if I say something weird. I have a problem, I've googled >> for a solution for quite a while and failed so far, so decided to ask here. >> >> >> >> I am trying to set up my Rails application on Windows according to this >> manual: >> http://nlakkakula.wordpress.com/2008/11/24/10-steps-for-deploying-your-ruby-on-rails-application-on-a-windows-server-2008-apache-mongrel-cluster/ >> . Everything is ok however when I completed all the steps, Apache complains >> that it cannot contact proxy - meaning there is something wrong with >> mongrel. I digged further and found mongrel keeping re-starting the ruby >> process. If I look into a task manager, the picture is like: >> >> - A ruby.exe process is started >> >> - It eats 100% CPU for 5 seconds >> >> - It also eats about 25MB RAM >> >> - It dies then >> >> And the process repeats forever. It looks like there is some error happening >> but I don't know any way to capture it. >> >> >> >> My OS is Win2k Advanced Server SP4. Any ideas? >> >> >> >> Thanks, >> >> Mike Pliskin >> >> > > That behavior is normal with mongrel_service. has been implemented in > a way that the ruby process automatically restart in case of a > failure, which is seems is happening in the background. > > To debug this, please start mongrel standalone: > > cd my_app > mongrel_rails start > > Doing that, you should see, on the console, what is happening. > > Please paste the results on your reply so I can help you out. > > Cheers, > -- > Luis Lavena > AREA 17 > - > Perfection in design is achieved not when there is nothing more to add, > but rather when there is nothing more to take away. > Antoine de Saint-Exup?ry > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users > > _______________________________________________ Mongrel-users mailing list Mongrel-users at rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users From lists at ruby-forum.com Mon Jun 29 02:52:04 2009 From: lists at ruby-forum.com (Mahalingam Mr) Date: Mon, 29 Jun 2009 08:52:04 +0200 Subject: [Mongrel] ERROR: Error installing mongrel: In-Reply-To: <7d2180da5ba3bc3702cee297ee77c175@ruby-forum.com> References: <7d2180da5ba3bc3702cee297ee77c175@ruby-forum.com> Message-ID: Ritesh Pareek wrote: > Hi, > > I am getting some problem while installing mongrel on GoDaddy(fedora) > server. > > Env is :: > > [root at ip-97-74-86-181 bin]# gem environment > RubyGems Environment: > - RUBYGEMS VERSION: 1.3.4 > - RUBY VERSION: 1.8.6 (2008-03-03 patchlevel 114) [i386-linux] > - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 > - RUBY EXECUTABLE: /usr/bin/ruby > - EXECUTABLE DIRECTORY: /usr/bin > - RUBYGEMS PLATFORMS: > - ruby > - x86-linux > - GEM PATHS: > - /usr/lib/ruby/gems/1.8 > - /root/.gem/ruby/1.8 > - GEM CONFIGURATION: > - :update_sources => true > - :verbose => true > - :benchmark => false > - :backtrace => false > - :bulk_threshold => 1000 > - REMOTE SOURCES: > - http://gems.rubyforge.org/ > > While installing mongrel i am getting :: > > [root at ip-97-74-86-181 bin]# gem install mongrel > Building native extensions. This could take a while... > ERROR: Error installing mongrel: > ERROR: Failed to build gem native extension. > > /usr/bin/ruby extconf.rb > can't find header files for ruby. > > > Gem files will remain installed in > /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7 for inspection. > Results logged to > /usr/lib/ruby/gems/1.8/gems/fastthread-1.0.7/ext/fastthread/gem_make.out > [root at ip-97-74-86-181 bin]# > Please let me know where i am wrong. Thanks in advance. > Thanks > Ritesh PAreek Hi, How do you install the ruby in your server, is it by using yum or from the source. If it is from yum, then install this package too, ruby-devel. The ruby you installed is without header files. To install the header files you have to install the above said package. Rgds TML -- Posted via http://www.ruby-forum.com/. From justin at magpieti.com Mon Jun 29 11:28:19 2009 From: justin at magpieti.com (Justin Erickson) Date: Mon, 29 Jun 2009 09:28:19 -0600 Subject: [Mongrel] Mongrel Hanging (Apache, mod_proxy, Mongrel Cluster, Rails) Message-ID: <197623f00906290828p447cb6c7t509b286de9725e56@mail.gmail.com> We have been having a problem with our mongrel servers hanging at seemingly random times. The problem can be most often reproduced by accessing a page, leaving the browser open for some time (60+ min) then making another request. The browser will receive a "Proxy Error" from Apache, If we look at mongrel via "ps aux" it says "mongrel_rails [8000/1/253]: handling 127.0.0.1: GET /" Using strace we pulled this: 14:04:15 poll([{fd=12, events=POLLIN|POLLPRI}], 1, 0) = 0 14:04:15 write(12, "\1\0\0\0\t", 5) = 5 14:04:15 read(12, SEVER IS LOCKED HERE... Then 15 min later... 14:04:15 read(12, 0x8eab758, 16384) = -1 ETIMEDOUT (Connection timed out) 14:19:40 shutdown(12, 2 /* send and receive */) = -1 ENOTCONN (Transport endpoint is not connected) 14:19:40 close(12) = 0 14:19:40 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 14:19:40 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 12 14:19:40 fcntl64(12, F_SETFL, O_RDONLY) = 0 14:19:40 fcntl64(12, F_GETFL) = 0x2 (flags O_RDWR) 14:19:40 connect(12, {sa_family=AF_INET, sin_port=htons(3306), sin_addr=inet_addr("XXX.XXX.XXX.XXX")}, 16) = 0 14:19:40 setsockopt(12, SOL_SOCKET, SO_RCVTIMEO, "\2003\341\1\0\0\0\0", 8) = 0 14:19:40 setsockopt(12, SOL_SOCKET, SO_SNDTIMEO, "\2003\341\1\0\0\0\0", 8) = 0 14:19:40 setsockopt(12, SOL_IP, IP_TOS, [8], 4) = 0 14:19:40 setsockopt(12, SOL_TCP, TCP_NODELAY, [1], 4) = 0 14:19:40 setsockopt(12, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0 14:19:40 read(12, "F\0\0\0\n5.0.60sp1-enterprise-gpl\0\3679"..., 16384) = 74 We have tried all the results we can find on the internet regarding "Mongrel Hanging" For Example: We are NOT using ruby log rolling We ARE using the c compiled mysql Adapter We have tried setting "ActiveRecord::Base.verification_timeout = 14400" The timeout setting on MySQL are default (interactive_timout, wait_timeout) = 28800 We have tried the TCP keepalive setting found in here: http://wooga.drbacchus.com/rails-and-mysql-timeouts We have tried setting an apache setting: #Fix for Apache bug 39499 SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 We have even tried many mysql_adapter.rb patches that "correctly" reconnect the connection on an error. None of these have made any difference. We are currently using: MySQL 5.0.60sp1 Rails 2.0.2 Mongrel 1.1.5 Thanks you very much for any help! Justin