404 mini crash making many mistakes

Miniprofiler gem for rails is very convenient. ( github , railscast )

However, I get many 404 errors in my application:

In the Chrome console, the network tab:

Failed to load the resource: the server responded with a status of 404 (Not found) http://localhost.mysite.com/mini-profiler-resources/results

This page returns the following response: Request not found: - user 127.0.0.1

On each page, I have 9 of these requests. (so it clogs my magazines and it is annoying). And 9 more are displayed every time I run an ajax request.

It seems that the mini profiler is trying to estimate the time of a request that is not happening ... How can I fix this situation?


Update: I noticed that this stone also loads images very slowly. Images have a waiting time (on the network tab), which ranges from 1 to 20 seconds, then they are downloaded. Visually, you see images that appear one after another very slowly.

I tried using development.rb configuration settings ( config.consider_all_requests_local , config.assets.debug , config.cache_classes and config.assets.compress ) without success. I also tried changing my domain (dev.mysite.com with an entry in /etc/hosts , localhost, 127.0.0.1 and localhost: 3000). In each case, the gem makes loading images very slow. If I remove the gem, it will be fast again.

Update 2: Sometimes (and I still don't know why), images load quickly even with a stone after a server restart. So the situation is this:

  • Miniprofiler is included in gemfile => 404 errors, images load slowly in 90% of cases
  • Miniprofile is not included in gemfile => No 404 errors, images load normally
+4
source share
2 answers

rm -fr tmp/miniprofiler worked for me. found it here https://github.com/MiniProfiler/rack-mini-profiler/issues/71

+2
source

This seems to be a rights issue:

I started the server with rvmsudo rails server -p 80 , and this caused miniprofiler to put files in tmp / miniprofiler as root.

Before (with rvmsudo rails server -p 80 ):

 $> ls -la tmp/miniprofiler/mp_timers -rw-r--r-- 1 root root 1427 Aug 31 17:18 tmp/miniprofiler/mp_timers_14p99y... ... 

=> 404 errors and slow images

After: (with rails s )

 $> ls -la tmp/miniprofiler/mp_timers -rw-r--r-- 1 pinouchon staff 1427 Aug 31 17:18 tmp/miniprofiler/mp_timers_14p99y... ... 

=> there are no 404 errors and images that usually load.


The only problem is that I cannot start my server on port 80: it says

 $> rails s -p 80 Exiting /Users/sharewizz/.rvm/gems/ ruby-1.9.3-p392@sharewizz /gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError) from /Users/sharewizz/.rvm/gems/ ruby-1.9.3-p392@sharewizz /gems/eventmachine-1.0.3/lib/eventmachine.rb:526:in `start_server` 

Since only root can run the application on a port less than 1024 ...

+1
source

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


All Articles