GithubHelp home page GithubHelp logo

Comments (10)

wojtha avatar wojtha commented on June 21, 2024 5

@SamSaffron I put together solutions from @emaillenin @zapo and I'm able to finally use Oj and Miniprofiler together. Thank you guys!

Gemfile

gem 'rack-mini-profiler', group: 'development', require: false 

config/initializers/miniprofiler.rb

if Rails.env.development?
  require 'rack-mini-profiler'

  # Fix circular ref conflict with Oj.mimic_json
  module Rack
    class MiniProfiler
      module TimerStruct
        class Base
          def as_json
            @attributes
          end
        end
      end
    end
  end

  # Initialization is skipped so trigger it
  Rack::MiniProfilerRails.initialize!(Rails.application)
end

from rack-mini-profiler.

dgynn avatar dgynn commented on June 21, 2024 1

The circular dependency was removed in #250 and is fixed on master. This issue can probably be closed.

from rack-mini-profiler.

SamSaffron avatar SamSaffron commented on June 21, 2024

Can I see the full backtrace?

from rack-mini-profiler.

emaillenin avatar emaillenin commented on June 21, 2024

Sadly this is the only trace that is printed in the log. Here is the complete log of a single request after enabling rack-mini-profiler gem and its initializer:

As mentioned earlier, the lat few lines does not appear if I remove the rack-mini-profiler gem and its initializer code. I am not really sure why the trace is incomplete. Also the trace does not have any files related to your gem.

  duggout (master) rails server -p 3113                                                                                                                                                                     
=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3113
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
/Users/leninraj/.rvm/gems/ruby-2.1.2/gems/merit-2.1.2/lib/merit.rb:83: warning: already initialized constant Merit::AppBadgeRules
/Users/leninraj/.rvm/gems/ruby-2.1.2/gems/merit-2.1.2/lib/merit.rb:83: warning: previous definition of AppBadgeRules was here
/Users/leninraj/.rvm/gems/ruby-2.1.2/gems/merit-2.1.2/lib/merit.rb:84: warning: already initialized constant Merit::AppPointRules
/Users/leninraj/.rvm/gems/ruby-2.1.2/gems/merit-2.1.2/lib/merit.rb:84: warning: previous definition of AppPointRules was here
[2014-12-02 18:03:04] INFO  WEBrick 1.3.1
[2014-12-02 18:03:04] INFO  ruby 2.1.2 (2014-05-08) [x86_64-darwin13.0]
[2014-12-02 18:03:04] INFO  WEBrick::HTTPServer#start: pid=66772 port=3113


Started GET "/" for 127.0.0.1 at 2014-12-02 18:03:05 +0530
  ActiveRecord::SchemaMigration Load (0.7ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Processing by IndexController#index as HTML
  Lookup Load (1.5ms)  SELECT  "lookups".* FROM "lookups"  WHERE "lookups"."lkp_type" = 'homepage_items' AND (name_1 = 'image_main')  ORDER BY "lookups"."id" ASC LIMIT 1
  Lookup Load (0.9ms)  SELECT  "lookups".* FROM "lookups"  WHERE "lookups"."lkp_type" = 'homepage_items' AND (name_1 = 'side_1')  ORDER BY "lookups"."id" ASC LIMIT 1
  Lookup Load (0.8ms)  SELECT  "lookups".* FROM "lookups"  WHERE "lookups"."lkp_type" = 'homepage_items' AND (name_1 = 'list_main')  ORDER BY "lookups"."id" ASC LIMIT 1
  Page Load (0.9ms)  SELECT  "pages".* FROM "pages"  WHERE "pages"."url_code" = 'silly-point' LIMIT 1
  Page Load (1.0ms)  SELECT  "pages".* FROM "pages"  WHERE "pages"."url_code" = 'news' LIMIT 1
  Post Load (1.4ms)  SELECT "posts".* FROM "posts"  WHERE "posts"."id" IN (5, 6, 7)
  Category Load (1.3ms)  SELECT "categories".* FROM "categories"  WHERE "categories"."id" IN (15, 1, 10)
  Post Load (0.8ms)  SELECT  "posts".* FROM "posts"  WHERE "posts"."id" = $1 LIMIT 1  [["id", 6]]
  Category Load (1.2ms)  SELECT "categories".* FROM "categories"  WHERE "categories"."id" IN (1)
  Post Load (1.1ms)  SELECT "posts".* FROM "posts"  WHERE "posts"."id" IN (1, 2, 3, 4, 5, 6, 7)
  Category Load (1.2ms)  SELECT "categories".* FROM "categories"  WHERE "categories"."id" IN (17, 1, 10, 15)
  Post Load (1.6ms)  SELECT  "posts".* FROM "posts" INNER JOIN "posties" ON "posts"."id" = "posties"."post_id" WHERE "posties"."target_id" = $1 AND "posties"."target_type" = $2  ORDER BY created_at DESC LIMIT 1  [["target_id", 3], ["target_type", "Page"]]
  Post Load (1.6ms)  SELECT  "posts".* FROM "posts" INNER JOIN "posties" ON "posts"."id" = "posties"."post_id" WHERE "posties"."target_id" = $1 AND "posties"."target_type" = $2  ORDER BY created_at DESC LIMIT 10  [["target_id", 3], ["target_type", "Page"]]
  Category Load (5.7ms)  SELECT  "categories".* FROM "categories"  WHERE "categories"."id" = $1 LIMIT 1  [["id", 1]]
  Category Load (1.9ms)  SELECT  "categories".* FROM "categories"  WHERE "categories"."id" = $1 LIMIT 1  [["id", 10]]
  CACHE (0.0ms)  SELECT  "categories".* FROM "categories"  WHERE "categories"."id" = $1 LIMIT 1  [["id", 1]]
  Post Load (1.1ms)  SELECT  "posts".* FROM "posts" INNER JOIN "posties" ON "posts"."id" = "posties"."post_id" WHERE "posties"."target_id" = $1 AND "posties"."target_type" = $2  ORDER BY created_at DESC LIMIT 1  [["target_id", 2], ["target_type", "Page"]]
  Post Load (0.8ms)  SELECT  "posts".* FROM "posts" INNER JOIN "posties" ON "posts"."id" = "posties"."post_id" WHERE "posties"."target_id" = $1 AND "posties"."target_type" = $2  ORDER BY created_at DESC LIMIT 10  [["target_id", 2], ["target_type", "Page"]]
  Category Load (0.9ms)  SELECT  "categories".* FROM "categories"  WHERE "categories"."id" = $1 LIMIT 1  [["id", 3]]
  Category Load (0.9ms)  SELECT  "categories".* FROM "categories"  WHERE "categories"."id" = $1 LIMIT 1  [["id", 15]]
  Rendered partials/opencricket/_open_cricket_recent.html.erb (1.0ms)
  Rendered index/index.html.erb within layouts/application (345.6ms)
  Rendered partials/opencricket/_search.html.erb (0.8ms)
  Lookup Load (1.5ms)  SELECT  "lookups".* FROM "lookups"  WHERE "lookups"."lkp_type" = 'homepage_items' AND (name_1 = 'series_list')  ORDER BY "lookups"."id" ASC LIMIT 1
  Series Load (1.4ms)  SELECT "series".* FROM "series"  WHERE "series"."id" IN (1, 2, 3, 8, 9, 10)
  Post Load (1.4ms)  SELECT  "posts".* FROM "posts"  WHERE (post_type = 4)  ORDER BY created_at DESC LIMIT 5
  Category Load (1.0ms)  SELECT  "categories".* FROM "categories"  WHERE "categories"."id" = $1 LIMIT 1  [["id", 13]]
  Rendered layouts/_menu.html.erb (35.7ms)
  Rendered layouts/_header.html.erb (43.3ms)
  Rendered layouts/_footer.html.erb (1.1ms)
Completed 200 OK in 1132ms (Views: 1027.8ms | ActiveRecord: 53.9ms)


Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/font-awesome.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/jquery-ui/datepicker.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/jquery-ui/core.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/select2.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/jquery-ui/theme.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/select2-bootstrap.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/parsley.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/nv.d3.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/desktop/960.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/desktop/base.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/desktop/flexslider.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/desktop/fontello.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/desktop/forms.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:06 +0530


Started GET "/assets/desktop/grounds.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/header.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/index.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/matches.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/megamenu.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/mixins.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/players.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/posts.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/scaffold.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/series.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/style.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/superfish.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/teams.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/typeahead-override.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/typeaheadjs.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/ui.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/desktop/variables.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery.turbolinks.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/typeahead.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/core.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/widget.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/accordion.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/tabs.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/position.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/tooltip.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/jquery-ui/datepicker.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/tinymce/preinit.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/tinymce-jquery.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/select2.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/js-routes.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/parsley.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/underscore.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/backbone.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/d3.min.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/nv.d3.min.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/duggout.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/templates/commentaries/addCommentary.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/templates/commentaries/index.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/templates/commentaries/item.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/models/commentary.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/collections/commentaries.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/views/commentaries/commentaries_index.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/views/commentaries/commentaries_item.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/views/commentaries/commentaries_new.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:07 +0530


Started GET "/assets/routers/commentaries_router.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery-ui/button.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery-ui/mouse.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery-ui/draggable.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery-ui/resizable.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery-ui/dialog.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery-ui/sortable.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/base.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/batch_actions.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/checkbox-toggler.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/dropdown-menu.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/flash.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/has_many.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/modal_dialog.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/popover.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/lib/table-checkbox-toggler.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/ext/jquery-ui.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/ext/jquery.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin/application.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/active_admin.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/carouFredSel.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/customM.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/facebook_sdk.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/flexslider.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/global.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/grounds.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/index.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/jquery.easing.1.3.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/matches.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/mobilemenu.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/mypassion.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/posts.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/series.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/superfish.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/teams.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/__meta_request/ba6f2ffb-eba2-405b-a815-f75213cde14c.json" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/479.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/duggout_helmet_logo.png" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/1000.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/767.css?body=1" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/fontawesome-webfont.woff" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/futura_today_demibold.ttf" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/futura_today_bold.ttf" for 127.0.0.1 at 2014-12-02 18:03:08 +0530


Started GET "/assets/slider-nav.png" for 127.0.0.1 at 2014-12-02 18:03:08 +0530
[2014-12-02 18:03:10] ERROR SystemStackError: stack level too deep
    /Users/leninraj/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/set.rb:81
[2014-12-02 18:03:10] ERROR SystemStackError: stack level too deep
    /Users/leninraj/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/set.rb:81
[2014-12-02 18:03:10] ERROR SystemStackError: stack level too deep
    /Users/leninraj/.rvm/gems/ruby-2.1.2/bundler/gems/activesupport-json_encoder-072ab26faeaa/lib/active_support/json/encoding/active_support_encoder.rb:17

from rack-mini-profiler.

wesleyer avatar wesleyer commented on June 21, 2024

This is what I'm getting.
Not sure if this is the same issue.

SystemStackError - stack level too deep:

11:14:08 web.1       |   rack-mini-profiler (0.9.2) lib/mini_profiler/page_timer_struct.rb:53:in `generate'
11:14:08 web.1       |   rack-mini-profiler (0.9.2) lib/mini_profiler/page_timer_struct.rb:53:in `to_json'
11:14:08 web.1       |   rack-mini-profiler (0.9.2) lib/mini_profiler/profiler.rb:121:in `serve_results'
11:14:08 web.1       |   rack-mini-profiler (0.9.2) lib/mini_profiler/profiler.rb:144:in `serve_html'
11:14:08 web.1       |   rack-mini-profiler (0.9.2) lib/mini_profiler/profiler.rb:201:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/deflater.rb:25:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   versionist (1.3.0) lib/versionist/middleware.rb:39:in `_call'
11:14:08 web.1       |   versionist (1.3.0) lib/versionist/middleware.rb:17:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
11:14:08 web.1       |   warden (1.2.3) lib/warden/manager.rb:34:in `catch'
11:14:08 web.1       |   warden (1.2.3) lib/warden/manager.rb:34:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/etag.rb:23:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/conditionalget.rb:35:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/head.rb:11:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/flash.rb:241:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) 
lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
11:14:08 web.1       |   rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/cookies.rb:486:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   activerecord (4.0.13) lib/active_record/query_cache.rb:36:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   activerecord (4.0.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   activerecord (4.0.13) lib/active_record/migration.rb:373:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
11:14:08 web.1       |   activesupport (4.0.13) lib/active_support/callbacks.rb:373:in `_run__2791909282382737623__call__callbacks'
11:14:08 web.1       |   activesupport (4.0.13) lib/active_support/callbacks.rb:80:in `run_callbacks'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/reloader.rb:64:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   better_errors (2.1.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
11:14:08 web.1       |   better_errors (2.1.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
11:14:08 web.1       |   better_errors (2.1.1) lib/better_errors/middleware.rb:57:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   railties (4.0.13) lib/rails/rack/logger.rb:38:in `call_app'
11:14:08 web.1       |   railties (4.0.13) lib/rails/rack/logger.rb:20:in `block in call'
11:14:08 web.1       |   activesupport (4.0.13) lib/active_support/tagged_logging.rb:68:in `block in tagged'
11:14:08 web.1       |   activesupport (4.0.13) lib/active_support/tagged_logging.rb:26:in `tagged'
11:14:08 web.1       |   activesupport (4.0.13) lib/active_support/tagged_logging.rb:68:in `tagged'
11:14:08 web.1       |   railties (4.0.13) lib/rails/rack/logger.rb:20:in `call'
11:14:08 web.1       |   quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/request_id.rb:21:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/runtime.rb:17:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   activesupport (4.0.13) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/lock.rb:17:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   actionpack (4.0.13) lib/action_dispatch/middleware/static.rb:84:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
11:14:08 web.1       |   rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
11:14:08 web.1       |   rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
11:14:08 web.1       |   rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
11:14:08 web.1       |   rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   rack-timeout (0.1.1) lib/rack/timeout.rb:104:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   railties (4.0.13) lib/rails/engine.rb:511:in `call'
11:14:08 web.1       |   railties (4.0.13) lib/rails/application.rb:97:in `call'
11:14:08 web.1       |   newrelic_rpm (3.9.9.275) lib/new_relic/agent/instrumentation/middleware_tracing.rb:57:in `call'
11:14:08 web.1       |   passenger (4.0.57) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
11:14:08 web.1       |   passenger (4.0.57) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
11:14:08 web.1       |   passenger (4.0.57) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
11:14:08 web.1       |   passenger (4.0.57) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
11:14:08 web.1       | App 29025 stderr: cache: [POST /mini-profiler-resources/results] invalidate, pass

from rack-mini-profiler.

akshetpandey avatar akshetpandey commented on June 21, 2024

+1. The ruby process hangs in what seems like an infinite loop. and the POST for result never returns, making both the server and the gem unusable.

INFO  : Started POST "/mini-profiler-resources/results" for 127.0.0.1 at 2015-01-19 19:55:01 +0530
FATAL : 
SystemStackError - stack level too deep:
  actionpack (4.1.6) lib/action_dispatch/middleware/reloader.rb:79:in `'

INFO  : Started POST "/mini-profiler-resources/results" for 127.0.0.1 at 2015-01-19 19:55:02 +0530
FATAL : 
SystemStackError - stack level too deep:
  actionpack (4.1.6) lib/action_dispatch/middleware/reloader.rb:79:in `'

This issue is with the fact that I am using OJ and oj_mimic_json and OJ doesn't handle circular dependency.

from rack-mini-profiler.

seanlinsley avatar seanlinsley commented on June 21, 2024

Ruby's JSON serialization doesn't handle circular references, which is why another gem I've worked on included their own implementation.

Though in this situation we control all of the data, so we should be able to get rid of the circular reference instead of resorting to that.

from rack-mini-profiler.

zapo avatar zapo commented on June 21, 2024

I fixed it naively by monkey patching TimerStruct::Base with this rails'ism

module Rack
  class MiniProfiler
    module TimerStruct
      class Base
        def as_json
          @attributes
        end
      end
    end
  end
end

from rack-mini-profiler.

kbrock avatar kbrock commented on June 21, 2024

So is the thought to add this monkey patch directly to the source? Or to put in a patch to oj? Or modify our data structure to remove the circular dependency?

from rack-mini-profiler.

peterkeen avatar peterkeen commented on June 21, 2024

Bump. I would lean toward removing the circular dependency.

from rack-mini-profiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.