samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
184 stars 124 forks source link

image file in Items section of work show page is a link instead of a title #5480

Closed elrayle closed 2 years ago

elrayle commented 2 years ago

Descriptive summary

On nurax-pg, viewing the show page for a work that has an image file, there are multiple issues that may or may not be related.

This may be caused, at least partially, by the differences in solr docs generated by the AF Work indexer and the Valkyrie Work indexer. Note that the Valkyrie Solr Doc does not have "title_tesim", as well as other fields. And it has a some fields that the AF Solr Doc does not.

AF Solr Doc

Generated by creating an Generic Work with a file on nurax-dev. (alphabetized)

"accessControl_ssim":["5f1a5369-bc38-465a-92ee-14b752d45544"],
"creator_tesim":["elrayle@hotmail.com"],
"date_uploaded_dtsi":"2022-03-01T18:56:51Z",
"date_modified_dtsi":"2022-03-01T18:56:51Z",
"depositor_ssim":["elrayle@hotmail.com"],
"depositor_tesim":["elrayle@hotmail.com"],
"digest_ssim":["urn:sha1:603995389a07467fac80dba526f100ee4f4774ac"],
"edit_access_group_ssim":["admin"],
"edit_access_person_ssim":["elrayle@hotmail.com"],
"file_format_tesim":["jpeg"],
"has_model_ssim":["FileSet"],
"hasRelatedImage_ssim":["zw12z530q"],
"hasRelatedMediaFragment_ssim":["zw12z530q"],
"human_readable_type_tesim":["File"],
"id":"zw12z530q",
"label_tesim":["midnight.jpg"],
"label_ssi":"midnight.jpg",
"mime_type_ssi":"image/jpeg",
"original_file_id_ssi":"zw12z530q/files/0d346f81-b3a0-4810-8485-9a9cc573a22d",
"system_create_dtsi":"2022-03-01T18:56:51Z",
"system_modified_dtsi":"2022-03-01T18:56:53Z",
"thumbnail_path_ss":"/assets/default-f936e9c3ea7a38e2c2092099586a71380b11258697b37fb4df376704495a849a.png",
"title_tesim":["midnight.jpg"],
"visibility_ssi":"restricted",
"_version_":1726124931682402304,
"timestamp":"2022-03-01T18:56:54.254Z",
"score":3.6855774}]

Hyrax::FileSet (Valkyrie)

Generated by creating an Image work on nurax-pg. (alphabetized)

"byte_order_tesim":["big endian"],
"color_space_tesim":["YCbCr"],
"compression_tesim":["JPEG"],
"creator_tesim":["elrayle@hotmail.com"],
"date_uploaded_dtsi":"2022-03-01T18:39:11Z",
"date_modified_dtsi":"2022-03-01T18:39:11Z",
"edit_access_person_ssim":["elrayle@hotmail.com"],
"extracted_text_id_ssi":"",
"file_format_tesim":["jpeg (JPEG File Interchange Format)"],
"file_ids_ssim":["e87095d3-c16e-459c-9359-c7c9b9615b89"],
"file_size_lts":5346,
"format_label_tesim":["JPEG File Interchange Format"],
"has_model_ssim":["Hyrax::FileSet"],
"height_tesim":["168"],
"human_readable_type_tesim":["File Set"],
"id":"4fd5a52b-9c5e-4b31-bd12-2102544d35b2",
"mime_type_ssi":"image/jpeg",
"mime_type_tesi":"image/jpeg",
"original_file_id_ssi":"",
"original_filename_ssi":"max.jpeg",
"original_filename_tesi":"max.jpeg",
"size_tesim":["5346"],
"thumbnail_id_ssi":"",
"type_tesim":["http://pcdm.org/use#OriginalFile"],
"well_formed_tesim":["true"],
"width_tesim":["300"],
"valid_tesim":["true"],
"visibility_ssi":"restricted",
"_version_":1726123825513365504,
"timestamp":"2022-03-01T18:39:19.329Z",
"score":6.2983174

Rationale

ActiveFedora and Valkyrie show pages for works should behave the same.

Expected behavior

After creating a work with an image file, they should be listed under Items on the work show page with a thumbnail and title (e.g. s_amer_butterfly_2.jpg) with a link to the fileset page. Clicking the link should load the file set's show page.

image

Actual behavior

After creating a work with an image file, they are be listed under Items on the work show page, but the thumbnail is not displayed and the title (e.g. /concern/parent/20c72a.../file_sets/4fd5a5...) is the link to the fileset page. Clicking the link loads the home page with an authentication error.

image

Steps to reproduce the behavior

Prerequisites

Configure Hyrax:

  1. Edit /config/initializers/hyrax.rb and set:
    config.collection_model = "Hyrax::PcdmCollection"
    config.query_index_from_valkyrie = true
    config.index_adapter = :solr_index
  2. restart rails app
  3. Make sure regular hyrax-development and hyrax-valkyrie-dev solr cores are running . Your core names may vary depending on how you start them and how they are configured in the app.

To reproduce

  1. Navigate to: Dashboard -> Works
  2. Click button: Add new work
  3. Select type: Monograph
  4. File in required metadata and other required steps
  5. Add an image file
  6. Click button: Save

This forwards to the new work's show page. Look at the list of items at the bottom. You will see something similar to the screen shot in the Actual behavior section.

Related work

Issue #5474 - The failure to show the file in the universal viewer is probably related to this issues described in this Issue. Issue #4788 - Work thumbnail fails to show in Dashboard -> Works list of works

dlpierce commented 2 years ago

I get the following error from Sidekiq when creating a Monograph with one image. The other jobs fail with a different error, but this one seems likely to be preventing the filename from being put in the label.

Error performing ValkyrieIngestJob (Job ID: 43046fb5-e31b-436e-a14d-601804252b22) from Sidekiq(default) in 24054.72ms: ArgumentError (wrong number of arguments (given 2, expected 0)):
sidekiq_1     | /usr/local/bundle/gems/carrierwave-1.3.2/lib/carrierwave/sanitized_file.rb:159:in `read'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http/generic_request.rb:207:in `copy_stream'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http/generic_request.rb:207:in `send_request_with_body_stream'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http/generic_request.rb:125:in `exec'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:1521:in `block in transport_request'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:1519:in `catch'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:1519:in `transport_request'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:1492:in `request'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:1485:in `block in request'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:933:in `start'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/net/http.rb:1483:in `request'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/adapter/net_http.rb:88:in `perform_request'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/adapter/net_http.rb:44:in `block in call'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/adapter/net_http.rb:93:in `with_net_http_connection'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/adapter/net_http.rb:39:in `call'
sidekiq_1     | /usr/local/bundle/gems/faraday-encoding-0.0.5/lib/faraday/encoding.rb:12:in `call'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/rack_builder.rb:143:in `build_response'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/connection.rb:387:in `run_request'
sidekiq_1     | /usr/local/bundle/gems/faraday-0.17.5/lib/faraday/connection.rb:175:in `put'
sidekiq_1     | /usr/local/bundle/gems/ldp-1.0.3/lib/ldp/client/methods.rb:89:in `block in put'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/notifications.rb:170:in `instrument'
sidekiq_1     | /usr/local/bundle/gems/ldp-1.0.3/lib/ldp/client/methods.rb:87:in `put'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/caching_connection.rb:24:in `put'
sidekiq_1     | /usr/local/lib/ruby/2.7.0/delegate.rb:83:in `method_missing'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/initializing_connection.rb:42:in `put'
sidekiq_1     | /usr/local/bundle/gems/ldp-1.0.3/lib/ldp/resource.rb:84:in `create'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/file_persistence.rb:12:in `_create_record'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:245:in `block in _create_record'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:98:in `run_callbacks'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:816:in `_run_create_callbacks'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:245:in `_create_record'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/persistence.rb:179:in `create_or_update'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:241:in `block in create_or_update'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:98:in `run_callbacks'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:816:in `_run_save_callbacks'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:241:in `create_or_update'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/file.rb:161:in `create_or_update'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/with_metadata.rb:22:in `create_or_update'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/persistence.rb:44:in `save!'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/associations/contains_association.rb:7:in `insert_record'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/associations/directly_contains_association.rb:6:in `insert_record'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/autosave_association.rb:289:in `block in save_collection_association'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/autosave_association.rb:278:in `each'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/autosave_association.rb:278:in `save_collection_association'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/autosave_association.rb:135:in `block in define_autosave_association_callbacks'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/autosave_association.rb:105:in `instance_eval'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/autosave_association.rb:105:in `block in define_non_cyclic_method'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:426:in `block in make_lambda'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:236:in `block in halting_and_conditional'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:517:in `block in invoke_after'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:517:in `each'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:517:in `invoke_after'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:133:in `run_callbacks'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:816:in `_run_update_callbacks'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:249:in `_update_record'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/persistence.rb:179:in `create_or_update'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:241:in `block in create_or_update'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:132:in `run_callbacks'
sidekiq_1     | /usr/local/bundle/gems/activesupport-5.2.6.2/lib/active_support/callbacks.rb:816:in `_run_save_callbacks'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/callbacks.rb:241:in `create_or_update'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/persistence.rb:40:in `save'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/validations.rb:50:in `save'
sidekiq_1     | /usr/local/bundle/gems/active-fedora-13.2.5/lib/active_fedora/associations/builder/orders.rb:44:in `save'
sidekiq_1     | /usr/local/bundle/gems/hydra-works-2.0.0/lib/hydra/works/services/add_file_to_file_set.rb:43:in `persist'
sidekiq_1     | /usr/local/bundle/gems/hydra-works-2.0.0/lib/hydra/works/services/add_file_to_file_set.rb:35:in `update'
sidekiq_1     | /usr/local/bundle/gems/hydra-works-2.0.0/lib/hydra/works/services/add_file_to_file_set.rb:100:in `update'
sidekiq_1     | /usr/local/bundle/gems/hydra-works-2.0.0/lib/hydra/works/services/add_file_to_file_set.rb:19:in `call'
sidekiq_1     | /app/samvera/hyrax-engine/lib/wings/valkyrie/storage.rb:140:in `upload_with_works'
sidekiq_1     | /app/samvera/hyrax-engine/lib/wings/valkyrie/storage.rb:49:in `upload'
sidekiq_1     | /app/samvera/hyrax-engine/app/jobs/valkyrie_ingest_job.rb:60:in `upload_file'
sidekiq_1     | /app/samvera/hyrax-engine/app/jobs/valkyrie_ingest_job.rb:27:in `ingest'
sidekiq_1     | /app/samvera/hyrax-engine/app/jobs/valkyrie_ingest_job.rb:14:in `perform'
tpendragon commented 2 years ago

Some of the errors I'm seeing:

GrantEditToMembersJob/FileSetAttachedEventJob/ContentUpdateEventJob: Error while trying to deserialize arguments: Expected Hydra::AccessControls::Embargo, got Hydra::AccessControls::Embargo (Triggered at lib/wings/model_transformer.rb:156 in append_embargo)

ValkyrieIngestJob: Same as above.