Comments (5)
I fixed this one sidecar by doing the following:
sidecar = Spotlight::SolrDocumentSidecar.find_by(exhibit_id: 128, resource_id: 25244)
sidecar.update_column(:data, {})
exhibit = Spotlight::Exhibit.find(128)
data = Spotlight::Resources::IiifService.parse('https://gallica.bnf.fr/iiif/ark:/12148/btv1b550020492/manifest.json').first
data.to_solr(exhibit: exhibit)
from exhibits.
I'm seeing in the logs:
Oct 19 13:51:42 exhibits-worker-prod-a sidekiq[2873046]: 2023-10-19T20:51:42.434Z pid=2873046 tid=1mory class=Spotlight::ReindexJob jid=c9842cd958d14d0d0d8aa169 ERROR: Caught exception Tried to load unspecified class: IIIF::OrderedHash
from exhibits.
@corylown this might be a missing require for iiif-presentation:
./bin/rails c
Loading development environment (Rails 7.0.8)
irb(main):001> IIIF::OrderedHash
(irb):1:in `<main>': uninitialized constant IIIF::OrderedHash (NameError)
IIIF::OrderedHash
^^^^^^^^^^^^^
irb(main):002> require 'iiif/presentation'
=> true
irb(main):003> IIIF::OrderedHash
=> IIIF::OrderedHash
That is required in https://github.com/projectblacklight/spotlight/blob/main/app/models/spotlight/resources/iiif_harvester.rb#L3 and
https://github.com/projectblacklight/spotlight/blob/main/app/models/spotlight/resources/iiif_service.rb#L3
Ah! It looks like this is a Psych error: https://app.honeybadger.io/projects/49092/faults/101531481
Psych::DisallowedClass: Tried to load unspecified class: IIIF::OrderedHash
So, I suspect this is not in an AllowList of classes that Psych will safely deserialize. We'd need to add this to config.active_record.yaml_column_permitted_classes
, but I wonder why that isn't in here: https://github.com/projectblacklight/spotlight/blob/0f5a47eefe43dafddd1702869a9f57aea0d4e6e4/lib/spotlight/engine.rb#L338-L341
3.1.0 :014 > sidecar = Spotlight::SolrDocumentSidecar.find_by(exhibit_id: 128, resource_id: 25244)
(Object doesn't support #inspect)
=>
3.1.0 :015 > sidecar.attributes_before_type_cast
=>
{"id"=>851735,
"exhibit_id"=>128,
"public"=>1,
"data"=>
"---\nreadonly_repository_tesim:\n- Bibliothèque nationale de France\nreadonly_digitised-by_tesim:\n- Bibliothèque nationale de France\nreadonly_source-images_tesim:\n- https://gallica.bnf.fr/ark:/12148/btv1b550020492\nreadonly_metadata-source_tesim:\n- http://oai.bnf.fr/oai2/OAIHandler?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:bnf.fr:gallica/ark:/12148/btv1b550020492\nreadonly_shelfmark_tesim:\n- Bibliothèque nationale de France, département Musique, MS-79\nreadonly_title_tesim:\n- \"[Ah ! perfido, op. 65 : fragment] (manuscrit autographe) / Ludwig van Beethoven]\"\nreadonly_date_tesim:\n- '1796'\nreadonly_format_tesim:\n- !ruby/hash:IIIF::OrderedHash\n \"@value\": 1 partition (2 f.) ; 21 x 32 cm\n- !ruby/hash:IIIF::OrderedHash\n \"@value\": application/pdf\n- !ruby/hash:IIIF::OrderedHash\n \"@value\": 'Nombre total de vues : 4'\nreadonly_creator_tesim:\n- !ruby/hash:IIIF::OrderedHash\n \"@value\": Beethoven, Ludwig van (1770-1827). Compositeur\n- !ruby/hash:IIIF::OrderedHash\n \"@value\": Beethoven, Ludwig van (1770-1827). Compositeur\nreadonly_relation_tesim:\n- 'Notice d’oeuvre : http://catalogue.bnf.fr/ark:/12148/cb14794427w'\n- 'Notice du catalogue : http://catalogue.bnf.fr/ark:/12148/cb424513623'\nreadonly_type_tesim:\n- Partition\nreadonly_attribution_tesim:\n- Bibliothèque nationale de France\nreadonly_description_tesim:\n- \"[Ah ! perfido, op. 65 : fragment] (manuscrit autographe) / Ludwig van Beethoven]\"\nreadonly_license_tesim:\n- https://gallica.bnf.fr/html/und/conditions-dutilisation-des-contenus-de-gallica\n",
"created_at"=>2018-07-26 16:22:32 UTC,
"updated_at"=>2018-12-21 17:02:17 UTC,
"document_id"=>"12f18e4d7d59a1a0178deca3e295f1f6",
"document_type"=>"SolrDocument",
"resource_id"=>25244,
"resource_type"=>nil,
"index_status"=>nil,
"tag_list"=>nil}
It looks like we're not properly handling this sort of IIIF manifest: https://gallica.bnf.fr/iiif/ark:/12148/btv1b550020492/manifest.json where metadata.value
is an Object not a String
This seems like a spotlight bug with this particular IIIF manifest: projectblacklight/spotlight#2985
from exhibits.
Once I realized that a IIIF resource was in this test exhibit, this morning I reindexed a couple of additional test exhibits and had 100% success. So this reindexing problem appears to be isolated to IIIF only. We have IIIF resources in only a few exhibits (~3-4?), so this makes this reindexing problem less impactful -- especially if we discover it is perhaps isolated to this single IIIF resource?
from exhibits.
@jcoyne reports: I think this may just have been old data in the database. I cleared out that sidecar and re-indexed it from the manifest and I think its’ working now.
from exhibits.
Related Issues (20)
- Feedback form error messages should indicate which fields are in error
- Remove dependency on handlebars
- Correct alt text for Stanford Libraries logo link
- Current selected view type should be indicated to screen readers HOT 1
- Selecting view type or filter should not shift focus to the top of the page HOT 2
- Icons are missing in sir trevor widgets on spotlight v3.6.0
- Form markup is broken in sir trevor add embed widget on spotlight v3.6.0
- Embed block spec fails with spotlight v3.6.0.beta1 HOT 3
- Page <title> string may contain HTML elements
- Configured show partials are not rendered with spotlight v3.6.0.beta6 HOT 1
- Remove houndci HOT 2
- Unique links should have unique, meaningful text
- Investigate if we need both copies of helper 'fill_in_typeahead_field'
- Add a "restore default" option for each metadata field in the Dashboard > Metadata section HOT 1
- Help text needed to explain to users what advanced search features are available
- Enable bulk upload of IIIF manifests
- Add horizontal spacer widget to enable more aesthetic page layouts
- Provide text arrangement options for item row widgets HOT 4
- Create multiple selection drop down for Configuration > General > Tag list
- Audio streams on PURL but not on exhibit page HOT 4
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 exhibits.