hi, i;m using a easy feedback plugin which works just fine - locally. uploading the app to staging production gives me this: /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:214:in `rollback_active_record_state!'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save'' /home/tom/ror/fooapp.com/staging/releases/20110517122608/app/controllers/feedbacks_controller.rb:21:in `create'' the create method is basically this: def create @feedback = Feedback.new(params[:feedback]) if logged_in? @feedback.user_id = current_user.id end if @feedback.valid? FeedbackMailer.deliver_feedback(@feedback) if !@feedback.email.blank? @feedback.save render :status => :created, :text => ''<h3>Thank you for your feedback!</h3>'' else @error_message = "Please enter your #{@feedback.subject.to_s.downcase}" render :action => ''new'', :status => :unprocessable_entity end end validation is only on one field, which has a value in the params-hash. model-validations etc are all the same - locally vs server any ideas? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Kendall Gifford
2011-May-18 22:13 UTC
Re: ar - rollback on staging/production - whats causing it?
On Wednesday, May 18, 2011 1:32:39 PM UTC-6, der_tom wrote:> > hi, > > i;m using a easy feedback plugin which works just fine - locally. > > uploading the app to staging production gives me this: > > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:214:in > `rollback_active_record_state!'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in > `save'' > /home/tom/ror/ > fooapp.com/staging/releases/20110517122608/app/controllers/feedbacks_controller.rb:21:in > `create'' >Well, that''s the top of the stack-trace but the actual exception and its message is?> the create method is basically this: > > def create > @feedback = Feedback.new(params[:feedback]) > if logged_in? > @feedback.user_id = current_user.id > end > > if @feedback.valid? > FeedbackMailer.deliver_feedback(@feedback) if > !...@feedback.email.blank? > @feedback.save > render :status => :created, :text => ''<h3>Thank you for your > feedback!</h3>'' > else > @error_message = "Please enter your > #...@feedback.subject.to_s.downcase}" > render :action => ''new'', :status => :unprocessable_entity > end > > end > > > validation is only on one field, which has a value in the params-hash. > model-validations etc are all the same - locally vs server > > > any ideas? >Well, since the code in your action looks simple enough and since we know the error is raised on the @feedback.save call, then I''d focus on why it can''t save. The upshot is that we need more info to help you. What were the values submitted to the action (in the params hash) by the request that failed? What was the actual exception and error message (it''s nice you provided stack trace but we need this too). What is this validation''s code, the one you said the model has "on one field"? What else might be different in your environment between your development and staging production? Does it succeed in production mode on your dev workstation, meaning the problem is specific to _where_ it''s deployed, not the mode? Or, does it always fail in production, regardless of where it''s deployed? Etc. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
hi, here are the missing info: Processing FeedbacksController#create (for 78.42.xyz.xyz at 2011-05-20 09:26:51) [POST] Parameters: {"commit"=>"Send", "authenticity_token"=>"2HzCbBM0J1SfEwIHP/GucR+HPs3fM31ts69llwkQDNc=", "feedback"=>{"comment"=>"test", "subject"=>"Suggestion", "email"=>"myemail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "_"=>""} Sent mail to tom-/K3FCmxHHlvQT0dZR+AlfA@public.gmane.org NoMethodError (undefined method `delete'' for nil:NilClass): app/controllers/feedbacks_controller.rb:22:in `create'' passenger (3.0.2) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'' passenger (3.0.2) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'' passenger (3.0.2) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'' passenger (3.0.2) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'' passenger (3.0.2) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'' passenger (3.0.2) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'' passenger (3.0.2) lib/phusion_passenger/utils.rb:479:in `safe_fork'' passenger (3.0.2) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:357:in `__send__'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:180:in `start'' passenger (3.0.2) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'' passenger (3.0.2) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'' passenger (3.0.2) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'' passenger (3.0.2) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'' passenger (3.0.2) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'' passenger (3.0.2) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'' passenger (3.0.2) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'' passenger (3.0.2) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'' passenger (3.0.2) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:357:in `__send__'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'' passenger (3.0.2) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'' passenger (3.0.2) helper-scripts/passenger-spawn-server:99 any ideas? i really appreciate it thx On Wed, May 18, 2011 at 6:13 PM, Kendall Gifford <zettabyte-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Wednesday, May 18, 2011 1:32:39 PM UTC-6, der_tom wrote: >> >> hi, >> >> i;m using a easy feedback plugin which works just fine - locally. >> >> uploading the app to staging production gives me this: >> >> >> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:214:in >> `rollback_active_record_state!'' >> >> /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in >> `save'' >> >> /home/tom/ror/fooapp.com/staging/releases/20110517122608/app/controllers/feedbacks_controller.rb:21:in >> `create'' > > Well, that''s the top of the stack-trace but the actual exception and its > message is? > >> >> the create method is basically this: >> >> def create >> @feedback = Feedback.new(params[:feedback]) >> if logged_in? >> @feedback.user_id = current_user.id >> end >> >> if @feedback.valid? >> FeedbackMailer.deliver_feedback(@feedback) if >> !...@feedback.email.blank? >> @feedback.save >> render :status => :created, :text => ''<h3>Thank you for your >> feedback!</h3>'' >> else >> @error_message = "Please enter your >> #...@feedback.subject.to_s.downcase}" >> render :action => ''new'', :status => :unprocessable_entity >> end >> >> end >> >> validation is only on one field, which has a value in the params-hash. >> model-validations etc are all the same - locally vs server >> >> any ideas? > > Well, since the code in your action looks simple enough and since we know > the error is raised on the @feedback.save call, then I''d focus on why it > can''t save. The upshot is that we need more info to help you. What were the > values submitted to the action (in the params hash) by the request that > failed? What was the actual exception and error message (it''s nice you > provided stack trace but we need this too). What is this validation''s code, > the one you said the model has "on one field"? What else might be different > in your environment between your development and staging production? Does it > succeed in production mode on your dev workstation, meaning the problem is > specific to _where_ it''s deployed, not the mode? Or, does it always fail in > production, regardless of where it''s deployed? > > Etc. > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2011-May-20 16:49 UTC
Re: Re: ar - rollback on staging/production - whats causing it?
On 20 May 2011 08:33, tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, > > here are the missing info: > > > Processing FeedbacksController#create (for 78.42.xyz.xyz at 2011-05-20 > 09:26:51) [POST] > Parameters: {"commit"=>"Send", > "authenticity_token"=>"2HzCbBM0J1SfEwIHP/GucR+HPs3fM31ts69llwkQDNc=", > "feedback"=>{"comment"=>"test", "subject"=>"Suggestion", > "email"=>"myemail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "_"=>""} > Sent mail to tom-/K3FCmxHHlvQT0dZR+AlfA@public.gmane.org > > > NoMethodError (undefined method `delete'' for nil:NilClass): > app/controllers/feedbacks_controller.rb:22:in `create''The clue is in the error message. At the above line you are presumably calling delete, though that seems a bit odd in create. The object you are calling delete on is nil. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
yes and no - im not calling delete ''manually'' nor do i have coded it into the create method. to me it seems the rollback is doing this, as far as i can trace back the code. anyhow - thx On Fri, May 20, 2011 at 12:49 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 20 May 2011 08:33, tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> hi, >> >> here are the missing info: >> >> >> Processing FeedbacksController#create (for 78.42.xyz.xyz at 2011-05-20 >> 09:26:51) [POST] >> Parameters: {"commit"=>"Send", >> "authenticity_token"=>"2HzCbBM0J1SfEwIHP/GucR+HPs3fM31ts69llwkQDNc=", >> "feedback"=>{"comment"=>"test", "subject"=>"Suggestion", >> "email"=>"myemail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "_"=>""} >> Sent mail to tom-/K3FCmxHHlvQT0dZR+AlfA@public.gmane.org >> >> >> NoMethodError (undefined method `delete'' for nil:NilClass): >> app/controllers/feedbacks_controller.rb:22:in `create'' > > The clue is in the error message. At the above line you are > presumably calling delete, though that seems a bit odd in create. The > object you are calling delete on is nil. > > Colin > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Tom Meinlschmidt
2011-May-20 17:21 UTC
Re: Re: ar - rollback on staging/production - whats causing it?
hi think the best is to use debugger and see what happening here tom On May 20, 2011, at 19:19 , tom wrote:> yes and no - im not calling delete ''manually'' nor do i have coded it > into the create method. to me it seems the rollback is doing this, as > far as i can trace back the code. > anyhow - thx > > > > On Fri, May 20, 2011 at 12:49 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> On 20 May 2011 08:33, tom <tomabroad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> hi, >>> >>> here are the missing info: >>> >>> >>> Processing FeedbacksController#create (for 78.42.xyz.xyz at 2011-05-20 >>> 09:26:51) [POST] >>> Parameters: {"commit"=>"Send", >>> "authenticity_token"=>"2HzCbBM0J1SfEwIHP/GucR+HPs3fM31ts69llwkQDNc=", >>> "feedback"=>{"comment"=>"test", "subject"=>"Suggestion", >>> "email"=>"myemail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "_"=>""} >>> Sent mail to tom-/K3FCmxHHlvQT0dZR+AlfA@public.gmane.org >>> >>> >>> NoMethodError (undefined method `delete'' for nil:NilClass): >>> app/controllers/feedbacks_controller.rb:22:in `create'' >> >> The clue is in the error message. At the above line you are >> presumably calling delete, though that seems a bit odd in create. The >> object you are calling delete on is nil. >> >> Colin >> >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.