benwbrum / fromthepage

FromThePage is a wiki-like application for crowdsourcing transcription of handwritten documents.
http://fromthepage.com
GNU Affero General Public License v3.0
170 stars 50 forks source link

nil error on TEI export #4195

Closed benwbrum closed 1 month ago

benwbrum commented 2 months ago

Liz at Dartmouth writes:

I noticed that recently, our TEI exports have a “corresp” attribute attached to all

tags. The value looks like to be a repeated string of letters and numbers, with P# attached to the end of each. Is this part of an update?

Also, I am having trouble exporting TEI documents. I am attempting to export the “pre-TEI” set in our Wrangel Island collection, but receive an error each time.

Looking at the processing log, I see this error:

** Invoke fromthepage:process_bulk_export (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute fromthepage:process_bulk_export
fetching bulk export with ID=5993
found bulk_export for 
    user=Liz Shand, 
    from collection=Collating Wrangel Island: Inhabiting the ‘Uninhabitable’, 1900-1930
{"id"=>5993,
 "user_id"=>32016831,
 "collection_id"=>32000033,
 "status"=>"queued",
 "plaintext_verbatim_page"=>false,
 "plaintext_verbatim_work"=>false,
 "plaintext_emended_page"=>false,
 "plaintext_emended_work"=>false,
 "plaintext_searchable_page"=>false,
 "plaintext_searchable_work"=>false,
 "tei_work"=>true,
 "html_page"=>false,
 "html_work"=>false,
 "subject_csv_collection"=>false,
 "table_csv_collection"=>false,
 "table_csv_work"=>false,
 "created_at"=>Fri, 28 Jun 2024 17:45:33.000000000 UTC +00:00,
 "updated_at"=>Fri, 28 Jun 2024 17:45:33.000000000 UTC +00:00,
 "work_metadata_csv"=>false,
 "work_id"=>nil,
 "facing_edition_work"=>false,
 "text_pdf_work"=>false,
 "text_docx_work"=>false,
 "static"=>false,
 "document_set_id"=>25000535,
 "subject_details_csv_collection"=>false,
 "text_only_pdf_work"=>false,
 "organization"=>"by_format",
 "use_uploaded_filename"=>true,
 "plaintext_verbatim_zero_index_page"=>false,
 "owner_mailing_list"=>nil,
 "owner_detailed_activity"=>nil,
 "collection_activity"=>nil,
 "collection_contributors"=>nil,
 "report_arguments"=>{"preserve_linebreaks"=>"0"},
 "notes_csv"=>false,
 "admin_searches"=>nil}
        Exporting work  32025323    stefansson-wrangel-09-25-001
rake aborted!
ActionView::Template::Error: undefined method `split' for nil:NilClass
/home/fromthepage/deployment/releases/20240628144810/app/models/page.rb:639:in `image_url_for_download'
/home/fromthepage/deployment/releases/20240628144810/app/views/export/tei.html.erb:328:in `block in _app_views_export_tei_html_erb___2431863225728132252_108880'
saracarl commented 1 month ago

I believe this is happening because we changed our actionMailer when we switched to PostMark, which makes this value nil: https://github.com/benwbrum/fromthepage/blob/a48a7072cdcc81e970b1956cfaed7055d9f3b977/app/models/page.rb#L636 we should change this to: #{Rails.application.config.action_mailer.default_url_options[:host]}

Which is exactly the same value, and is working for IIIF endpoints.

So I try exporting the failing document from the logs, and it's fine: https://fromthepage.com/export/stefansson-wrangel-09-25-001/tei

So closing this as resolved. My guess is that it may have happened as we transitioned mail services???