Akubra
  1. Akubra
  2. AKUBRA-1

Akubra fails to move files across symlinks, filesystems on some platforms

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: 0.3.1
    • Component/s: akubra-fs
    • Labels:
      None
    • Environment:
      Solaris 10

      Description

      Akubra fails with the exception "java.io.IOException: Rename failed for an unknown reason" when executing the moveTo() function on file blob objects that are being moved across symlinks or across filesystems. This only occurs on some platforms; the failing behavior has been observed on Solaris 10.

      This is due to limitations in the java.io.File renameTo() method, which is used in org.akubraproject.fs.FSBlob.moveTo():

      if (!file.renameTo(other)) {
            if (!file.exists())
              throw new MissingBlobException(getId());

            throw new IOException("Rename failed for an unknown reason.");
          }

      See this bug report: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4073756

      And these comments: http://download.oracle.com/javase/tutorial/essential/io/legacy.html

      See this thread in fcrepo-user for more information:
      http://sourceforge.net/mailarchive/message.php?msg_name=7430a7853fa37.4cab4c65%40wiscmail.wisc.edu&sms_ss=email&at_xt=4caf920cde3046a1,0

        Activity

        Hide
        Scott Prater added a comment -
        I've written and tested a patch that replaces file.renameTo() with a private safe copy-and-delete function within org.akubraproject.fs.FSBlob. I'll create a branch with this patch shortly.
        Show
        Scott Prater added a comment - I've written and tested a patch that replaces file.renameTo() with a private safe copy-and-delete function within org.akubraproject.fs.FSBlob. I'll create a branch with this patch shortly.
        Hide
        Scott Prater added a comment -
        Branch created, and patch applied, ready for review.
        Show
        Scott Prater added a comment - Branch created, and patch applied, ready for review.
        Hide
        Chris Wilper added a comment -
        Branch is in review here: https://review.duraspace.org/r/21/
        Show
        Chris Wilper added a comment - Branch is in review here: https://review.duraspace.org/r/21/
        Hide
        Scott Prater added a comment -
        Continued review (second version of patch) here: https://review.duraspace.org/r/22/
        Show
        Scott Prater added a comment - Continued review (second version of patch) here: https://review.duraspace.org/r/22/
        Hide
        Scott Prater added a comment -
        Fixed, tested and branch merged into trunk.
        Show
        Scott Prater added a comment - Fixed, tested and branch merged into trunk.

          People

          • Assignee:
            Scott Prater
            Reporter:
            Scott Prater
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: