NEU-Libraries / cerberus

Digital Repository Service
8 stars 0 forks source link

Error Exporting MODS #1143

Closed sarahjeansweeney closed 7 years ago

sarahjeansweeney commented 7 years ago

Dan reported to me that he encountered a system error (“Sorry, you encountered a system error”) when trying to download a MODS export zip. I tried to replicate, but couldn't because the export job failed first.

Error
No such file or directory - /tmp/DRStmp/mods/08f2a192abddea9cfe2d399b4a461219-6006/80410-MODS.xml
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:1439:in `unlink'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:1439:in `block in remove_file'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:1444:in `platform_support'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:1438:in `remove_file'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:785:in `remove_file'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:563:in `block in rm'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:562:in `each'
/usr/local/rvm/rubies/ruby-2.0.0-p648/lib/ruby/2.0.0/fileutils.rb:562:in `rm'
/opt/cerberus/releases/20170830043231/app/jobs/export_mods_job.rb:50:in `block (3 levels) in run'
/opt/cerberus/releases/20170830043231/app/jobs/export_mods_job.rb:37:in `each'
/opt/cerberus/releases/20170830043231/app/jobs/export_mods_job.rb:37:in `block (2 levels) in run'
/opt/cerberus/shared/bundle/ruby/2.0.0/bundler/gems/axlsx-9e07402a26f7/lib/axlsx/workbook/workbook.rb:267:in `add_worksheet'
/opt/cerberus/releases/20170830043231/app/jobs/export_mods_job.rb:34:in `block in run'
/opt/cerberus/shared/bundle/ruby/2.0.0/bundler/gems/axlsx-9e07402a26f7/lib/axlsx/package.rb:29:in `initialize'
/opt/cerberus/releases/20170830043231/app/jobs/export_mods_job.rb:33:in `new'
/opt/cerberus/releases/20170830043231/app/jobs/export_mods_job.rb:33:in `run'
/opt/cerberus/releases/20170830043231/lib/cerberus/resque/queue.rb:24:in `perform'

I'm able to export MODS for other collections, so I suspect this issue is caused by the fact that this particular collection has over 7,714 records: https://repository.library.northeastern.edu/collections/neu:6006

dgcliff commented 7 years ago

I think this is due to the mods folder being cleaned up before the job is done. I'll look into excluding it from that cleanup process.

dgcliff commented 7 years ago

Changed to

0 * * * * find /tmp/DRStmp/* -type d -cmin +1440 ! -path "/tmp/DRStmp/xsd*" ! -path "/tmp/DRStmp/mod*" -exec rm -rf {} \; 2>/dev/null

0 * * * * find /tmp/DRStmp/* -type f -cmin +1440 ! -path "/tmp/DRStmp/xsd*" ! -path "/tmp/DRStmp/mod*" -exec rm -rf {} \; 2>/dev/null

Should fix the issue