{"action":"created","issue":{"url":"https://api.github.com/repos/poise/python/issues/155","labels_url":"https://api.github.com/repos/poise/python/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/poise/python/issues/155/comments","events_url":"https://api.github.com/repos/poise/python/issues/155/events","html_url":"https://github.com/poise/python/issues/155","id":60093418,"number":155,"title":"Upgrading setuptools leaves behind broken symlink","user":{"login":"Igorshp","id":3381045,"avatar_url":"https://avatars.githubusercontent.com/u/3381045?v=3","gravatar_id":"","url":"https://api.github.com/users/Igorshp","html_url":"https://github.com/Igorshp","followers_url":"https://api.github.com/users/Igorshp/followers","following_url":"https://api.github.com/users/Igorshp/following{/other_user}","gists_url":"https://api.github.com/users/Igorshp/gists{/gist_id}","starred_url":"https://api.github.com/users/Igorshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igorshp/subscriptions","organizations_url":"https://api.github.com/users/Igorshp/orgs","repos_url":"https://api.github.com/users/Igorshp/repos","events_url":"https://api.github.com/users/Igorshp/events{/privacy}","received_events_url":"https://api.github.com/users/Igorshp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-06T11:59:47Z","updated_at":"2015-03-09T23:58:42Z","closed_at":null,"body":"Recently started having this issue.\r\nwhen running python::default on new node, chef will fail when trying to upgrade virtualenv.\r\n\r\nhere is the log:\r\n```\r\n[2015-03-06T11:47:56+00:00] ERROR: python_pip[virtualenv] (python::virtualenv line 23) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'\r\n---- Begin output of pip install  --upgrade virtualenv ----\r\nSTDOUT: Exception:\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/basecommand.py\", line 232, in main\r\n    status = self.run(options, args)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/commands/install.py\", line 339, in run\r\n    requirement_set.prepare_files(finder)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py\", line 229, in prepare_files\r\n    req_to_install.check_if_exists()\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py\", line 931, in check_if_exists\r\n    self.satisfied_by = pkg_resources.get_distribution(self.req)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 461, in get_distribution\r\n    dist = get_provider(dist)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 341, in get_provider\r\n    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 870, in require\r\n    needed = self.resolve(parse_requirements(requirements))\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 740, in resolve\r\n    env = Environment(self.entries)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 927, in __init__\r\n    self.scan(search_path)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 957, in scan\r\n    self.add(dist)\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 973, in add\r\n    if self.can_add(dist) and dist.has_version():\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 2658, in has_version\r\n    self.version\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 2466, in version\r\n    for line in self._get_metadata(self.PKG_INFO):\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 2510, in _get_metadata\r\n    for line in self.get_metadata_lines(name):\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 1927, in get_metadata_lines\r\n    return yield_lines(self.get_metadata(name))\r\n  File \"/usr/local/lib/python2.7/dist-packages/pip/_vendor/pkg_resources/__init__.py\", line 1921, in get_metadata\r\n    with open(self.path,'rU') as f:\r\nIOError: [Errno 2] No such file or directory: '/usr/lib/python2.7/dist-packages/setuptools.egg-info'\r\nSTDERR:\r\n---- End output of pip install  --upgrade virtualenv ----\r\n```\r\n\r\nyou can see the culprit at the end, /usr/lib/python2.7/dist-packages/setuptools.egg-info'\r\nthis file is a symink that points to a dead directory.\r\nI have check and it is alive and present before chef run.\r\n\r\nit looks like when chef does setuptools upgrade, it removes the realpath directory, but does not cleanup the symlink.\r\n\r\nDeleting the symlink manually, allows the chef run to continue.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/poise/python/issues/comments/77970290","html_url":"https://github.com/poise/python/issues/155#issuecomment-77970290","issue_url":"https://api.github.com/repos/poise/python/issues/155","id":77970290,"user":{"login":"Igorshp","id":3381045,"avatar_url":"https://avatars.githubusercontent.com/u/3381045?v=3","gravatar_id":"","url":"https://api.github.com/users/Igorshp","html_url":"https://github.com/Igorshp","followers_url":"https://api.github.com/users/Igorshp/followers","following_url":"https://api.github.com/users/Igorshp/following{/other_user}","gists_url":"https://api.github.com/users/Igorshp/gists{/gist_id}","starred_url":"https://api.github.com/users/Igorshp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Igorshp/subscriptions","organizations_url":"https://api.github.com/users/Igorshp/orgs","repos_url":"https://api.github.com/users/Igorshp/repos","events_url":"https://api.github.com/users/Igorshp/events{/privacy}","received_events_url":"https://api.github.com/users/Igorshp/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T23:58:42Z","updated_at":"2015-03-09T23:58:42Z","body":"Had to pin the version at 0.6rc11 to get chef to pass."}}