Mysterious GET Request from a Rails Application

I see a strange thing when I start the server for my Rails application. This is the log:

Jatins-MacBook-Pro: silverSpoon$ rails s => Booting Thin => Rails 3.2.8 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server >> Thin web server (v1.5.0 codename Knife) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:3000, CTRL+C to stop Started GET "/app/update-progress" for 127.0.0.1 at 2013-05-19 15:04:56 +0530 Connecting to database specified by database.yml ActionController::RoutingError (No route matches [GET] "/app/update-progress"): actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:in `call' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call' rack (1.4.1) lib/rack/methodoverride.rb:21:in `call' rack (1.4.1) lib/rack/runtime.rb:17:in `call' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.4.1) lib/rack/lock.rb:15:in `call' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call' railties (3.2.8) lib/rails/engine.rb:479:in `call' railties (3.2.8) lib/rails/application.rb:223:in `call' rack (1.4.1) lib/rack/content_length.rb:14:in `call' railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call' thin (1.5.0) lib/thin/connection.rb:81:in `block in pre_process' thin (1.5.0) lib/thin/connection.rb:79:in `catch' thin (1.5.0) lib/thin/connection.rb:79:in `pre_process' thin (1.5.0) lib/thin/connection.rb:54:in `process' thin (1.5.0) lib/thin/connection.rb:39:in `receive_data' eventmachine (1.0.1) lib/eventmachine.rb:187:in `run_machine' eventmachine (1.0.1) lib/eventmachine.rb:187:in `run' thin (1.5.0) lib/thin/backends/base.rb:63:in `start' thin (1.5.0) lib/thin/server.rb:159:in `start' rack (1.4.1) lib/rack/handler/thin.rb:13:in `run' rack (1.4.1) lib/rack/server.rb:265:in `start' railties (3.2.8) lib/rails/commands/server.rb:70:in `start' railties (3.2.8) lib/rails/commands.rb:55:in `block in <top (required)>' railties (3.2.8) lib/rails/commands.rb:50:in `tap' railties (3.2.8) lib/rails/commands.rb:50:in `<top (required)>' script/rails:6:in `require' script/rails:6:in `<main>' Rendered /Users/silverSpoon/.rvm/gems/ ruby-1.9.3-p194@fbTracker /gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.3ms) 

And then the request is repeated. Please help me find the reason for this behavior and how to fix it.

The output of rake:routes :

 bash-3.2$ rake routes trackers /trackers(.:format) tracker#index root / home#index users POST /users(.:format) users#create edit_user GET /users/:id/edit(.:format) users#edit user GET /users/:id(.:format) users#show PUT /users/:id(.:format) users#update DELETE /users/:id(.:format) users#destroy /auth/:provider/callback(.:format) sessions#create auth_failure /auth/failure(.:format) :controller#:action signout /signout(.:format) sessions#destroy /online/:id(.:format) users#function 

Please let me know if you need more information.

+4
source share
2 answers

There is no path to /app/update_progress in your application. So this is one of the following that calls this in your application:

  • Javascript code in your application (you use this bootstrap start page randomly))

    To check if this is the source of the problem, open the Chrome Developer Tools and go to the Network panel. Now open the localhost:3000 application. If you see consistent calls on this Network tab on localhost:3000/app/update_progress , then your application launches these requests from Javascript. Now you need to find your codebase to find out where this javascript code is. It could be inside some jquery extension that you also downloaded. You can create a breakpoint in Javascript whenever an Ajax request is made before /app/update_progress .

  • Xrome / firefox extension

    To eliminate this, open Chrome / Firefox in incognito mode (which usually disables all extensions) and open the application. If you still see the hits /app/update_progress , then most likely this is not an extension that causes problems.

  • Some external gems that you use

    If the above two do not materialize, then post your gemfile.

+5
source

I'm not sure what your question is.

When you start your server, it receives a request for

 http://127.0.0.1:3000/app/update-progress 

but there is no route for this request (Rails does not know what to do with this request), so you get this error.

To process this request, add a route:

 match '/app/update-progress/' => 'some#action' 

To learn more about the request, view the request object inside the action.

0
source

Source: https://habr.com/ru/post/1481602/


All Articles