Skip to content
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

Zip::DestinationFileExistsError when importing multiple Zip files through the same Importer #249

Open
bkiahstroud opened this issue Oct 2, 2020 · 0 comments

Comments

@bkiahstroud
Copy link
Contributor

Summary

Zip::DestinationFileExistsError errors are being thrown when importing. The current theory behind this error is that, if you import from multiple files through the same Importer object (i.e. editing an already-run Importer, selecting a different file to import from the originally imported file, and running the import), it causes errors like this one.

(Untested) Steps to Reproduce

  1. Create and run a valid CSV Importer using a Zip file
  2. Once the import completes, edit the Importer
  3. In the form, select a different Zip file to import
  4. Click "Update and Re-Import (update metadata and replace files)"

Expected Result: All Entries import successfully

Actual Result: At least some Entries should fail with a Zip::DestinationFileExistsError

Error Details

Example error message:

Zip::DestinationFileExistsError - Destination '/tmp/import_29_37/files/Walker.pdf' already exists
Error Trace (Partial)
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/entry.rb:599:in `create_file'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/entry.rb:174:in `extract'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/file.rb:323:in `extract'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/willow_sword-0a669d78617c/lib/willow_sword/zip_package.rb:20:in `block (2 levels) in unzip_file'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/entry_set.rb:38:in `block in each'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/entry_set.rb:37:in `each'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/entry_set.rb:37:in `each'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/central_directory.rb:182:in `each'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/willow_sword-0a669d78617c/lib/willow_sword/zip_package.rb:17:in `block in unzip_file'
/usr/local/rvm/gems/ruby-2.5.3/gems/rubyzip-1.3.0/lib/zip/file.rb:114:in `open'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/willow_sword-0a669d78617c/lib/willow_sword/zip_package.rb:16:in `unzip_file'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/parsers/bulkrax/application_parser.rb:209:in `unzip'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/parsers/bulkrax/csv_parser.rb:271:in `real_import_file_path'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/parsers/bulkrax/application_parser.rb:229:in `import_file_path'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/parsers/bulkrax/csv_parser.rb:226:in `path_to_files'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/bulkrax/csv_entry.rb:153:in `path_to_file'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/bulkrax/csv_entry.rb:73:in `block in add_file'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/bulkrax/csv_entry.rb:73:in `map'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/bulkrax/csv_entry.rb:73:in `add_file'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/bulkrax/csv_entry.rb:57:in `build_metadata'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/concerns/bulkrax/import_behavior.rb:10:in `build_for_importer'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/models/bulkrax/entry.rb:68:in `build'
/usr/local/rvm/gems/ruby-2.5.3/bundler/gems/bulkrax-f28640fbb2a7/app/jobs/bulkrax/import_work_job.rb:10:in `perform'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant