openwhisk icon indicating copy to clipboard operation
openwhisk copied to clipboard

docker-py or httplib2 is incompletely cleaned up in ansible, causing errors when deploying with ansible again

Open houshengbo opened this issue 10 years ago • 4 comments

After a deployment with ansible, we will run into the following issue, when we run "ansible-playbook -i environments/local prereq.yml -e mode=clean":

_pip can't proceed with requirement 'docker-py' due to a pre-existing build directory.
 location: /tmp/pip_build_root/docker-py
This is likely due to a previous installation that failed.
pip is being responsible and not assuming it can delete this.
Please delete it and try again.

Storing debug log for failure in /home/vagrant/.pip/pip.log__

It seems that docker-py in uninstalled, but it does not clean up the folder /tmp/pip_build_root/docker-py for the previous installation.

houshengbo avatar Jun 10 '16 15:06 houshengbo

This error message is for the httplib2, when we run ansible-playbook -i environments/local prereq.yml -e mode=clean:

TASK [prereq : remove httplib2] ************************************************
Friday 10 June 2016  16:09:18 +0000 (0:00:00.426)       0:00:02.362 *********** 
changed: [172.17.0.1]
fatal: [10.0.2.15]: FAILED! => {"changed": false, "cmd": "/usr/bin/pip uninstall -y httplib2", "failed": true, "msg": "stdout: Uninstalling httplib2:\nException:\nTraceback (most recent call last):\n  File \"/usr/lib/python2.7/dist-packages/pip/basecommand.py\", line 122, in main\n    status = self.run(options, args)\n  File \"/usr/lib/python2.7/dist-packages/pip/commands/uninstall.py\", line 59, in run\n    requirement_set.uninstall(auto_confirm=options.yes)\n  File \"/usr/lib/python2.7/dist-packages/pip/req.py\", line 1036, in uninstall\n    req.uninstall(auto_confirm=auto_confirm)\n  File \"/usr/lib/python2.7/dist-packages/pip/req.py\", line 599, in uninstall\n    paths_to_remove.remove(auto_confirm)\n  File \"/usr/lib/python2.7/dist-packages/pip/req.py\", line 1845, in remove\n    renames(path, new_path)\n  File \"/usr/lib/python2.7/dist-packages/pip/util.py\", line 296, in renames\n    shutil.move(old, new)\n  File \"/usr/lib/python2.7/shutil.py\", line 302, in move\n    copy2(src, real_dst)\n  File \"/usr/lib/python2.7/shutil.py\", line 130, in copy2\n    copyfile(src, dst)\n  File \"/usr/lib/python2.7/shutil.py\", line 82, in copyfile\n    with open(src, 'rb') as fsrc:\nIOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/httplib2-0.9.2.egg-info'\n\nStoring debug log for failure in /root/.pip/pip.log\n"}

PLAY RECAP *********************************************************************
10.0.2.15                  : ok=3    changed=0    unreachable=0    failed=1   
172.17.0.1                 : ok=4    changed=2    unreachable=0    failed=0   

Friday 10 June 2016  16:09:18 +0000 (0:00:00.363)       0:00:02.725 *********** 
=============================================================================== 
setup ------------------------------------------------------------------- 1.83s
prereq : remove docker-py ----------------------------------------------- 0.43s
prereq : remove httplib2 ------------------------------------------------ 0.36s
prereq : include -------------------------------------------------------- 0.05s
prereq : include -------------------------------------------------------- 0.03s

houshengbo avatar Jun 10 '16 16:06 houshengbo

which env did you use here? vagrant? which machine has 10.0.2.15 ?

lehoanganh avatar Jun 13 '16 11:06 lehoanganh

@houshengbo is this issue still valid?

lehoanganh avatar Jun 23 '16 11:06 lehoanganh

@lehoanganh let me verify it.

houshengbo avatar Jul 01 '16 01:07 houshengbo