-
Notifications
You must be signed in to change notification settings - Fork 64
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
[Docs] Migrating from an older Spotlight version #1768
Comments
@danschmidt5189 looking at your edits, I think you've gotten most of the way there. Not sure if you were able to find the upgrade notes in our release notes or not but definitely check those out. I think the wrong URL issue that you are seeing is because the host name that you passed in the IIIF migration task was If that's not the case, please let me know what the erroneous image urls you're seeing. |
Ah, thanks @jkeck . I missed the release notes! After re-running migrate_to_iiif with the correct address, we're now getting 500s instead of 404s. Progress! From the logs:
I will look more into this tomorrow. And my apologies for my vagueness — it's a non-trivial stack and my experience with it is quite limited. Thanks for your help! |
I notice you are using Rails 4.2.3. Does this error persist if you upgrade to 4.2.8? |
@jcoyne Nope, both the deprecation warning and RIIIF error persist in testing with Rails 4.2.8. |
Looking into this a bit further, the bug is related to riiif's use of hashes versus Rails'
But in the version of Rails I'm testing (4.2.8 now), it's actually returning a regular Ruby hash. Thus, attempts to access Upgrading to Rails 5.0.2 fixes the riiif problem (so images render correctly) but causes a new error in rendering Spotlight's views:
|
Ok, tracked down the latest problem to a change in how Rails 5 handles ActionController::Parameters — previously a hash, now an Object. This leads to the type mismatch error pasted above (in the blacklight_configuration model). Still working on a fix for that one. |
@danschmidt5189 Yes, but we're using Rails 5 and haven't been able do duplicate you problem. Even with |
@jcoyne Were you able to upgrade exhibits that were created in the pre-Rails 5 version of Spotlight? Newly created exhibits are fine; it's older exhibits that trigger the error. |
So I re-tested this end-to-end from scratch with production data. For background, the basic process is:
The key step as it pertains to this Issue is (2). If I load our production data as-is (containing references to So, takeaways:
|
I think this may fix your problem with RIIIF sul-dlss/riiif#49 |
That patch was released as 1.1.2 https://github.com/curationexperts/riiif/releases/tag/v1.1.2 |
Following up—do you guys know if the IIIF migration task misses Spotlight::HomePage objects? After running the migration, we ran into a bug where editing a home page containing a {
"item_1": {
"id": "12-662",
"title": "燕山俠隱",
"thumbnail_image_url": "",
"full_image_url": "/uploads/spotlight/resources/upload/url/662/yan_shan_xia_yin_2.jpg",
"iiif_tilesource": "undefined",
"iiif_manifest_url": "undefined",
"iiif_canvas_id": "undefined",
"iiif_image_id": "undefined",
"weight": "1",
"display": "true"
}
} If you manually delete and re-add the entry, it's updated to something like this in the DB: {
"item_0": {
"id": "12-549",
"title": "红色娘子军",
"thumbnail_image_url": "",
"full_image_url": "",
"iiif_tilesource": "http://exhibits.vagrant.lib.berkeley.edu:3000/images/702/info.json",
"iiif_manifest_url": "/fonoroff-collection/catalog/12-549/manifest",
"iiif_canvas_id": "http://exhibits.vagrant.lib.berkeley.edu:3000/fonoroff-collection/catalog/12-549/manifest/canvas/12-549",
"iiif_image_id": "",
"weight": "0",
"display": "true"
}
} Any ideas? We kludge'd our way around this by writing our own rake task, which loops through our pages and updates And by the way, thanks for all your work on this! We're still learning how the Blacklight suite of apps are architected; down the road we could hopefully contribute to development. Some of this stuff, though, especially the SirTrevorRails serializations, read like black magic at the moment. Note: The JSON snippets above are just extracts from running a SQL query, essentially: SELECT content FROM spotlight_pages WHERE id = ? AND type = 'Spotlight::HomePage'; I then pulled out the offending documents from
Hope that provides enough context to job the memory of someone familiar with the codebase. |
@danschmidt5189 do you mean the thumbnail of the home page or images w/i the content of widgets? We did the former not the later (as deserializing/reserializng the sir-trevor widget output was deemed too much of a pain). What I would expect to see in this case is that in the absence of IIIF data, the widget would fall-back to the |
The latter on both counts—1) I'm referring to the thumbnails embedded within a homepage, not the homepage's thumbnail; and 2) it's fine initially (right after the iiif migration) but breaks after an edit (even if you don't actually change anything). Is it possible to programmatically rebuild the widgets in code? (We ended up mucking with the serialized JSON directly; it works but we're unsure if that could create other problems down the road.) |
I inherited an old version of Spotlight (e5f5b6b) and am trying to upgrade to the latest version. My overall procedure boiled down to:
rake rails:template
command pointing at the latesttemplate.rb
The schema has quite a few backwards-incompatible changes, so to load production data I:
rake db:migrate VERSION=20170213200533
)public/uploads
into the dev instanceAt this point, I'd expect that running
rake spotlight:reindex
would restore the production state. That's worked with previous, albeit much smaller, upgrades. However in this case, I get the following error:That looks like the result of a schema change that I'm just not sure how to fix — any advice?
More generally, what's the recommended procedure for upgrading an existing, production Spotlight instance?
Edit 1: Also, it's worth noting that the
<exhibit>/resources/reindex_all
endpoint 404s after this upgrade. After some inspection, it turns out that this is the result of the same "RecordNotFound" error you'd get executing the same command via rake — it just surfaces as a 404 in the UI.Edit 2: Ok, looks like you also need to:
config/routes.rb: mount Riiif::Engine => '/images', as: 'riiif'
rake spotlight:migrate_to_riiif[http://localhost/images]
After running this, the items/images are visible in Curation>Items, but the image URLs are wrong.
BTW, the migration task throws this warning repeatedly:
The text was updated successfully, but these errors were encountered: