Rails unknown action suddenly everywhere
- by Joe
The weird thing is that my app was working perfectly on Sat, and when I check it out on Monday (after doing nothing to it) I kept getting this problem:
This behaviour is only happening on my production server. When I try to login or create a new user or do something that interacts with a form I am getting an unknown action error. A simple retrieval of rows does not throw this error however.
I don't have all CRUD operations in most of my controllers because it's not necessary - but Rails always looks for the one that doesn't exist - it seams so anyway.
If I make a mistake in the form that would normally throw a validation message to the user it will throw this error too, does that mean it has something to do with the model too (I'm not too Rails experienced and didn't know if that would be the case or not)?
This is a general error I am getting - I have super_exception_notifier gem installed, so that's what all the extra params are.
Processing SessionsController#new (for OMITTED at 2010-04-12 09:11:12) [GET]
Rendering template within layouts/application
Rendering sessions/new
Completed in 3ms (View: 2, DB: 0) | 200 OK [http://OMITTED.com/session/new]
Processing SessionsController#show (for OMITTED at 2010-04-12 09:11:14) [GET]
ActionController::UnknownAction (No action responded to show. Actions: create, destroy, error_class_status_codes, error_class_status_codes=, error_layout, error_layout=, exception_notifiable_notification_level, exception_notifiable_notification_level=, exception_notifiable_silent_exceptions, exception_notifiable_silent_exceptions=, exception_notifiable_verbose, exception_notifiable_verbose=, http_status_codes, http_status_codes=, and new):
dragonfly (0.5.3) lib/dragonfly/middleware.rb:13:in `call'
passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
This is what one of my forms looks like (nothing special)
<% form_tag session_path do -%>
<p><%= label_tag 'Username' %><br />
<%= text_field_tag 'login', @login %></p>
<p><%= label_tag 'password' %><br/>
<%= password_field_tag 'password', nil %></p>
<p><%= label_tag 'remember_me', 'Remember me' %>
<%= check_box_tag 'remember_me', '1', @remember_me %></p>
<p><%= submit_tag 'Log in' %></p>
<% end -%>
It looks like dragonfly is the culprit doesn't it, here's the section from the gem files it says is being naughty:
module Dragonfly
class Middleware
def initialize(app, dragonfly_app_name)
@app = app
@dragonfly_app_name = dragonfly_app_name
end
def call(env)
response = endpoint.call(env)
if response[0] == 404
13 -->> @app.call(env)
else
response
end
end
I don't know what goes on behind the scenes here so I probably haven't been looking in the right place to fix this issue. Like I said it only throws this in a production environment, which guess is what the 'env' variable is referencing.
Thank you for your time! I've spent nearly my whole day trying to figure this out! :(