Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Deleting extracted text files causes file set save errors #1034

Open
awead opened this issue Jun 6, 2019 · 0 comments
Open

Deleting extracted text files causes file set save errors #1034

awead opened this issue Jun 6, 2019 · 0 comments

Comments

@awead
Copy link
Contributor

awead commented Jun 6, 2019

Description

If you have an existing work with file sets, and one of the file sets has an extracted text file, then updating the file set via csv can error if the extracted text file is missing or unreadable by the file system.

Setup

To reproduce the error:

  1. Ingest sample works, such as collection pstsc_09844
  2. Export the resulting collection as csv
  3. Update one of the file set's metadata in the csv
  4. Remove the extracted text file from the updated file set, ex. rm pstsc_09844_e15ca556987b120ed80a50444194464a_00001_001_text.txt
  5. Upload the csv to update the collection's metadata
  6. The csv should validate and you can perform the import

Error

It looks like this is coming from the save transaction, but the resulting error is buried in the output. You can search the page for "error" and you should find:

@errors=#<Reform::Form::ActiveModel::Errors:0x00007f86e9bf04d8
  @base=#<Work::FileSetChangeSet:0x00007f86e9bf1bd0 ...>,
  @messages={
    :save=>["No such file or directory @ rb_sysopen - /Users/agw13/Projects/Github/psu-libraries/cho/public/files/pstsc_09844_e15ca556987b120ed80a50444194464a_00001_001_text.txt"]
  },
  @details={
    :save=>[{:error=>"No such file or directory @ rb_sysopen - /Users/agw13/Projects/Github/psu-libraries/cho/public/files/pstsc_09844_e15ca556987b120ed80a50444194464a_00001_001_text.txt"}]
  }
>

Todo

  1. We ought to make the save process more tolerant and allow existing file sets to save, even if some of their files are missing. Either logging an error somewhere or reporting it to the user while updating the relevant metadata.
  2. Fix the error display messages on the "Faile Import" page.
@ntallman ntallman added this to the MVP 8 milestone Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants