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

Cannot deposit new item via SWORD

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1
    • Component/s: SWORD
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      4
    • Documentation Status:
      Not Required

      Description

      Originally reported on dspace-tech by Àlex Magaz Graça: http://dspace.2283337.n4.nabble.com/Problems-trying-to-deposit-through-SWORD-tt4669426.html

      Àlex wrote there:

      I've been trying to deposit through SWORD (both with versions 1 and 2)
      but it either fails or does it incorrectly. Fetching the servicedocument
      and depositing a file to an item work though.

      With SWORD v1:

      curl -i --data-binary "@dspace-sword/example/example.zip" -H
      "Content-Disposition: filename=test1.zip" -H "Content-Type:
      application/zip" -H "X-Packaging:
      http://purl.org/net/sword-types/METSDSpaceSIP" -H "X-No-Op: false" -H
      "X-Verbose: true" --user "user:pass" http://1.2.3.4/sword/deposit/12345/2

      It gives me this error:

      WARN org.dspace.content.packager.METSManifest @ Got no bitstream
      ADMID, file@ID=sword-mets-file-3
      [...]
      ERROR org.dspace.sword.SWORDMETSIngester @ caught exception:
      org.dspace.content.packager.PackageValidationException: Invalid METS
      Manifest: file element without ID attribute.
      at
      org.dspace.content.packager.AbstractMETSIngester.addBitstreams(AbstractMETSIngester.java:850)
      at
      org.dspace.content.packager.AbstractMETSIngester.ingestObject(AbstractMETSIngester.java:500)
      at
      org.dspace.content.packager.AbstractMETSIngester.ingest(AbstractMETSIngester.java:234)
      at
      org.dspace.sword.SWORDMETSIngester.ingest(SWORDMETSIngester.java:93)
      at
      org.dspace.sword.CollectionDepositor.doDeposit(CollectionDepositor.java:111)
      [...]

      Actually, the file element has an ID attribute, what the code is really
      checking for is the ADMID attribute, which I've confirmed it is missing.

      With SWORD v2:

      curl -i --data-binary "@dspace-sword/example/example.zip" -H
      "Content-Disposition: filename=test1.zip" -H "Content-Type:
      application/zip" -H "X-Packaging:
      http://purl.org/net/sword/package/METSDSpaceSIP" -H "X-No-Op: false" -H
      "X-Verbose: true" --user "user:pass"
      http://1.2.3.4/swordv2/collection/12345/2

      The deposit doesn't fail, but the zip doesn't get unpacked either. An
      item is created with no metadata from the METS file. It just contains a
      bitstream with the name test1.zip, which corresponds to example.zip.

      In the logs I see this warning:

      WARN org.dspace.core.PluginManager @ Cannot find named plugin for
      interface=org.dspace.sword2.SwordContentIngester, name="application/zip"

      It seems like it is using the Content-Type header instead of
      X-Packaging. So if set the value of the Content-Type header of the
      previous command to "Content-Type:
      http://purl.org/net/sword/package/METSDSpaceSIP", I get this error:

      [...]
      WARN org.dspace.content.packager.METSManifest @ Got no bitstream
      ADMID, file@ID=sword-mets-file-3
      INFO org.dspace.content.Bitstream @
      sword:session_id=0:update_bitstream:bitstream_id=18
      ERROR org.dspace.sword2.SwordMETSContentIngester @ caught exception:
      org.dspace.content.packager.PackageValidationException: Invalid METS
      Manifest: file element without ID attribute.
      at
      org.dspace.content.packager.AbstractMETSIngester.addBitstreams(AbstractMETSIngester.java:850)
      at
      org.dspace.content.packager.AbstractMETSIngester.replaceObject(AbstractMETSIngester.java:660)
      at
      org.dspace.content.packager.AbstractMETSIngester.replace(AbstractMETSIngester.java:1187)
      at
      org.dspace.sword2.SwordMETSContentIngester.ingestToCollection(SwordMETSContentIngester.java:108)
      at
      org.dspace.sword2.AbstractSwordContentIngester.ingest(AbstractSwordContentIngester.java:45)
      at
      org.dspace.sword2.SwordMETSContentIngester.ingest(SwordMETSContentIngester.java:44)
      at
      org.dspace.sword2.CollectionDepositManagerDSpace.createNewFromBinary(CollectionDepositManagerDSpace.java:229)
      [...]

      If I try to deposit from another repository with the SWORD client
      functionality, it also fails with the ID attribute error, although in
      this case the ADMID attribute is present in the file element.

      I've made all these tests with DSpace 4 (master) test machine without
      any customisation apart from the install directories in
      build.properties. Nevertheless, I get the same results with demo.dspace.org.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                schweer Andrea Schweer
                Reporter:
                alexm Àlex Magaz Graça
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: