Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-2828

Batch import via command line incorrectly duplicates path specified in '-s' flag

    Details

    • Type: Bug
    • Status: Volunteer Needed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.1
    • Fix Version/s: None
    • Component/s: DSpace API
    • Environment:
    • Attachments:
      0
    • Comments:
      0
    • Documentation Status:
      Needed

      Description

      When using the bin/dspace import command to import items in SAF, the importer requires the source directory to be specified with the -s flag, but when loading from a .zip file, it incorrectly looks for the zip in a location that duplicates the path specified in the -s flag, resulting in a "file not found" error.

      The duplication does not occur if the -z flag has not been used (i.e. if the items are located in a regular directory specified in the -s flag, but rather only when -s and -z are both used.

      A workaround is to invoke the load from the directory where the zip file is located, and specify -s '.' for the source directory.

      Sample error message is below.


      $ /apps/mdsoar/bin/dspace import -a -e notreal@notreal.org -s /apps/mdsoar/upload -z item_export_2015_Oct_01_1_34.zip -t -m outputmap.txt -c 11603-STAGE/4784
      *Test Run* - not actually importing items.
      Destination collections:
      Owning Collection: 20150924
      java.io.FileNotFoundException: /apps/mdsoar/upload/apps/mdsoar/upload/item_export_2015_Oct_01_1_34.zip (No such file or directory)
      at java.util.zip.ZipFile.open(Native Method)
      at java.util.zip.ZipFile.<init>(ZipFile.java:215)
      at java.util.zip.ZipFile.<init>(ZipFile.java:145)
      at java.util.zip.ZipFile.<init>(ZipFile.java:159)
      at org.dspace.app.itemimport.ItemImport.unzip(ItemImport.java:2022)
      at org.dspace.app.itemimport.ItemImport.unzip(ItemImport.java:1988)
      at org.dspace.app.itemimport.ItemImport.unzip(ItemImport.java:2099)
      at org.dspace.app.itemimport.ItemImport.main(ItemImport.java:490)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.dspace.app.launcher.ScriptLauncher.runOneCommand(ScriptLauncher.java:225)
      at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:77)
      java.io.FileNotFoundException: /apps/mdsoar/upload/apps/mdsoar/upload/item_export_2015_Oct_01_1_34.zip (No such file or directory)
      Deleting temporary zip directory: /apps/mdsoar/imports
      **End of Test Run**
      Started: 1445520961621
      Ended: 1445520962375
      Elapsed time: 0 secs (754 msecs)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              westgard Joshua Westgard
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: