{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/293","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/293/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/293/events","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/293","id":119850301,"number":293,"title":"App start fails with \"clone-on-start: true\"; JGitEnvironmentRepository.deleteBaseDirIfExists() fails to delete .git\\objects\\*pack","user":{"login":"jgolubenko","id":3239162,"avatar_url":"https://avatars.githubusercontent.com/u/3239162?v=3","gravatar_id":"","url":"https://api.github.com/users/jgolubenko","html_url":"https://github.com/jgolubenko","followers_url":"https://api.github.com/users/jgolubenko/followers","following_url":"https://api.github.com/users/jgolubenko/following{/other_user}","gists_url":"https://api.github.com/users/jgolubenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jgolubenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgolubenko/subscriptions","organizations_url":"https://api.github.com/users/jgolubenko/orgs","repos_url":"https://api.github.com/users/jgolubenko/repos","events_url":"https://api.github.com/users/jgolubenko/events{/privacy}","received_events_url":"https://api.github.com/users/jgolubenko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/labels/icebox","name":"icebox","color":"ededed"},{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-02T01:59:31Z","updated_at":"2015-12-02T19:29:28Z","closed_at":null,"body":"I am trying to pull git repo from bitbucket for our @EnableConfigServer app, but it  fails in this method:  `JGitEnvironmentRepository.deleteBaseDirIfExists()`. \r\n\r\nWhile it might not be exactly spring-cloud-config's problem, because internally it calls eclipse.jgit.* library, but has anyone came across this before?\r\n\r\nI've tried to start from eclipse/sts, from cygwin and cmd as Administrator. (I haven't tried it on Ubuntu yet, but will do in couple hours). \r\n\r\n`basedir` configuration property makes no difference apart from checking out in temp dir or under path relative to my app, still the same error.\r\n\r\nmy application.yml\r\n\r\n```\r\nspring:\r\n  cloud:\r\n    config:\r\n      enabled: true\r\n      server:\r\n        git:\r\n          uri: https://www.bitbucket.org/myrepo/ms-configuration\r\n          password: pass\r\n          username: user\r\n          clone-on-start: true\r\n          # basedir: cloud-config/ # if I enable this, makes no difference\r\n```\r\n\r\nException that is thrown upon startup:\r\n\r\n```\r\nCaused by: java.io.IOException: Could not delete file C:\\cygwin\\tmp\\config-repo-7024054885475694217\\.git\\objects\\pack\\pack-59244256763eca9b6add9057d20587530bf2001a.pack\r\n        at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:197) ~[org.eclipse.jgit-4.1.1.201511131810-r.jar:4.1.1.201511131810-r]\r\n        at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:164) ~[org.eclipse.jgit-4.1.1.201511131810-r.jar:4.1.1.201511131810-r]\r\n        at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:166) ~[org.eclipse.jgit-4.1.1.201511131810-r.jar:4.1.1.201511131810-r]\r\n        at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:166) ~[org.eclipse.jgit-4.1.1.201511131810-r.jar:4.1.1.201511131810-r]\r\n        at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:166) ~[org.eclipse.jgit-4.1.1.201511131810-r.jar:4.1.1.201511131810-r]\r\n        at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.deleteBaseDirIfExists(JGitEnvironmentRepository.java:280) ~[spring-cloud-config-server-1.1.0.M3.jar:1.1.0.M3]\r\n        ... 34 common frames omitted\r\n```\r\n\r\nPlease note I've upgraded jgit to org.eclipse.jgit to `4.1.1.201511131810-r` from default `3.5.3.201412180710-r` hoping it would resolve this.\r\n\r\nException is thrown here: `org.springframework.cloud.config.server.environment.JGitEnvironmentRepository`\r\n\r\n```\r\n\tprivate void deleteBaseDirIfExists() {\r\n\t\tif (getBasedir().exists()) {\r\n\t\t\ttry {\r\n\t\t\t\tFileUtils.delete(getBasedir(), FileUtils.RECURSIVE);\r\n\t\t\t}\r\n\t\t\tcatch (IOException e) {\r\n\t\t\t\tthrow new IllegalStateException(\"Failed to initialize base directory\", e);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n```\r\nwhich in my case resides in  `spring-cloud-config-server-1.1.0.M3.jar`\r\n\r\nAny ideas?\r\n\r\nThank you!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/comments/161406959","html_url":"https://github.com/spring-cloud/spring-cloud-config/issues/293#issuecomment-161406959","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-config/issues/293","id":161406959,"user":{"login":"jgolubenko","id":3239162,"avatar_url":"https://avatars.githubusercontent.com/u/3239162?v=3","gravatar_id":"","url":"https://api.github.com/users/jgolubenko","html_url":"https://github.com/jgolubenko","followers_url":"https://api.github.com/users/jgolubenko/followers","following_url":"https://api.github.com/users/jgolubenko/following{/other_user}","gists_url":"https://api.github.com/users/jgolubenko/gists{/gist_id}","starred_url":"https://api.github.com/users/jgolubenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgolubenko/subscriptions","organizations_url":"https://api.github.com/users/jgolubenko/orgs","repos_url":"https://api.github.com/users/jgolubenko/repos","events_url":"https://api.github.com/users/jgolubenko/events{/privacy}","received_events_url":"https://api.github.com/users/jgolubenko/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T19:29:28Z","updated_at":"2015-12-02T19:29:28Z","body":"Here is the link to bare bones project that fails https://github.com/jgolubenko/ms-server-config-demo"}}