Closed davidschober closed 6 years ago
Error thrown:
NoMethodError in Hyrax::Dashboard::NestCollectionsController#create_relationship_under undefined method `[]' for nil:NilClass Extracted source (around line #163): #161 #162 # Now we have the largest nesting depth for all paths containing this collection *163 descendant_depth = response[Samvera::NestingIndexer.configuration.solr_field_name_for_deepest_nested_depth] #164 #165 # => 2) Then we get the stored depth of the child collection itself to eliminate the collections above this one from our count, and add 1 to add back in this collection itself #166 child_depth = NestingAttributes.new(id: child.id, scope: scope).depth Extracted source (around line #136): #134 def self.valid_combined_nesting_depth?(parent:, child: nil, scope:) #135 # We limit the total depth of collections to the size specified in the samvera-nesting_indexer configuration. *136 child_depth = child_nesting_depth(child: child, scope: scope) #137 parent_depth = parent_nesting_depth(parent: parent, scope: scope) #138 return false if parent_depth + child_depth > Samvera::NestingIndexer.configuration.maximum_nesting_depth #139 true Extracted source (around line #80): #78 # relationship. #79 def nesting_within_maximum_depth *80 return true if query_service.valid_combined_nesting_depth?(parent: parent, child: child, scope: context) #81 errors.add(:collection, :exceeds_maximum_nesting_depth) #82 false #83 end Rails.root: /var/app/current Framework Trace /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/services/hyrax/collections/nested_collection_query_service.rb:163:in `child_nesting_depth' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/services/hyrax/collections/nested_collection_query_service.rb:136:in `valid_combined_nesting_depth?' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/forms/hyrax/forms/dashboard/nest_collection_form.rb:80:in `nesting_within_maximum_depth' activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `block in make_lambda' activesupport (5.1.6) lib/active_support/callbacks.rb:197:in `block (2 levels) in halting' activesupport (5.1.6) lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator' activesupport (5.1.6) lib/active_support/callbacks.rb:600:in `catch' activesupport (5.1.6) lib/active_support/callbacks.rb:600:in `block in default_terminator' activesupport (5.1.6) lib/active_support/callbacks.rb:198:in `block in halting' activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `block in invoke_before' activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `each' activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `invoke_before' activesupport (5.1.6) lib/active_support/callbacks.rb:130:in `run_callbacks' activesupport (5.1.6) lib/active_support/callbacks.rb:827:in `_run_validate_callbacks' activemodel (5.1.6) lib/active_model/validations.rb:405:in `run_validations!' activemodel (5.1.6) lib/active_model/validations.rb:335:in `valid?' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/forms/hyrax/forms/dashboard/nest_collection_form.rb:33:in `save' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/controllers/hyrax/dashboard/nest_collections_controller.rb:33:in `create_relationship_under' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' actionpack (5.1.6) lib/abstract_controller/base.rb:186:in `process_action' actionpack (5.1.6) lib/action_controller/metal/rendering.rb:30:in `process_action' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action' activesupport (5.1.6) lib/active_support/callbacks.rb:131:in `run_callbacks' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action' actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in `process_action' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' activesupport (5.1.6) lib/active_support/notifications.rb:166:in `block in instrument' activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument' activesupport (5.1.6) lib/active_support/notifications.rb:166:in `instrument' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action' actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in `process_action' activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:22:in `process_action' actionpack (5.1.6) lib/abstract_controller/base.rb:124:in `process' actionview (5.1.6) lib/action_view/rendering.rb:30:in `process' actionpack (5.1.6) lib/action_controller/metal.rb:189:in `dispatch' actionpack (5.1.6) lib/action_controller/metal.rb:253:in `dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in `serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call' railties (5.1.6) lib/rails/engine.rb:522:in `call' railties (5.1.6) lib/rails/railtie.rb:185:in `public_send' railties (5.1.6) lib/rails/railtie.rb:185:in `method_missing' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:17:in `block in ' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:46:in `serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call' omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!' omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call' omniauth (1.7.1) lib/omniauth/builder.rb:63:in `call' warden (1.2.7) lib/warden/manager.rb:36:in `block in call' warden (1.2.7) lib/warden/manager.rb:35:in `catch' warden (1.2.7) lib/warden/manager.rb:35:in `call' rack (2.0.5) lib/rack/etag.rb:25:in `call' rack (2.0.5) lib/rack/conditional_get.rb:38:in `call' rack (2.0.5) lib/rack/head.rb:12:in `call' rack (2.0.5) lib/rack/session/abstract/id.rb:232:in `context' rack (2.0.5) lib/rack/session/abstract/id.rb:226:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in `call' active-fedora (11.5.2) lib/active_fedora/ldp_cache.rb:26:in `call' flipflop (2.4.0) lib/flipflop/feature_cache.rb:12:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call' activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app' railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged' railties (5.1.6) lib/rails/rack/logger.rb:24:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call' rack (2.0.5) lib/rack/method_override.rb:22:in `call' rack (2.0.5) lib/rack/runtime.rb:22:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call' rack (2.0.5) lib/rack/sendfile.rb:111:in `call' railties (5.1.6) lib/rails/engine.rb:522:in `call' puma (3.11.0) lib/puma/configuration.rb:225:in `call' puma (3.11.0) lib/puma/server.rb:624:in `handle_request' puma (3.11.0) lib/puma/server.rb:438:in `process_client' puma (3.11.0) lib/puma/server.rb:302:in `block in run' puma (3.11.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread' Full Trace /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/services/hyrax/collections/nested_collection_query_service.rb:163:in `child_nesting_depth' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/services/hyrax/collections/nested_collection_query_service.rb:136:in `valid_combined_nesting_depth?' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/forms/hyrax/forms/dashboard/nest_collection_form.rb:80:in `nesting_within_maximum_depth' activesupport (5.1.6) lib/active_support/callbacks.rb:413:in `block in make_lambda' activesupport (5.1.6) lib/active_support/callbacks.rb:197:in `block (2 levels) in halting' activesupport (5.1.6) lib/active_support/callbacks.rb:601:in `block (2 levels) in default_terminator' activesupport (5.1.6) lib/active_support/callbacks.rb:600:in `catch' activesupport (5.1.6) lib/active_support/callbacks.rb:600:in `block in default_terminator' activesupport (5.1.6) lib/active_support/callbacks.rb:198:in `block in halting' activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `block in invoke_before' activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `each' activesupport (5.1.6) lib/active_support/callbacks.rb:507:in `invoke_before' activesupport (5.1.6) lib/active_support/callbacks.rb:130:in `run_callbacks' activesupport (5.1.6) lib/active_support/callbacks.rb:827:in `_run_validate_callbacks' activemodel (5.1.6) lib/active_model/validations.rb:405:in `run_validations!' activemodel (5.1.6) lib/active_model/validations.rb:335:in `valid?' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/forms/hyrax/forms/dashboard/nest_collection_form.rb:33:in `save' /opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/bundler/gems/hyrax-93d66ca7e703/app/controllers/hyrax/dashboard/nest_collections_controller.rb:33:in `create_relationship_under' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action' actionpack (5.1.6) lib/abstract_controller/base.rb:186:in `process_action' actionpack (5.1.6) lib/action_controller/metal/rendering.rb:30:in `process_action' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:20:in `block in process_action' activesupport (5.1.6) lib/active_support/callbacks.rb:131:in `run_callbacks' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in `process_action' actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in `process_action' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' activesupport (5.1.6) lib/active_support/notifications.rb:166:in `block in instrument' activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument' activesupport (5.1.6) lib/active_support/notifications.rb:166:in `instrument' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in `process_action' actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in `process_action' activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:22:in `process_action' actionpack (5.1.6) lib/abstract_controller/base.rb:124:in `process' actionview (5.1.6) lib/action_view/rendering.rb:30:in `process' actionpack (5.1.6) lib/action_controller/metal.rb:189:in `dispatch' actionpack (5.1.6) lib/action_controller/metal.rb:253:in `dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in `dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in `serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call' railties (5.1.6) lib/rails/engine.rb:522:in `call' railties (5.1.6) lib/rails/railtie.rb:185:in `public_send' railties (5.1.6) lib/rails/railtie.rb:185:in `method_missing' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:17:in `block in ' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:46:in `serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in `block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in `serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in `call' omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!' omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call' omniauth (1.7.1) lib/omniauth/builder.rb:63:in `call' warden (1.2.7) lib/warden/manager.rb:36:in `block in call' warden (1.2.7) lib/warden/manager.rb:35:in `catch' warden (1.2.7) lib/warden/manager.rb:35:in `call' rack (2.0.5) lib/rack/etag.rb:25:in `call' rack (2.0.5) lib/rack/conditional_get.rb:38:in `call' rack (2.0.5) lib/rack/head.rb:12:in `call' rack (2.0.5) lib/rack/session/abstract/id.rb:232:in `context' rack (2.0.5) lib/rack/session/abstract/id.rb:226:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in `call' active-fedora (11.5.2) lib/active_fedora/ldp_cache.rb:26:in `call' flipflop (2.4.0) lib/flipflop/feature_cache.rb:12:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call' activesupport (5.1.6) lib/active_support/callbacks.rb:97:in `run_callbacks' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call' railties (5.1.6) lib/rails/rack/logger.rb:36:in `call_app' railties (5.1.6) lib/rails/rack/logger.rb:24:in `block in call' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `block in tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in `tagged' railties (5.1.6) lib/rails/rack/logger.rb:24:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in `call' rack (2.0.5) lib/rack/method_override.rb:22:in `call' rack (2.0.5) lib/rack/runtime.rb:22:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call' actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in `call' rack (2.0.5) lib/rack/sendfile.rb:111:in `call' railties (5.1.6) lib/rails/engine.rb:522:in `call' puma (3.11.0) lib/puma/configuration.rb:225:in `call' puma (3.11.0) lib/puma/server.rb:624:in `handle_request' puma (3.11.0) lib/puma/server.rb:438:in `process_client' puma (3.11.0) lib/puma/server.rb:302:in `block in run' puma (3.11.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread' Request parameters {"child_id"=>"4aadd012-b956-4e5b-8317-daab4cdc6f20", "source"=>"show", "locale"=>"en", "parent_id"=>"e47bbf84-1204-4bd1-ae07-3647732d9c48"} Session dump _csrf_token: "gwXGvLS24M7YwtFwLqSw+GgFS/SkldZXdkPvzU47gZs=" history: [477, 476] search: {"id"=>477} session_id: "2e5220269983202d3fa8334824c71ed0" warden.user.user.key: [[5], nil] warden.user.user.session: {"full_login"=>true} Env dump GATEWAY_INTERFACE: "CGI/1.2" HTTP_ACCEPT: "*/*" HTTP_ACCEPT_ENCODING: "gzip, deflate" HTTP_ACCEPT_LANGUAGE: "en-us" HTTP_ORIGIN: "http://donut.repo.rdc-staging.library.northwestern.edu" HTTP_VERSION: "HTTP/1.0" HTTP_X_CSRF_TOKEN: "iclS8Uid1nAbbdIWjPKjt/c/6lSe0HVJCQ6nspC7DXQKzJRN/Cs2vsOvA2aiVhNPnzqhoDpFox5/TUh/3oCM7w==" HTTP_X_FORWARDED_FOR: "129.105.184.254, 10.0.6.203" ORIGINAL_SCRIPT_NAME: "" REMOTE_ADDR: "127.0.0.1" SERVER_NAME: "donut.repo.rdc-staging.library.northwestern.edu" SERVER_PROTOCOL: "HTTP/1.1" Response headers None
From @kdid on May 9, 2018 14:54
The error is thrown because we disabled nested indexing due to Hyrax issues of the entire collection's graph being reindexed on save. https://github.com/nulib/donut/blob/master/config/initializers/hyrax.rb#L233
https://github.com/nulib/next-generation-repository/issues/422
It looks like the nesting indexing issues in Hyrax have been (maybe partially?) addressed. We could try reenabling it. https://github.com/samvera/hyrax/issues?utf8=%E2%9C%93&q=nesting+indexer
Let's try to reenable. What kind of tests do you need us to try to see if it blows up donut? I think we should probably wait until next cycle to grab this work.
cc: @mbklein
This issue was moved to nulib/next-generation-repository#497
From @davidschober on May 8, 2018 21:47
Description
Collections can't be nested. When trying to create a new collection and nest it under an existing collection, the application throws a "no method error"
To recreate:
Note
This seems to work fine on Nurax.
NOTE
We disabled nested indexing due to Hyrax issues of the entire collection's graph being reindexed on save. https://github.com/nulib/donut/blob/master/config/initializers/hyrax.rb#L233
https://github.com/nulib/next-generation-repository/issues/422
It looks like the nesting indexing issues in Hyrax have been (maybe partially?) addressed. We could try reenabling it. https://github.com/samvera/hyrax/issues?utf8=%E2%9C%93&q=nesting+indexer
Copied from original issue: nulib/institutional-repository#445