•  
      request #8098 Restoration of deleted git repository failed
    Infos
    #8098
    Manuel Vacelet (vaceletm)
    2015-05-28 17:21
    2015-05-26 17:26
    8122
    Details
    Restoration of deleted git repository failed

    During 8.2 valid on c6

    11023 SystemEvent_GIT_REPO_RESTORE app ERROR 2
    2015-05-26 15:16:24 2015-05-26 15:17:01 2015-05-26 15:17:02 Unable to restore repository : arch/i386

    What is strange is that there are no parameters

     

    SCM/Git
    development
    CentOS 6
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Yannis ROSSETTO (rossettoy)
    Closed
    2015-05-28
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    I tested with this patch and with a 640 mode, my event failed. Then, with 644 mode, the event is OK and the repository is restored with the content.
    User avatar
    Hi

    > It's normal that restore fail, I already mentionned in request#8077 that removing "term=XTERM" will create this regression

    As already said, setting term only prevent a message to be displayed. This message is not at all an error and you can actually verify by yourself that the git repository is actually restored on the file system. However, as the code rely on the fact that there is no output to decide whether the untar succeeded, the restoration process stops because it believe that something wrong happened.

    However, you are right that changing the backuped repo to 0640 will fail.
    The reason is that System_Command will only throw an exception if the exit code of the executed command is different of 0 (zero). The only true way to decide whether something is success or not in Unix/Posix world.

    So the right way to fix it is to make restore-tar command return the actual exit code of tar instead of relying on command output.
    User avatar
    Hi ,

    It's normal that restore fail, I already mentionned in request#8077 that removing "term=XTERM" will create this regression.
    Besides, the use of "try catch" doesn't throw any error.
    For instance if you set the mod of backuped repo to 640 and you try to restore, you should get a permission denied error, but with try-catch you will now get a green sys event with no error in git syslog and the restored will be empty.

    I already tried the use of try catch before submitting my patch set (gerrit#3961) and I retested now, thus I can confirm that "try catch" don't throw any error.

    Could you please check if the use of "try catch" in gerrit #4013 throw errros ?

    Thanks

    • Status changed from Closed to Reopen
    • Close date cleared
    User avatar
    • Status changed from Under review to Closed
    • Assigned to changed from None to Yannis ROSSETTO (rossettoy)
    • Close date set to 2015-05-27
    User avatar
    We found the root cause: The error verification does not rely on command status code, but on message returned.

    As this warning is returned, the event transforms this as an error, which is wrong. We will provide a fix for that.