fromthepage
fromthepage copied to clipboard
500 errors on metadata creation UI and structured data API
@npversteegh reports;
Recently I’ve been getting some HTTP 500 Internal Server Errors when requesting Structured Data API URLs from Ohio University’s Manasseh Cutler Papers transcription and Metadata Creation project:
- Untranscribed and undescribed https://fromthepage.com/iiif/32029933/manifest has https://fromthepage.com/iiif/32029933/structured as its “Structured data (user-created metadata) for manifest”, which gives me a 500. Its display URL https://fromthepage.com/display/read_work?work_id=32029933 also gives me a 500.
- Transcribed but undescribed https://fromthepage.com/iiif/32029911/manifest has https://fromthepage.com/iiif/32029911/structured which 500s, as does its display URL: https://fromthepage.com/display/read_work?work_id=32029911
- Transcribed and described https://fromthepage.com/iiif/32029930/manifest has https://fromthepage.com/iiif/32029930/structured which replies with its data just fine, but its display URL https://fromthepage.com/display/read_work?work_id=32029930 500s. I’m not sure if these errors are related to Metadata Creation or the Structured Data API, or are a misunderstanding on my part. I noticed them when I was manually testing the new version of our CONTENTdm utility scripts, which were raising 500 errors when running against this collection. Our other Metadata Creation project (Farfel Leaves Metadata), and a field-based transcription project (Dance Posters Metadata) don’t seem to raise these errors, so perhaps it’s something specific to the Cutler papers project? I think Cutler is unique for us in being a combination transcription/Metadata Creation project.
The logs show this error:
I, [2022-10-17T17:23:40.458391 #20817] INFO -- : Started GET "/iiif/32029933/structured" for 70.117.185.249 at 2022-10-17 17:23:40 +0000
I, [2022-10-17T17:23:40.461522 #20817] INFO -- : Processing by IiifController#structured_data_endpoint as HTML
I, [2022-10-17T17:23:40.461848 #20817] INFO -- : Parameters: {"work_id"=>"32029933"}
I, [2022-10-17T17:23:40.501145 #20817] INFO -- : Completed 500 in 39ms (ActiveRecord: 16.8ms | Allocations: 9843)
F, [2022-10-17T17:23:40.510478 #20817] FATAL -- :
TypeError (no implicit conversion of nil into String):
app/helpers/export_helper.rb:644:in `work_metadata_to_hash'
app/helpers/export_helper.rb:627:in `work_metadata_contributions'
app/controllers/iiif_controller.rb:399:in `structured_data_endpoint'
app/controllers/application_controller.rb:62:in `switch_locale'
I'm loading a recent snapshot of production into my dev db to duplicate the problem locally.
Fixed and deployed.