Comments (18)
I have a fix. 🎉 I'll get it cleaned up and released on Monday. Thanks for your patience on this issue!
from goldiloader.
Thank you @vleango and @ricsdeol! I was able to reproduce the problem in the goldiloader test suite by directly accessing ActiveStorage::Attachment
so I should be able to get to the bottom of this now.
from goldiloader.
Thanks for the bug report @Ad1n. I agree goldiloader should either properly handle eager loading of these associations (at least the DB part) or automatically disable auto eager loading on them. I'll try to take a look this week or next week. If you're up for it, a reproducible test case (either using the goldiloader tests or the Rails test case template) would definitely speed this process up.
from goldiloader.
Here is a hack to disable Goldi-loading for the ActiveStorage::Attachment blob relationship. Add an initializer called "config/initializers/goldiloader.rb":
Rails.application.config.to_prepare do
# This fixes a stack-level-too-deep-error when Goldiloader tries to preload the blob-relationship
ActiveStorage::Attachment._reflections.fetch("blob").instance_variable_set(:@scope, proc { |*args| auto_include(false) })
end
from goldiloader.
I have the same problem, when I find an Attachment, like @attachment = ActiveStorage::Attachment..find(params[:id])
and call @attachment.record
or @attachment.purge
Log:
[3] pry(#<ActiveStorage::AttachmentsController>)> @attachment.record
SystemStackError: stack level too deep
from /home/ricsdeol/.asdf/installs/ruby/2.6.6/lib/ruby/gems/2.6.0/gems/goldiloader-4.0.0/lib/goldiloader/active_record_patches.rb:21:in `new'
[4] pry(#<ActiveStorage::At
from goldiloader.
@jturkel I just updated and it worked out great! Thank you!
from goldiloader.
Sry but i have a little of time...
You could easy build the test case by only adding active storage to any project and try to add something to storage with active goldiloader in project.
Very thankful for your feedback.
Goldi is full of benefits.
from goldiloader.
Is there any solution to this? I just ran into the issue as well.
from goldiloader.
@kaspernj - Glad you figured out a workaround. I'd love to get this fixed properly in goldiloader but first I need a failing test. The testing setup to get ActiveStorage working is a bit complicated because goldiloader's tests don't rely on a full Rails application setup. I spent some time reviving my old activestorage branch and made some good progress but don't yet have a reproducible test case. You can see my latest progress here. Hopefully I'll have sometime in the next few weeks to get it working but any help would be appreciated.
from goldiloader.
@jturkel I just tried to fork the library and get your tests to fail here as well with no luck. I don't have experience with the code for Goldiloader, so it can be quite hard for me to imagine what the difference could be when running in my app and when running the specs in Goldiloader.
I can provide a stack trace when it fails in my app?
from goldiloader.
The stacktrace would be really useful.
from goldiloader.
Here is some of the stack trace with three repeats:
...
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:155:in `find_target'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/association.rb:161:in `load_target'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/association.rb:66:in `reload'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/singular_association.rb:9:in `reader'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/builder/association.rb:100:in `blob'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activemodel-6.0.2.2/lib/active_model/attribute_methods.rb:448:in `respond_to?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activemodel-6.0.2.2/lib/active_model/attribute_methods.rb:448:in `respond_to?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/attribute_methods.rb:212:in `respond_to?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/auto_include_context.rb:40:in `register_models'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:155:in `find_target'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/association.rb:161:in `load_target'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/association.rb:66:in `reload'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/singular_association.rb:9:in `reader'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/builder/association.rb:100:in `blob'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activemodel-6.0.2.2/lib/active_model/attribute_methods.rb:448:in `respond_to?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activemodel-6.0.2.2/lib/active_model/attribute_methods.rb:448:in `respond_to?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/attribute_methods.rb:212:in `respond_to?'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/auto_include_context.rb:40:in `register_models'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
/home/dev/.rvm/gems/ruby-2.6.5/gems/goldiloader-3.1.1/lib/goldiloader/active_record_patches.rb:155:in `find_target'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/association.rb:161:in `load_target'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/association.rb:66:in `reload'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/singular_association.rb:9:in `reader'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/associations/builder/association.rb:100:in `blob'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb:297:in `method_missing'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activestorage-6.0.2.2/config/routes.rb:27:in `block (2 levels) in <main>'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:638:in `instance_exec'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:638:in `eval_block'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:627:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:157:in `block (2 levels) in add_url_helper'
/home/dev/Development/nemoa/app/api_maker/resources/active_storage_attachment_resource.rb:12:in `url'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:43:in `attribute_value'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:30:in `block (2 levels) in attributes'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:24:in `each'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:24:in `block in attributes'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/configuration.rb:16:in `profile'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:22:in `attributes'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:67:in `result'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/serializer.rb:74:in `as_json'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `block in as_json'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `each'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `map'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `as_json'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `block in as_json'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `each'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `map'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `as_json'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `block in as_json'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `each'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `map'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `as_json'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/services/api_maker/collection_loader.rb:21:in `execute'
/home/dev/.rvm/gems/ruby-2.6.5/gems/service_pattern-0.0.6/lib/service_pattern/service.rb:31:in `execute!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/services/api_maker/index_command.rb:5:in `block (2 levels) in execute!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/base_command.rb:80:in `run_command'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/base_command.rb:60:in `block in each_command'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/base_command.rb:54:in `each_command'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/services/api_maker/index_command.rb:4:in `block in execute!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/configuration.rb:16:in `profile'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/services/api_maker/index_command.rb:3:in `execute!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/base_command.rb:41:in `block in execute_in_thread!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/services/api_maker/command_response.rb:42:in `with_thread'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/lib/api_maker/base_command.rb:40:in `execute_in_thread!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/services/api_maker/index_command_service.rb:3:in `execute'
/home/dev/.rvm/gems/ruby-2.6.5/gems/service_pattern-0.0.6/lib/service_pattern/service.rb:31:in `execute!'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/controllers/api_maker/commands_controller.rb:9:in `block (3 levels) in create'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/controllers/api_maker/commands_controller.rb:8:in `block (2 levels) in create'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/controllers/api_maker/commands_controller.rb:7:in `block in create'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
/home/dev/.rvm/gems/ruby-2.6.5/bundler/gems/api_maker-cf948bea3ff1/app/controllers/api_maker/commands_controller.rb:6:in `create'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/abstract_controller/base.rb:196:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/rendering.rb:30:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/home/dev/Development/nemoa/app/controllers/application_controller.rb:44:in `store_controller_for_logs'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb:139:in `run_callbacks'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/abstract_controller/callbacks.rb:41:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/rescue.rb:22:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/notifications.rb:180:in `block in instrument'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/notifications.rb:180:in `instrument'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/instrumentation.rb:32:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/abstract_controller/base.rb:136:in `process'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionview-6.0.2.2/lib/action_view/rendering.rb:39:in `process'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal.rb:191:in `dispatch'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_controller/metal.rb:252:in `dispatch'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:51:in `dispatch'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:33:in `serve'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/journey/router.rb:49:in `block in serve'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/journey/router.rb:32:in `each'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/journey/router.rb:32:in `serve'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:837:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/probes/action_dispatch/routing/route_set.rb:14:in `block in call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/fanout.rb:25:in `instrument'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/probes/action_dispatch/routing/route_set.rb:13:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/engine.rb:526:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/railtie.rb:190:in `public_send'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/railtie.rb:190:in `method_missing'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/mapper.rb:48:in `serve'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/journey/router.rb:49:in `block in serve'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/journey/router.rb:32:in `each'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/journey/router.rb:32:in `serve'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/routing/route_set.rb:837:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/probes/action_dispatch/routing/route_set.rb:14:in `block in call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/fanout.rb:25:in `instrument'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/probes/action_dispatch/routing/route_set.rb:13:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/remotipart-1.4.4/lib/remotipart/middleware.rb:32:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/warden-1.2.8/lib/warden/manager.rb:36:in `block in call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/warden-1.2.8/lib/warden/manager.rb:34:in `catch'
/home/dev/.rvm/gems/ruby-2.6.5/gems/warden-1.2.8/lib/warden/manager.rb:34:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/tempfile_reaper.rb:15:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/etag.rb:27:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/conditional_get.rb:40:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/head.rb:12:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/http/content_security_policy.rb:18:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/session/abstract/id.rb:266:in `context'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/session/abstract/id.rb:260:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/cookies.rb:648:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activerecord-6.0.2.2/lib/active_record/migration.rb:567:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/callbacks.rb:101:in `run_callbacks'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/web-console-4.0.1/lib/web_console/middleware.rb:132:in `call_app'
/home/dev/.rvm/gems/ruby-2.6.5/gems/web-console-4.0.1/lib/web_console/middleware.rb:28:in `block in call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/web-console-4.0.1/lib/web_console/middleware.rb:17:in `catch'
/home/dev/.rvm/gems/ruby-2.6.5/gems/web-console-4.0.1/lib/web_console/middleware.rb:17:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/rack/logger.rb:38:in `call_app'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/rack/logger.rb:26:in `block in call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/tagged_logging.rb:80:in `block in tagged'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/tagged_logging.rb:28:in `tagged'
/home/dev/.rvm/gems/ruby-2.6.5/gems/activesupport-6.0.2.2/lib/active_support/tagged_logging.rb:80:in `tagged'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/rack/logger.rb:26:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/request_store-1.4.1/lib/request_store/middleware.rb:19:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/request_id.rb:27:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/skylight-core-4.3.0/lib/skylight/core/probes/action_dispatch/request_id.rb:12:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/method_override.rb:24:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/runtime.rb:22:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/executor.rb:14:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/static.rb:126:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-2.2.2/lib/rack/sendfile.rb:110:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/actionpack-6.0.2.2/lib/action_dispatch/middleware/host_authorization.rb:83:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-cors-1.1.1/lib/rack/cors.rb:100:in `call'
/home/dev/Development/nemoa/app/services/rack/access_control.rb:8:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/webpacker-5.0.1/lib/webpacker/dev_server_proxy.rb:23:in `perform_request'
/home/dev/.rvm/gems/ruby-2.6.5/gems/rack-proxy-0.6.5/lib/rack/proxy.rb:57:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/railties-6.0.2.2/lib/rails/engine.rb:526:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/puma-4.3.3/lib/puma/configuration.rb:228:in `call'
/home/dev/.rvm/gems/ruby-2.6.5/gems/puma-4.3.3/lib/puma/server.rb:682:in `handle_request'
/home/dev/.rvm/gems/ruby-2.6.5/gems/puma-4.3.3/lib/puma/server.rb:472:in `process_client'
/home/dev/.rvm/gems/ruby-2.6.5/gems/puma-4.3.3/lib/puma/server.rb:328:in `block in run'
/home/dev/.rvm/gems/ruby-2.6.5/gems/puma-4.3.3/lib/puma/thread_pool.rb:134:in `block in spawn_thread'
Completed 500 Internal Server Error in 580ms (ActiveRecord: 24.9ms | Allocations: 376135)
SystemStackError (stack level too deep):
app/api_maker/resources/active_storage_attachment_resource.rb:12:in `url'
app/controllers/application_controller.rb:44:in `store_controller_for_logs'
app/services/rack/access_control.rb:8:in `call'
from goldiloader.
@kaspernj - Can you regenerate a stacktrace with the Rails backtrace cleaner disabled (call Rails.backtrace_cleaner.remove_silencers!
in an initializer)? Also can you post:
- The definition of the
url
method from app/api_maker/resources/active_storage_attachment_resource.rb - The definition of the ActiveStorage association definition that's causing problems
from goldiloader.
def url
Rails.application.routes.url_helpers.rails_blob_path(model, only_path: true)
end
-
https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/attachment.rb#L14
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:293:in `respond_to_missing?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activemodel (6.0.2.2) lib/active_model/attribute_methods.rb:448:in `respond_to?'
activerecord (6.0.2.2) lib/active_record/attribute_methods.rb:212:in `respond_to?'
activesupport (6.0.2.2) lib/active_support/core_ext/array/wrap.rb:42:in `wrap'
goldiloader (3.1.1) lib/goldiloader/auto_include_context.rb:40:in `register_models'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:21:in `auto_include_context'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:135:in `load_with_auto_include'
goldiloader (3.1.1) lib/goldiloader/active_record_patches.rb:155:in `find_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:161:in `load_target'
activerecord (6.0.2.2) lib/active_record/associations/association.rb:66:in `reload'
activerecord (6.0.2.2) lib/active_record/associations/singular_association.rb:9:in `reader'
activerecord (6.0.2.2) lib/active_record/associations/builder/association.rb:100:in `blob'
activesupport (6.0.2.2) lib/active_support/core_ext/module/delegation.rb:297:in `method_missing'
activestorage (6.0.2.2) config/routes.rb:27:in `block (2 levels) in <main>'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:638:in `instance_exec'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:638:in `eval_block'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:627:in `call'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:157:in `block (2 levels) in add_url_helper'
app/api_maker/resources/active_storage_attachment_resource.rb:12:in `url'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:43:in `attribute_value'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:30:in `block (2 levels) in attributes'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:24:in `each'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:24:in `block in attributes'
api_maker (4e11bb0bb4f7) lib/api_maker/configuration.rb:16:in `profile'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:22:in `attributes'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:67:in `result'
api_maker (4e11bb0bb4f7) lib/api_maker/serializer.rb:74:in `as_json'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `block in as_json'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `each'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `map'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `as_json'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `block in as_json'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `each'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `map'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `as_json'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `block in as_json'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `each'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `map'
activesupport (6.0.2.2) lib/active_support/core_ext/object/json.rb:172:in `as_json'
api_maker (4e11bb0bb4f7) app/services/api_maker/collection_loader.rb:21:in `execute'
service_pattern (0.0.6) lib/service_pattern/service.rb:31:in `execute!'
api_maker (4e11bb0bb4f7) app/services/api_maker/index_command.rb:5:in `block (2 levels) in execute!'
api_maker (4e11bb0bb4f7) lib/api_maker/base_command.rb:80:in `run_command'
api_maker (4e11bb0bb4f7) lib/api_maker/base_command.rb:60:in `block in each_command'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
api_maker (4e11bb0bb4f7) lib/api_maker/base_command.rb:54:in `each_command'
api_maker (4e11bb0bb4f7) app/services/api_maker/index_command.rb:4:in `block in execute!'
api_maker (4e11bb0bb4f7) lib/api_maker/configuration.rb:16:in `profile'
api_maker (4e11bb0bb4f7) app/services/api_maker/index_command.rb:3:in `execute!'
api_maker (4e11bb0bb4f7) lib/api_maker/base_command.rb:41:in `block in execute_in_thread!'
api_maker (4e11bb0bb4f7) app/services/api_maker/command_response.rb:42:in `with_thread'
api_maker (4e11bb0bb4f7) lib/api_maker/base_command.rb:40:in `execute_in_thread!'
api_maker (4e11bb0bb4f7) app/services/api_maker/index_command_service.rb:3:in `execute'
service_pattern (0.0.6) lib/service_pattern/service.rb:31:in `execute!'
api_maker (4e11bb0bb4f7) app/controllers/api_maker/commands_controller.rb:9:in `block (3 levels) in create'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
api_maker (4e11bb0bb4f7) app/controllers/api_maker/commands_controller.rb:8:in `block (2 levels) in create'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
api_maker (4e11bb0bb4f7) app/controllers/api_maker/commands_controller.rb:7:in `block in create'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:345:in `block in each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
actionpack (6.0.2.2) lib/action_controller/metal/strong_parameters.rb:344:in `each_pair'
api_maker (4e11bb0bb4f7) app/controllers/api_maker/commands_controller.rb:6:in `create'
actionpack (6.0.2.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.2.2) lib/abstract_controller/base.rb:196:in `process_action'
actionpack (6.0.2.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.2.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.2.2) lib/active_support/callbacks.rb:112:in `block in run_callbacks'
app/controllers/application_controller.rb:44:in `store_controller_for_logs'
activesupport (6.0.2.2) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
activesupport (6.0.2.2) lib/active_support/callbacks.rb:139:in `run_callbacks'
actionpack (6.0.2.2) lib/abstract_controller/callbacks.rb:41:in `process_action'
actionpack (6.0.2.2) lib/action_controller/metal/rescue.rb:22:in `process_action'
actionpack (6.0.2.2) lib/action_controller/metal/instrumentation.rb:33:in `block in process_action'
activesupport (6.0.2.2) lib/active_support/notifications.rb:180:in `block in instrument'
activesupport (6.0.2.2) lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport (6.0.2.2) lib/active_support/notifications.rb:180:in `instrument'
actionpack (6.0.2.2) lib/action_controller/metal/instrumentation.rb:32:in `process_action'
actionpack (6.0.2.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (6.0.2.2) lib/active_record/railties/controller_runtime.rb:27:in `process_action'
actionpack (6.0.2.2) lib/abstract_controller/base.rb:136:in `process'
actionview (6.0.2.2) lib/action_view/rendering.rb:39:in `process'
actionpack (6.0.2.2) lib/action_controller/metal.rb:191:in `dispatch'
actionpack (6.0.2.2) lib/action_controller/metal.rb:252:in `dispatch'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:51:in `dispatch'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:33:in `serve'
actionpack (6.0.2.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.2.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.2.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:837:in `call'
skylight-core (4.3.0) lib/skylight/core/probes/action_dispatch/routing/route_set.rb:14:in `block in call'
skylight-core (4.3.0) lib/skylight/core/fanout.rb:25:in `instrument'
skylight-core (4.3.0) lib/skylight/core/probes/action_dispatch/routing/route_set.rb:13:in `call'
railties (6.0.2.2) lib/rails/engine.rb:526:in `call'
railties (6.0.2.2) lib/rails/railtie.rb:190:in `public_send'
railties (6.0.2.2) lib/rails/railtie.rb:190:in `method_missing'
actionpack (6.0.2.2) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.0.2.2) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.2.2) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.2.2) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.2.2) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.2.2) lib/action_dispatch/routing/route_set.rb:837:in `call'
skylight-core (4.3.0) lib/skylight/core/probes/action_dispatch/routing/route_set.rb:14:in `block in call'
skylight-core (4.3.0) lib/skylight/core/fanout.rb:25:in `instrument'
skylight-core (4.3.0) lib/skylight/core/probes/action_dispatch/routing/route_set.rb:13:in `call'
remotipart (1.4.4) lib/remotipart/middleware.rb:32:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.2.2) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.2) lib/rack/etag.rb:27:in `call'
rack (2.2.2) lib/rack/conditional_get.rb:40:in `call'
rack (2.2.2) lib/rack/head.rb:12:in `call'
actionpack (6.0.2.2) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.2.2) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.2) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/cookies.rb:648:in `call'
activerecord (6.0.2.2) lib/active_record/migration.rb:567:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.2.2) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.2.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
web-console (4.0.1) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.0.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.0.1) lib/web_console/middleware.rb:17:in `catch'
web-console (4.0.1) lib/web_console/middleware.rb:17:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (6.0.2.2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.2.2) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.2.2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.2.2) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.2.2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
skylight-core (4.3.0) lib/skylight/core/probes/action_dispatch/request_id.rb:12:in `call'
rack (2.2.2) lib/rack/method_override.rb:24:in `call'
rack (2.2.2) lib/rack/runtime.rb:22:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.2.2) lib/rack/sendfile.rb:110:in `call'
actionpack (6.0.2.2) lib/action_dispatch/middleware/host_authorization.rb:83:in `call'
rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'
app/services/rack/access_control.rb:8:in `call'
webpacker (5.1.0) lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (6.0.2.2) lib/rails/engine.rb:526:in `call'
puma (4.3.3) lib/puma/configuration.rb:228:in `call'
puma (4.3.3) lib/puma/server.rb:682:in `handle_request'
puma (4.3.3) lib/puma/server.rb:472:in `process_client'
puma (4.3.3) lib/puma/server.rb:328:in `block in run'
puma (4.3.3) lib/puma/thread_pool.rb:134:in `block in spawn_thread'
from goldiloader.
@kaspernj - I took a crack at creating a new Rails application with Active Storage and Golidloader but I had no luck recreating the problem. I tried both has_one_attached
and has_many_attached
associations and both automatically eager loaded without any problems. Can you take a look and see if you can reproduce the problem? The app is in https://github.com/jturkel/active_storage_test.
from goldiloader.
@ricsdeol - I'd love to get this problem fixed but I've been stuck on the lack of a reproducible test case. Anything you can do to get me access to a reproducible test case for debugging would be greatly appreciated. My attempt to reproduce the problem via the goldiloader test suite can be found here and my attempt to reproduce the problem via a standalone Rails app can be found here.
from goldiloader.
Thanks to @kaspernj workaround, really helped out!
For what it's worth, like @ricsdeol, I get a stack too deep error whenever I directly do:
file = ActiveStorage::Attachment.find(param[:id])
file.purge
Interesting thing though, is when I grab it from the polymorphic association, it works fine
topic = Topic.find(param[:id])
file = topic.files.first
file.purge
^ this works
from goldiloader.
The fix has been released in goldiloader 4.1.2.
from goldiloader.
Related Issues (20)
- got an error while trying to load a polymorphic association HOT 2
- Eager load arbitrary nesting associations (with STI) HOT 11
- Goldiloader don't preload data HOT 1
- Auto-include only after a certain number of calls to the association? HOT 2
- Do not lose the goldiloader with additional includes HOT 2
- Rails edge build failing in database_cleaner-active_record
- Creates incorrect SQL for inverses of polymorphic associations HOT 1
- Preload Aggregations HOT 1
- config.filter_parameters keys ignored HOT 5
- Stack level too deep, incomplete response HOT 14
- Add configuration for auto_include(false) by default HOT 8
- Too many assiated models may be loaded HOT 2
- Ignore has one associations that relies on LIMIT 1 HOT 2
- Rails 5.2 Support HOT 6
- Rails 5.2 with bundle install HOT 2
- Issue with Rails 6.0.0.rc1 HOT 5
- This is not an issue HOT 1
- Compatibility with Rails 6.1 HOT 3
- Plans to release a version to enable Rails 6.1 as dependency? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goldiloader.