Bug 1045537

Summary: Removing repository doesn't delete it from file system completely on Windows
Product: [Retired] JBoss BRMS Platform 6 Reporter: Jiri Locker <jlocker>
Component: Business CentralAssignee: Alexandre Porcelli <porcelli>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Locker <jlocker>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0.0CC: kverlaen, lpetrovi, rrajasek
Target Milestone: ER2   
Target Release: 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Windows Server 2012 Windows 8
Last Closed: 2014-08-06 19:57:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Exception stack trace none

Description Jiri Locker 2013-12-20 16:49:23 UTC
Created attachment 839689 [details]
Exception stack trace

Description of problem:
When removing repository in UI or via REST it is not deleted from file system completely. UI reports no error, so it seems the operation completed successfully, but when it is invoked via REST it fails with exception. It seems that JGit fails to delete git .pack files.

Version-Release number of selected component (if applicable):
ER6

How reproducible:
-

Steps to Reproduce:
1. go to Administration in Workbench
2. clone a repository that has some Packfiles (http://git-scm.com/book/en/Git-Internals-Packfiles)
3. remove the repository

Actual results:
The repository root directory still exists in .niogit. It contains some .pack files and maybe some refs, too.

Expected results:
The removed repository directory should be removed completely.

Additional info:
To reproduce with REST from command line:
curl -u '<user:password>' -H 'Accept: application/json' -H 'Content-Type: application/json' -X DELETE http://localhost:8080/business-central/rest/repositories/my-repository

I wasn't able to successfully run this command in Cygwin, though. We use a Java REST client code in automated test suite.

Comment 1 Alexandre Porcelli 2014-01-02 17:46:46 UTC
Fix(*) pushed to master and product branch of UberFire repo:

https://github.com/droolsjbpm/uberfire/commit/52ebe2a93
https://github.com/droolsjbpm/uberfire/commit/89b56c752

* - I coudln't yet test on my computer as I'm still strugling to setup a windows VM, but I didn't wanna block others to have it in hands soon.

Comment 2 Jiri Locker 2014-01-23 15:24:38 UTC
Still broken in CR1. Removing a repository typically leaves a single Packfile in the repo directory.

Comment 3 Lukáš Petrovický 2014-01-23 17:06:14 UTC
The impact of this issue is that unless the repo is deleted completely, users won't be able to clone it again later.

Comment 4 Alexandre Porcelli 2014-02-27 21:01:32 UTC
This looks like a JGit issue, I managed to implement a workaround (just for windows):

(0.3.x) http://github.com/uberfire/uberfire/commit/59469a006
(master) http://github.com/uberfire/uberfire/commit/01e65ad60

Comment 5 Jiri Locker 2014-03-28 16:14:03 UTC
Cannot reproduce with 6.0.1.CR2.