{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/27217","labels_url":"https://api.github.com/repos/saltstack/salt/issues/27217/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/27217/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/27217/events","html_url":"https://github.com/saltstack/salt/issues/27217","id":107151519,"number":27217,"title":"Gitfs cleans up wrong directories","user":{"login":"nasenbaer13","id":9086889,"avatar_url":"https://avatars.githubusercontent.com/u/9086889?v=3","gravatar_id":"","url":"https://api.github.com/users/nasenbaer13","html_url":"https://github.com/nasenbaer13","followers_url":"https://api.github.com/users/nasenbaer13/followers","following_url":"https://api.github.com/users/nasenbaer13/following{/other_user}","gists_url":"https://api.github.com/users/nasenbaer13/gists{/gist_id}","starred_url":"https://api.github.com/users/nasenbaer13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasenbaer13/subscriptions","organizations_url":"https://api.github.com/users/nasenbaer13/orgs","repos_url":"https://api.github.com/users/nasenbaer13/repos","events_url":"https://api.github.com/users/nasenbaer13/events{/privacy}","received_events_url":"https://api.github.com/users/nasenbaer13/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/File%20Servers","name":"File Servers","color":"006b75"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Fixed%20Pending%20Verification","name":"Fixed Pending Verification","color":"d4c5f9"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P3","name":"P3","color":"0a3d77"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Platform","name":"Platform","color":"fef2c0"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2581,"closed_issues":2630,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-09-28T11:34:16Z","due_on":null,"closed_at":null},"comments":18,"created_at":"2015-09-18T07:52:51Z","updated_at":"2015-09-28T11:39:31Z","closed_at":"2015-09-18T19:43:53Z","body":"When running a file recurse state, copying some files fails because the wrong directory is cleaned up.\r\n```\r\nSep 17 18:55:12 [DEBUG   ] LazyLoaded local_cache.clean_old_jobs\r\nSep 17 18:55:12 [DEBUG   ] Updating fileserver for git_pillar module\r\nSep 17 18:55:12 [DEBUG   ] Updating fileserver for git_pillar module\r\nSep 17 18:55:12 [DEBUG   ] Updating fileserver for git_pillar module\r\nSep 17 18:55:12 [DEBUG   ] Updating fileserver for git_pillar module\r\nSep 17 18:55:12 [DEBUG   ] Updating fileserver for git_pillar module\r\nSep 17 18:55:12 [DEBUG   ] Updating fileserver for git_pillar module\r\nSep 17 18:55:12 [DEBUG   ] Could not LazyLoad config.merge\r\nSep 17 18:55:12 [DEBUG   ] Updating git fileserver cache\r\nSep 17 18:55:12 [DEBUG   ] gitfs removed old cachedir /var/cache/salt/master/gitfs/gitfs\r\nSep 17 18:55:12 [INFO    ] Wrote new gitfs remote map to /var/cache/salt/master/gitfs/remote_map.txt\r\nSep 17 18:55:12 [DEBUG   ] Set lock for file:///repo.git\r\nSep 17 18:55:12 [DEBUG   ] gitfs is fetching from 'file:///repo.git'\r\nSep 17 18:55:12 [ERROR   ] Error in function _file_hash:\r\nSep 17 18:55:12 Traceback (most recent call last):\r\nSep 17 18:55:12   File \"/usr/lib/python2.7/dist-packages/salt/master.py\", line 1379, in run_func\r\nSep 17 18:55:12     ret = getattr(self, func)(load)\r\nSep 17 18:55:12   File \"/usr/lib/python2.7/dist-packages/salt/fileserver/__init__.py\", line 528, in file_hash\r\nSep 17 18:55:12     fnd = self.find_file(load['path'], load['saltenv'])\r\nSep 17 18:55:12   File \"/usr/lib/python2.7/dist-packages/salt/fileserver/__init__.py\", line 482, in find_file\r\nSep 17 18:55:12     fnd = self.servers[fstr](path, saltenv, **kwargs)\r\nSep 17 18:55:12   File \"/usr/lib/python2.7/dist-packages/salt/fileserver/gitfs.py\", line 143, in find_file\r\nSep 17 18:55:12     return gitfs.find_file(path, tgt_env=tgt_env, **kwargs)\r\nSep 17 18:55:12   File \"/usr/lib/python2.7/dist-packages/salt/utils/gitfs.py\", line 2100, in find_file\r\nSep 17 18:55:12     with salt.utils.fopen(lk_fn, 'w+') as fp_:\r\nSep 17 18:55:12   File \"/usr/lib/python2.7/dist-packages/salt/utils/__init__.py\", line 1208, in fopen\r\nSep 17 18:55:12     fhandle = open(*args, **kwargs)\r\nSep 17 18:55:12 IOError: [Errno 2] No such file or directory: '/var/cache/salt/master/gitfs/gitfs/hash/path/to/my/file.jinja.lk'\r\nSep 17 18:55:12 [DEBUG   ] Removed lock for file:///repo.git\r\n```\r\n\r\nThe crucial line here is:\r\n\r\n    gitfs removed old cachedir /var/cache/salt/master/gitfs/gitfs\r\n\r\nwhich removes the gitfs directory."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/143719476","html_url":"https://github.com/saltstack/salt/issues/27217#issuecomment-143719476","issue_url":"https://api.github.com/repos/saltstack/salt/issues/27217","id":143719476,"user":{"login":"nasenbaer13","id":9086889,"avatar_url":"https://avatars.githubusercontent.com/u/9086889?v=3","gravatar_id":"","url":"https://api.github.com/users/nasenbaer13","html_url":"https://github.com/nasenbaer13","followers_url":"https://api.github.com/users/nasenbaer13/followers","following_url":"https://api.github.com/users/nasenbaer13/following{/other_user}","gists_url":"https://api.github.com/users/nasenbaer13/gists{/gist_id}","starred_url":"https://api.github.com/users/nasenbaer13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasenbaer13/subscriptions","organizations_url":"https://api.github.com/users/nasenbaer13/orgs","repos_url":"https://api.github.com/users/nasenbaer13/repos","events_url":"https://api.github.com/users/nasenbaer13/events{/privacy}","received_events_url":"https://api.github.com/users/nasenbaer13/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T11:39:31Z","updated_at":"2015-09-28T11:39:31Z","body":"https://github.com/eyj/salt/commit/e6b36208296ea843815b387b987ee51ab68934db\r\n\r\nif @terminalmage considers this as a proper fix I would create a pull request vs. saltstack/salt/2015.8."}}