How to resolve Rack Lint errors? - ruby-on-rails

I have noticed that certain requests, particularly from Uptime Robot to test page uptime have recently started generated the following Rack Lint error on my Rails 3.1.x app:
21:47:05 web.1 | Started HEAD "/" for 74.86.158.106 at 2012-03-22 21:47:05 -0400
21:47:05 web.1 | Processing by HomeController#index as */*
...
21:47:05 web.1 | /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/activesupport-3.1.4/lib/active_support/core_ext/string/output_safety.rb:23: warning: regexp match /.../n against to UTF-8 string
...
21:47:05 web.1 | Completed 200 OK in 81ms (Views: 60.3ms | ActiveRecord: 0.0ms)
21:47:05 web.1 | 74.86.158.106 - - [22/Mar/2012 21:47:05] "GET / HTTP/1.1" 200 31842 0.1993
21:47:05 web.1 | E, [2012-03-22T21:47:05.546848 #18938] ERROR -- : app error: Content-Length header was 31842, but should be 0 (Rack::Lint::LintError)
21:47:05 web.1 | E, [2012-03-22T21:47:05.546978 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/rack-1.3.6/lib/rack/lint.rb:19:in `assert'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547079 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/rack-1.3.6/lib/rack/lint.rb:501:in `verify_content_length'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547178 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/rack-1.3.6/lib/rack/lint.rb:525:in `each'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547277 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/rack-1.3.6/lib/rack/body_proxy.rb:23:in `method_missing'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547375 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/unicorn-4.2.0/lib/unicorn/http_response.rb:41:in `http_response_write'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547476 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:538:in `process_client'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547574 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:604:in `worker_loop'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547672 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547770 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/unicorn-4.2.0/lib/unicorn/http_server.rb:137:in `start'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547867 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/gems/unicorn-4.2.0/bin/unicorn:121:in `<top (required)>'
21:47:05 web.1 | E, [2012-03-22T21:47:05.547966 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/bin/unicorn:19:in `load'
21:47:05 web.1 | E, [2012-03-22T21:47:05.548063 #18938] ERROR -- : /Users/username/.rvm/gems/ruby-1.9.3-p125#project/bin/unicorn:19:in `<main>'
Any ideas as to what may be going on here? I'm really not finding a solution right now that specifically addresses what to do in this scenario as far as poking and hunting down what really may be going on.

I know it's an old question, but I have the exact same issue. Requests from UptimeRobot and New Relic (and only from IPs from those two) give these log messages.
Both UptimeRobot and NewRelic reports 'OK'.
It seems that it is not the request that Rack::Lint is complaining about, but the response. Look at the stacktrace. It comes through http_response_write of unicorn (I too use unicorn).
I will investigate more and add any findings here.
UPDATE:
I am able to reproduce the issue with
$ curl https://example.com -X HEAD -i
HTTP/1.1 200 OK
Server: nginx/1.6.2 (Ubuntu)
Date: Wed, 18 Nov 2015 09:17:11 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 18422
Connection: keep-alive
Status: 200 OK
...
curl: (18) transfer closed with 18422 bytes remaining to read
So it seems that my old Rails is not supporting HEAD requests properly.
UPDATE: I am not able to reproduce on my vagrant box or on the staging server. Only difference from production I can think of is SSL.

Looks like your Uptime robot is sending a header with the wrong value. It should be sending the Content-length header with a value of 0 (or not sending it at all) but it's sending it with 31842, which is probably wrong.
You could direct it to some other http server, dump all headers and see why it is sending this or just change your uptime robot to not send this header.

Related

Rails 6 blank page when running server

I moved to rails 6 after being developing in rails 5 and I'm getting a misterious error when running rails server. When I go to localhost://3000 the browser shows a blank page and nothing else. Did anybody have the same problem?
Important: This blank page started to show after I installed bootstrap with yarn.
PD: I'm using foreman tu run puma and compile webpacker, but happens the same with rails s command
here are the logs from the server:
10:07:50 web.1 | started with pid 11365
10:07:50 webpacker.1 | started with pid 11366
10:07:52 web.1 | Puma starting in single mode...
10:07:52 web.1 | * Version 4.3.1 (ruby 2.7.0-p0), codename: Mysterious Traveller
10:07:52 web.1 | * Min threads: 5, max threads: 5
10:07:52 web.1 | * Environment: development
10:07:57 webpacker.1 | ℹ 「wds」: Project is running at http://localhost:3035/
10:07:57 webpacker.1 | ℹ 「wds」: webpack output is served from /packs/
10:07:57 webpacker.1 | ℹ 「wds」: Content not from webpack is served from /home/enzo/Ruby/Rails/Aguara/aguara/public/packs
10:07:57 webpacker.1 | ℹ 「wds」: 404s will fallback to /index.html
10:08:06 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/stack.rb:37: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:06 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/static.rb:110: warning: The called method `initialize' is defined here
10:08:07 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:07 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifier' is defined here
10:08:08 web.1 | * Listening on tcp://0.0.0.0:5000
10:08:08 web.1 | Use Ctrl-C to stop
10:08:16 webpacker.1 | ℹ 「wdm」: Hash: c16cbbe009c350199791
10:08:16 webpacker.1 | Version: webpack 4.41.5
10:08:16 webpacker.1 | Time: 18836ms
10:08:16 webpacker.1 | Built at: 05/04/2020 10:08:16 AM
10:08:16 webpacker.1 | Asset Size Chunks Chunk Names
10:08:16 webpacker.1 | js/application-64644ee2e024eff1d7f7.js 1.72 MiB application [emitted] [immutable] application
10:08:16 webpacker.1 | js/application-64644ee2e024eff1d7f7.js.map 1.89 MiB application [emitted] [dev] application
10:08:16 webpacker.1 | js/bootstrap_custom-4a75b3f7b43b52ae2490.js 929 KiB bootstrap_custom [emitted] [immutable] bootstrap_custom
10:08:16 webpacker.1 | js/bootstrap_custom-4a75b3f7b43b52ae2490.js.map 1.04 MiB bootstrap_custom [emitted] [dev] bootstrap_custom
10:08:16 webpacker.1 | manifest.json 738 bytes [emitted]
10:08:16 webpacker.1 | ℹ 「wdm」: Compiled successfully.
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/integer.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/connection_adapters/postgresql/oid/specialized_string.rb:12: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/type/value.rb:8: warning: The called method `initialize' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/messages/rotator.rb:28: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/messages/rotator.rb:6: warning: The called method `initialize' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionview-6.0.2.1/lib/action_view/unbound_template.rb:24: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionview-6.0.2.1/lib/action_view/template.rb:130: warning: The called method `initialize' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activemodel-6.0.2.1/lib/active_model/translation.rb:67: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/i18n-1.7.0/lib/i18n.rb:179: warning: The called method `translate' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/abstract_controller/helpers.rb:67: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_controller/metal/request_forgery_protection.rb:313: warning: The called method `form_authenticity_token' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/railties/collection_cache_association_loading.rb:7: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.1/lib/active_record/railties/collection_cache_association_loading.rb:12: warning: The called method `relation_from_options' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:119: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/sprockets-4.0.0/lib/sprockets/base.rb:78: warning: The called method `find_asset' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionpack-6.0.2.1/lib/action_dispatch/middleware/cookies.rb:635: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/message_encryptor.rb:150: warning: The called method `encrypt_and_sign' is defined here
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/message_encryptor.rb:175: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
10:08:17 web.1 | /home/enzo/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activesupport-6.0.2.1/lib/active_support/messages/metadata.rb:17: warning: The called method `wrap' is defined here
this is the network tab in chrome:
enter image description here
After a hard debbuging I finally have found that the yield tag was the problem, now my app is working again haha

puma server is not starting in SSL mode

I am starting puma server like below
puma -b ssl://sstp.localhost.domain.com:7000?key=/private/etc/apache2/ssl/sstp.localhost.domain.com.key&cert=/private/etc/apache2/ssl/sstp.localhost.domain.com.crt
but it is serving content only in http mode.
on requesting
https://sstp.localhost.domain.com:7000/path/file.js
I get the error
This site can’t provide a secure connection
sstp.localhost.domain.com sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
I have used open ssl to self sign the certificate
I am using puma 1.6.3 as recommended.I was using 2.8 earlier, downgraded now as recommended by this thread https://github.com/puma/puma/issues/350
I am using google chrome browser, the response is same on every browser
Note: I use ramaze a framework for mocking purpose (http://ramaze.net/), Ramaze starts Webrick in port 7000 hence am tied to use port 7000
The logs read like below
$ puma
W [2016-09-01 10:22:56 $2082] WARN | : No explicit root folder found, assuming it is /Users/<username>/path/mock-server
D [2016-09-01 10:22:56 $2082] DEBUG | : Using webrick
I [2016-09-01 10:22:56 $2082] INFO | : WEBrick 1.3.1
I [2016-09-01 10:22:56 $2082] INFO | : ruby 2.1.1 (2014-02-24) [x86_64-darwin12.0]
D [2016-09-01 10:22:56 $2082] DEBUG | : Rack::Handler::WEBrick is mounted on /.
I [2016-09-01 10:22:56 $2082] INFO | : WEBrick::HTTPServer#start: pid=2082 port=7000
D [2016-09-01 10:23:04 $2082] DEBUG | : accept: 127.0.0.1:50218
D [2016-09-01 10:23:04 $2082] DEBUG | : accept: 127.0.0.1:50217
E [2016-09-01 10:23:04 $2082] ERROR | : bad URI `?\x13?'.
E [2016-09-01 10:23:04 $2082] ERROR | : bad URI `?\x13?'.
localhost - - [01/Sep/2016:10:23:04 BST] "\x16\x03\x01\x00?\x01\x00\x00?\x03\x03?T?e\x1D?6?\x04?C??\x16???\x06!Vjm??\x1AW&p(??\x04\x00\x00"?+?/?,?0̨̩?\x14?\x13?\t?\x13?" 400 290
- -> ?\x13?
D [2016-09-01 10:23:04 $2082] DEBUG | : close: 127.0.0.1:50217
localhost - - [01/Sep/2016:10:23:04 BST] "\x16\x03\x01\x00?\x01\x00\x00?\x03\x03?Pi'Zߑ\x04!/?\x13m??#?M?f?)?4?d??4$١\x00\x00"?+?/?,?0̨̩?\x14?\x13?\t?\x13?" 400 290
- -> ?\x13?
D [2016-09-01 10:23:04 $2082] DEBUG | : close: 127.0.0.1:50218
D [2016-09-01 10:23:07 $2082] DEBUG | : accept: 127.0.0.1:50220
D [2016-09-01 10:23:07 $2082] DEBUG | : accept: 127.0.0.1:50221
E [2016-09-01 10:23:07 $2082] ERROR | : bad Request-Line `\x16\x03\x01\x00?\x01\x00\x00?\x03\x03?yiS\x7Ff??݄[???3I-Z\a\t?L??>C?Ŧ???\x00\x00"?+?/?,?0̨̩?\x14?\x13?\t?\x13?'.
E [2016-09-01 10:23:07 $2082] ERROR | : bad URI `?\x13?'.
localhost - - [01/Sep/2016:10:23:07 BST] "\x16\x03\x01\x00?\x01\x00\x00?\x03\x03P1?\x00V?0?r???y/??:;???҈y?s?c?G\x17?\x00\x00"?+?/?,?0̨̩?\x14?\x13?\t?\x13?" 400 290
- -> ?\x13?

rails 4.2 can't see db queries in heroku logs even though log_level set to :debug

Here is a project I'm working on: https://github.com/homanchou/the_drawing_challenge
I'm having trouble seeing any db queries in the server logs on heroku or even locally in the terminal when running Puma with Foreman.
All I see are asset or web requests
21:54:34 web.1 | started with pid 54784
21:54:35 web.1 | [54784] Puma starting in cluster mode...
21:54:35 web.1 | [54784] * Version 2.10.2 (ruby 2.1.5-p273), codename: Robots on Comets
21:54:35 web.1 | [54784] * Min threads: 1, max threads: 4
21:54:35 web.1 | [54784] * Environment: development
21:54:35 web.1 | [54784] * Process workers: 2
21:54:35 web.1 | [54784] * Preloading application
21:54:36 web.1 | [54784] * Listening on tcp://0.0.0.0:5000
21:54:36 web.1 | [54784] Use Ctrl-C to stop
21:54:36 web.1 | [54784] - Worker 0 (pid: 54785) booted, phase: 0
21:54:36 web.1 | [54784] - Worker 1 (pid: 54786) booted, phase: 0
21:54:43 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:43 -0700] "GET / HTTP/1.1" 200 - 0.3120
21:54:43 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:43 -0700] "GET /logo_header.png HTTP/1.1" 304 - 0.0079
21:54:45 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:45 -0700] "GET /challenges/8 HTTP/1.1" 200 - 0.0443
21:54:45 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:45 -0700] "GET /logo_header.png HTTP/1.1" 304 - 0.0067
I had to add another line to the Procfile log: tail -f -n 0 log/development.log to see logs or errors in stdout of foreman start like I normally do, but that only works locally and not on heroku unless I want to scale up a process for that tailing.
In my other rails project I can see the db queries fine, even on heroku I can see the db queries in the log:
2015-04-03T03:46:40.052067+00:00 app[web.1]: Started GET "/api/notifications/unread_count" for 97.93.34.8 at 2015-04-03 03:46:40 +0000
2015-04-03T03:46:40.070865+00:00 app[web.1]: Merchant Load (2.7ms) SELECT "merchants".* FROM "merchants" WHERE "merchants"."id" = $1 ORDER BY "merchants"."id" ASC LIMIT 1 [["id", 7502]]
2015-04-03T03:46:40.085454+00:00 app[web.1]: SQL (2.3ms) UPDATE "merchants" SET "updated_at" = '2015-04-03 03:46:40.074442', "last_active_at" = '2015-04-03 03:46:40.074442' WHERE "merchants"."id" = $1 [["id", 7502]]
2015-04-03T03:46:40.101382+00:00 app[web.1]: (2.3ms) SELECT COUNT(*) FROM "notifications" WHERE "notifications"."merchant_id" = $1 AND "notifications"."state" = $2 [["merchant_id", 7502], ["state", "unread"]]
2015-04-03T03:46:40.058083+00:00 app[web.1]: Processing by NotificationsController#unread_count as JSON
2015-04-03T03:46:40.073916+00:00 app[web.1]: (1.0ms) BEGIN
2015-04-03T03:46:40.093737+00:00 app[web.1]: (7.4ms) COMMIT
2015-04-03T03:46:40.102858+00:00 app[web.1]: Completed 200 OK in 45ms (Views: 0.2ms | ActiveRecord: 15.6ms)
I tried comparing the two and even copying over some environment configurations but I still can't figure it out. I've tried setting config.log_level = :debug on the production environment. I can see db queries in the ruby console, but not the heroku or local puma stdout in the terminal. What am I missing?
If you need to use puma for websockets etc try adding
ActiveRecord::Base.logger.level = Logger::DEBUG
to your environments.rb or environments/production

Log output too verbose - how to change log level?

I'm trying to debug my simple Rails app and find navigating and printing with puts works well but the log in Bash is way too verbose. I've looked through lots of questions/responses here and have tried some of them but without success. I tried importing the quiet_assets Gem with
gem 'quiet_assets', group: :development
and have tried changing log levels to :error in production.rb
config.log_level = Logger::error
But I still get all the GET requests of Assets when navigating making review of logs difficult.
Worth noting I've tried restarting the server and ran bundle just in case. I did hard refresh even though browser cache shouldn't have anything to do with this.
Here's example navigation:
20:08:55 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:55] "GET /application.js HTTP/1.1" 304 - 0.0185
20:08:55 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:55] "GET /application.css HTTP/1.1" 304 - 0.0790
20:08:56 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:56] "GET /brands/46 HTTP/1.1" 304 - 0.0111
20:08:56 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:56] "GET /application.js HTTP/1.1" 304 - 0.0062
20:08:56 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:56] "GET /application.css HTTP/1.1" 304 - 0.0066
20:08:57 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:57] "GET /brands/46 HTTP/1.1" 304 - 0.0105
20:08:57 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:57] "GET /application.js HTTP/1.1" 304 - 0.0056
20:08:57 web.1 | 127.0.0.1 - - [22/Oct/2014 20:08:57] "GET /application.css HTTP/1.1" 304 - 0.0063
20:09:13 web.1 | E, [2014-10-22T20:09:13.695412 #5880] ERROR -- : worker=0 PID:5916 timeout (16s > 15s), killing
20:09:13 web.1 | E, [2014-10-22T20:09:13.704183 #5880] ERROR -- : reaped #<Process::Status: pid 5916 SIGKILL (signal 9)> worker=0
20:09:13 web.1 | I, [2014-10-22T20:09:13.710805 #5923] INFO -- : worker=0 ready
It seems you are seeing production log, are you? if that is the case quiet_assets should be included in production too.
gem 'quiet_assets'

Unknown slow process of requests

The behaviour is: the browser hangs keep loading without any response back.
Please see the following log.
I, [2014-07-16T14:14:09.766062 #11713] INFO -- : Started GET "/somepage" for xxx.xxx.xxx.xxx at 2014-07-16 14:14:09 +0800
I, [2014-07-16T14:14:40.872411 #31111] INFO -- : Started GET "/" for yyy.yyy.yyy.yyy at 2014-07-16 14:14:40 +0800
I, [2014-07-16T14:14:40.874968 #31111] INFO -- : Processing by HomeController#index as */*
I, [2014-07-16T14:14:40.893189 #31111] INFO -- : Rendered ...
I, [2014-07-16T14:14:40.901553 #31111] INFO -- : Completed 200 OK in 26ms (Views: 22.5ms | ActiveRecord: 2.6ms)
... more other requests handled normally
I, [2014-07-16T14:29:35.395493 #11713] INFO -- : Processing by HomeController#somepage as HTML
I, [2014-07-16T14:29:35.403614 #11713] INFO -- : Rendered home/somepage.html.erb (1.5ms)
I, [2014-07-16T14:29:35.403762 #11713] INFO -- : Completed 200 OK in 8ms (Views: 5.0ms | ActiveRecord: 0.5ms)
In between the "Started GET ..." and "Processing by" logs, the rails app can handle other requests normally. However, the 2 logs (should be from the same request) have around 15mins gap.
Server: Apache with passenger
Database: Mysql using mysql2 adapter
I completely lost and have no clues what is the root cause....
I faced this similar kind of issue where the browser kept on loading with no logs in the log file.And what i found out was that we have mistakenly written find.all in one of our model as during testing it only had 1000 records as compared to production with more than 1 million records.so changing it to batch records/pagination resolved it.
...........Hope this might help you.

Resources