Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Stack level too deep' error #512

Closed
brain-geek opened this issue Sep 21, 2011 · 16 comments
Closed

'Stack level too deep' error #512

brain-geek opened this issue Sep 21, 2011 · 16 comments
Labels

Comments

@brain-geek
Copy link

After logging in to activeadmin i have this error:

SystemStackError in Admin/dashboard#index

Showing /home/brain/.rvm/gems/ree-1.8.7-2011.03@shop/gems/activeadmin-0.3.1/app/views/active_admin/dashboard/index.html.arb where line #1 raised:

stack level too deep
Extracted source (around line #1):

1: render view_factory.dashboard_page

Full Trace

actionpack (3.0.10) lib/action_dispatch/testing/test_process.rb:21:in `flash'
actionpack (3.0.10) lib/action_dispatch/testing/test_process.rb:21:in `flash'
activeadmin (0.3.1) lib/active_admin/views/pages/base.rb:92:in `build_flash_messages'
activeadmin (0.3.1) lib/active_admin/views/pages/base.rb:84:in `build_page_content'
activeadmin (0.3.1) lib/active_admin/views/pages/base.rb:41:in `build_page'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:68:in `build_tag'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:96:in `with_current_dom_context'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:67:in `build_tag'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:77:in `insert_tag'
activeadmin (0.3.1) lib/active_admin/arbre/html/element.rb:13:in `div'
activeadmin (0.3.1) lib/active_admin/views/pages/base.rb:38:in `build_page'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:96:in `within'
activeadmin (0.3.1) lib/active_admin/views/pages/base.rb:37:in `build_page'
activeadmin (0.3.1) lib/active_admin/views/pages/base.rb:10:in `build'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:63:in `build_tag'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:77:in `insert_tag'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:41:in `send'
activeadmin (0.3.1) lib/active_admin/arbre/builder.rb:41:in `method_missing'
activeadmin (0.3.1) lib/active_admin/view_helpers/renderer_helper.rb:21:in `render'
activeadmin (0.3.1) app/views/active_admin/dashboard/index.html.arb:1:in `__home_brain__rvm_gems_ree_______________shop_gems_activeadmin_______app_views_active_admin_dashboard_index_html_arb___814747331_108153270_0'
actionpack (3.0.10) lib/action_view/template.rb:135:in `send'
actionpack (3.0.10) lib/action_view/template.rb:135:in `render'
activesupport (3.0.10) lib/active_support/notifications.rb:54:in `instrument'
actionpack (3.0.10) lib/action_view/template.rb:127:in `render'
actionpack (3.0.10) lib/action_view/render/rendering.rb:59:in `_render_template'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.10) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.10) lib/action_view/render/rendering.rb:56:in `_render_template'
actionpack (3.0.10) lib/action_view/render/rendering.rb:26:in `render'
activeadmin (0.3.1) lib/active_admin/view_helpers/renderer_helper.rb:23:in `render'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:115:in `_render_template'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:109:in `render_to_body'
actionpack (3.0.10) lib/action_controller/metal/renderers.rb:47:in `render_to_body'
actionpack (3.0.10) lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:102:in `render_to_string'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:93:in `render'
actionpack (3.0.10) lib/action_controller/metal/rendering.rb:17:in `render'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:40:in `render'
activesupport (3.0.10) lib/active_support/core_ext/benchmark.rb:5:in `ms'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (3.0.10) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
activerecord (3.0.10) lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:39:in `render'
activeadmin (0.3.1) lib/active_admin/dashboards/dashboard_controller.rb:9:in `index'
actionpack (3.0.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.10) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.0.10) lib/abstract_controller/base.rb:150:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/rendering.rb:11:in `process_action'
actionpack (3.0.10) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.0.10) lib/active_support/callbacks.rb:461:in `_run__693338942__process_action__199225275__callbacks'
activesupport (3.0.10) lib/active_support/callbacks.rb:410:in `send'
activesupport (3.0.10) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
activesupport (3.0.10) lib/active_support/callbacks.rb:94:in `send'
activesupport (3.0.10) lib/active_support/callbacks.rb:94:in `run_callbacks'
actionpack (3.0.10) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
activesupport (3.0.10) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.0.10) lib/active_support/notifications.rb:52:in `instrument'
actionpack (3.0.10) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.0.10) lib/abstract_controller/base.rb:119:in `process'
actionpack (3.0.10) lib/abstract_controller/rendering.rb:41:in `process'
actionpack (3.0.10) lib/action_controller/metal.rb:138:in `dispatch'
actionpack (3.0.10) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.0.10) lib/action_controller/metal.rb:178:in `action'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:62:in `call'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.10) lib/action_dispatch/routing/route_set.rb:493:in `call'
sass (3.1.7) lib/sass/./sass/plugin/rack.rb:54:in `call'
warden (1.0.5) lib/warden/manager.rb:35:in `call'
warden (1.0.5) lib/warden/manager.rb:34:in `catch'
warden (1.0.5) lib/warden/manager.rb:34:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.4) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.10) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.10) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.10) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.10) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.10) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.10) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
actionpack (3.0.10) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.4) lib/rack/sendfile.rb:106:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.10) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.4) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.10) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.4) lib/rack/lock.rb:11:in `call'
rack (1.2.4) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.4) lib/rack/lock.rb:11:in `call'
actionpack (3.0.10) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.10) lib/rails/application.rb:168:in `call'
railties (3.0.10) lib/rails/application.rb:77:in `send'
railties (3.0.10) lib/rails/application.rb:77:in `method_missing'
railties (3.0.10) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.4) lib/rack/content_length.rb:13:in `call'
rack (1.2.4) lib/rack/handler/webrick.rb:52:in `service'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:162:in `start'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:95:in `start'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:92:in `each'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:92:in `start'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:23:in `start'
/home/brain/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.4) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.4) lib/rack/server.rb:217:in `start'
railties (3.0.10) lib/rails/commands/server.rb:65:in `start'
railties (3.0.10) lib/rails/commands.rb:30
railties (3.0.10) lib/rails/commands.rb:27:in `tap'
railties (3.0.10) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6

Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.10'
gem 'sqlite3'

gem 'paperclip'
gem 'activeadmin'

gem 'russian'

gem 'state_machine'

gem 'activemerchant'

gem 'modular'
gem 'jammit'


group :development, :test do
  gem 'ruby-debug'
  #gem 'ruby-debug19'

  gem 'autotest-standalone'
  gem 'autotest-rails-pure'

  gem 'rspec-rails', '~> 2.5.0'
  gem 'shoulda'
  gem 'factory_girl_rails'
  gem 'ffaker'

  gem 'webrat'

  gem 'autotest-growl'
end

config/initializers/active_admin.rb is default.

Have tried different versions of activeadmin - both atable and repo, reinstalling it, removing all files from app/admin.

@pcreux
Copy link
Contributor

pcreux commented Sep 21, 2011

Hello,

could you try to reproduce this issue on a vanilla rails app?

Thanks

@sethvargo
Copy link

Also experiencing this... tried on a brand new rails app without using devise

@brain-geek
Copy link
Author

How to reproduce bug: use this snippet https://gist.github.com/313121 for generating paperclip attachments to factory girl.

Problem is in this line:

include ActionDispatch::TestProcess

#157 - looks like same issue:

actionpack (3.0.6) lib/action_dispatch/testing/test_process.rb:21:in flash'
actionpack (3.0.6) lib/action_dispatch/testing/test_process.rb:21:inflash'
activeadmin (0.2.2) lib/active_admin/views/pages/base.rb:89:in build_flash_messages'

How to fix:
Use other method for attaching files in factory girl, for example:

FactoryGirl::DefinitionProxy.class_eval do
  def attach(name, path)
    add_attribute name, File.new(Rails.root.join(path))
  end
end

Factory.define :discount do |a|
  a.attach 'image', 'spec/fixtures/files/caro.png'
end

@jgadbois
Copy link

jgadbois commented Oct 4, 2011

I'm having this issue too

@pcreux
Copy link
Contributor

pcreux commented Oct 5, 2011

This looks similar to #157.

@pcreux
Copy link
Contributor

pcreux commented Oct 5, 2011

@jgadbois One of your dependencies must be including ActionDispatch::TestProcess. Please see comment by @brain-geek above to fix it.

@jgadbois
Copy link

jgadbois commented Oct 6, 2011

Ok looks like the ckeditor gem is including the file for some of its tests:

https://github.com/galetahub/ckeditor/blob/master/test/support/helpers.rb

Isn't this a valid bug though? Should active admin blow up anytime someone uses a gem that includes an ActiveDispatch module?

@jgadbois
Copy link

jgadbois commented Oct 6, 2011

Actually I'm still getting it - this is with all gems mentioning the module taken out (except actionpack)

@fro
Copy link

fro commented Oct 28, 2011

Hi, I'm having this issue too :

  1) Admin logged in as admin should  login as admin
     Failure/Error: Unable to find matching line from backtrace
     ActionView::Template::Error:
       stack level too deep
     # /Users/francois/.rvm/gems/ruby-1.9.2-p290@project/gems/activesupport-3.1.1/lib/active_support/notifications/instrumenter.rb:24

@schmudu
Copy link

schmudu commented Apr 27, 2012

describe RegistrationsController do
    render_views
    it "should respond to build resource" do
       request.env["devise.mapping"] = Devise.mappings[:user]
       #ActionDispatch::Request.any_instance.stub(:remote_ip).and_return("192.168.0.1")
       get 'new'
       response.should be_success
    end
end

Getting the same errors. If I comment out the ActionDispatch line then I no longer get the 'stack level too deep'

@rugginoso
Copy link

This should workaround the bug: http://gist.github.com/4079399

@dominiksteiner
Copy link

For me the culprit was to remove the following line

include ActionDispatch::TestProcess

This means that instead of using

fixture_file_upload('/images/ruby-on-rails.jpg', 'image/jpeg')

As rugginoso posted i would then use

let(:logo) { Rack::Test::UploadedFile.new('spec/fixtures/images/ruby-on-rails.jpg', 'image/jpeg') }

@Rodrigora
Copy link

include ActionDispatch::TestProcess if Rails.env.test?

@tylercollier
Copy link

@Rodrigora's solution works for me.

@javimbk
Copy link

javimbk commented Oct 2, 2014

Same for me, @Rodrigora's solution finally helped me after 2 hours of trying to see where was I failing. Rails didn't tell me it had to do with Factories.

@tylercollier
Copy link

I take it back. I need include ActionDispatch::TestProcess in dev (or thought I did) so I can use mail previews with uploads. I'm now in favor of @dominiksteiner's answer, where I take it out completely and use Rack::Test::UploadedFile.new in place of fixture_file_upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests