Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2729

Restore endpoint ignores non-writable backups

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 5.4.1.Final
    • Common
    • None
    • Hide
      1. Create any backup,
      2. Try to restore it with the REST endpoint
        • Should be working. If not, fix that first.
      3. chmod -w /path/to/backup
      4. Try to restore it with the REST endpoint
        • Expected: works
        • Actual: Backup cannot be found
      Show
      Create any backup, Try to restore it with the REST endpoint Should be working. If not, fix that first. chmod -w /path/to/backup Try to restore it with the REST endpoint Expected: works Actual: Backup cannot be found

      I took a look at the source, all candidate directories for the backup are sent through the org.modeshape.web.jcr.rest.handler.RestRepositoryHandler.isValidDir function:

          private boolean isValidDir( String dir ) {
              if (StringUtil.isBlank(dir)) {
                  return false;
              }
              File dirFile = new File(dir);
              return dirFile.exists() && dirFile.canWrite() && dirFile.isDirectory();
          }
      

      As you can see, the directory is being checked for writability.
      Since ModeShape is supposed to restore (i.e. read) that backup, I don't see why it would need write permissions to do that.

      The error message is misleading, too, since it says the backup cannot be found, not that write permissions were missing.

      My expectation here is that at least the error message is fixed.
      But if ModeShape indeed never writes anything into the backup directory, then it should not require the backup directory to be writable.

              Unassigned Unassigned
              tomylobo_jira Tomy Lobo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: