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

Re-allow CSVs without model column to fallback on default work type #1042

Open
1 task
bkiahstroud opened this issue Jun 29, 2024 · 1 comment
Open
1 task
Assignees
Labels
bug Something isn't working Needs Rework

Comments

@bkiahstroud
Copy link
Contributor

bkiahstroud commented Jun 29, 2024

Story

Importing a CSV without a model column leads to the importer failing to run and logging this error: NameError - uninitialized constant Hyrax::Form Did you mean? Hyrax::Forms.

CSVs imported without a model column should fallback on Bulkrax.default_work_type.

Slack thread

Acceptance Criteria

  • Importing a CSV without a model column will successfully create GenericWorks instead of throwing an error

Testing Instructions and Sample Files

  1. Login as an admin
  2. Navigate to Dashboard > Importers > New Importer
  3. Upload a valid CSV that does not have a model column
  4. Click Create and Import
  5. Validate that the importer successfully creates GenericWorks instead of failing with an error

Notes

Stack trace
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/inflector/methods.rb:285:in `const_get'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/inflector/methods.rb:285:in `block in constantize'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/inflector/methods.rb:281:in `each'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/inflector/methods.rb:281:in `inject'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/inflector/methods.rb:281:in `constantize'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/core_ext/string/inflections.rb:68:in `constantize'
/app/samvera/hyrax-webapp/app/parsers/bulkrax/csv_parser_decorator.rb:42:in `determine_required_fields_for'
/app/samvera/hyrax-webapp/app/parsers/bulkrax/csv_parser_decorator.rb:26:in `missing_fields_for'
/app/samvera/hyrax-webapp/app/parsers/bulkrax/csv_parser_decorator.rb:11:in `block in valid_import?'
/app/samvera/hyrax-webapp/app/parsers/bulkrax/csv_parser_decorator.rb:9:in `each'
/app/samvera/hyrax-webapp/app/parsers/bulkrax/csv_parser_decorator.rb:9:in `each_with_object'
/app/samvera/hyrax-webapp/app/parsers/bulkrax/csv_parser_decorator.rb:9:in `valid_import?'
/usr/local/bundle/bundler/gems/bulkrax-f2439755f501/app/models/bulkrax/importer.rb:21:in `valid_import?'
/app/samvera/hyrax-webapp/app/jobs/bulkrax/importer_job_decorator.rb:9:in `import'
/usr/local/bundle/bundler/gems/bulkrax-f2439755f501/app/jobs/bulkrax/importer_job.rb:12:in `perform'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/execution.rb:39:in `block in perform_now'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/usr/local/bundle/gems/sentry-raven-2.13.0/lib/raven/integrations/rails/active_job.rb:13:in `block (2 levels) in included'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/local/bundle/gems/i18n-1.14.1/lib/i18n.rb:322:in `with_locale'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/logging.rb:26:in `block (4 levels) in <module:Logging>'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/notifications.rb:168:in `block in instrument'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/notifications.rb:168:in `instrument'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/logging.rb:25:in `block (3 levels) in <module:Logging>'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/logging.rb:46:in `block in tag_logger'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/tagged_logging.rb:71:in `block in tagged'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/tagged_logging.rb:28:in `tagged'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/tagged_logging.rb:71:in `tagged'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/logging.rb:46:in `tag_logger'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/logging.rb:22:in `block (2 levels) in <module:Logging>'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:136:in `run_callbacks'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/execution.rb:38:in `perform_now'
/app/samvera/hyrax-webapp/lib/active_job_tenant.rb:39:in `block in perform_now'
/app/samvera/hyrax-webapp/lib/active_job_tenant.rb:58:in `block in switch'
/usr/local/bundle/gems/apartment-2.2.1/lib/apartment/adapters/abstract_adapter.rb:85:in `switch'
/usr/local/lib/ruby/2.7.0/forwardable.rb:235:in `switch'
/app/samvera/hyrax-webapp/lib/active_job_tenant.rb:57:in `switch'
/app/samvera/hyrax-webapp/lib/active_job_tenant.rb:38:in `perform_now'
/usr/local/bundle/gems/sentry-rails-5.4.2/lib/sentry/rails/active_job.rb:9:in `block in perform_now'
/usr/local/bundle/gems/sentry-rails-5.4.2/lib/sentry/rails/active_job.rb:33:in `block in record'
/usr/local/bundle/gems/sentry-ruby-5.4.2/lib/sentry/hub.rb:59:in `with_scope'
/usr/local/bundle/gems/sentry-ruby-5.4.2/lib/sentry-ruby.rb:352:in `with_scope'
/usr/local/bundle/gems/sentry-rails-5.4.2/lib/sentry/rails/active_job.rb:21:in `record'
/usr/local/bundle/gems/sentry-rails-5.4.2/lib/sentry/rails/active_job.rb:8:in `perform_now'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/execution.rb:24:in `block in execute'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:109:in `block in run_callbacks'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/railtie.rb:28:in `block (4 levels) in <class:Railtie>'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/execution_wrapper.rb:90:in `wrap'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/reloader.rb:73:in `block in wrap'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/execution_wrapper.rb:86:in `wrap'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/reloader.rb:72:in `wrap'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/railtie.rb:27:in `block (3 levels) in <class:Railtie>'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `instance_exec'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/callbacks.rb:136:in `run_callbacks'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/execution.rb:22:in `execute'
/usr/local/bundle/gems/activejob-5.2.8.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:202:in `execute_job'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:170:in `block (2 levels) in process'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/middleware/chain.rb:177:in `block in invoke'
/usr/local/bundle/gems/sentry-raven-2.13.0/lib/raven/integrations/sidekiq.rb:9:in `call'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/middleware/chain.rb:179:in `block in invoke'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/middleware/chain.rb:182:in `invoke'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:169:in `block in process'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/job_retry.rb:113:in `local'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/rails.rb:14:in `block in call'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/execution_wrapper.rb:90:in `wrap'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/reloader.rb:73:in `block in wrap'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/execution_wrapper.rb:90:in `wrap'
/usr/local/bundle/gems/activesupport-5.2.8.1/lib/active_support/reloader.rb:72:in `wrap'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/rails.rb:13:in `call'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:263:in `stats'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/job_logger.rb:13:in `call'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/job_retry.rb:80:in `global'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:124:in `block in dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/job_logger.rb:39:in `prepare'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:123:in `dispatch'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:168:in `process'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:78:in `process_one'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/processor.rb:68:in `run'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/component.rb:8:in `watchdog'
/usr/local/bundle/gems/sidekiq-6.5.6/lib/sidekiq/component.rb:17:in `block in safe_thread' 

Example failed importer in prod

@bkiahstroud bkiahstroud added the bug Something isn't working label Jun 29, 2024
@bkiahstroud bkiahstroud self-assigned this Jun 29, 2024
@bkiahstroud bkiahstroud moved this to In Development in palni-palci Jun 29, 2024
@bkiahstroud bkiahstroud moved this from In Development to Code Review in palni-palci Jun 29, 2024
@bkiahstroud bkiahstroud moved this from Code Review to Deploy to Staging in palni-palci Jun 29, 2024
@jillpe jillpe moved this from Deploy to Staging to SoftServ QA in palni-palci Jul 8, 2024
@jillpe
Copy link

jillpe commented Jul 15, 2024

SoftServ QA:
I tried running 2 importers, listed below. The Bulkrax::ImporterJob is stuck in the sidekiq's retries and is preventing me from being able to check this

Importer 1
Importer 2

@bkiahstroud bkiahstroud moved this from SoftServ QA to Ready for Development in palni-palci Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs Rework
Projects
Status: Ready for Development
Development

No branches or pull requests

2 participants