Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cookbook python conflicts with this cookbook #12

Open
thmttch opened this issue Sep 7, 2014 · 1 comment
Open

Bug: cookbook python conflicts with this cookbook #12

thmttch opened this issue Sep 7, 2014 · 1 comment

Comments

@thmttch
Copy link
Owner

thmttch commented Sep 7, 2014

If you run include both python (the "standard" one; there might be others, but this is the only one I know of) and this cookbook, what happens is that python tries to upgrade setuptools (it appears because the version of setuptools installed by anaconda differs/is less than the latest). This will cause the chef-run to fail with an error, something like:

Recipe: python::pip                                                                                                                                                [3947/8999]
  * cookbook_file[/var/chef/cache/get-pip.py] action create (skipped due to not_if)
  * execute[install-pip] action run (skipped due to not_if)
  * python_pip[setuptools] action upgrade
================================================================================
Error executing action `upgrade` on resource 'python_pip[setuptools]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of pip install  --upgrade setuptools ----
STDOUT: Downloading/unpacking setuptools from https://pypi.python.org/packages/3.4/s/setuptools/setuptools-5.7-py2.py3-none-any.whl#md5=94eedce8d9b793d4affa4a85cd45edfa
Installing collected packages: setuptools
  Found existing installation: setuptools 3.6
Cleaning up...
Cannot remove entries from nonexistent file /opt/anaconda/2.0.1/lib/python2.7/site-packages/easy-install.pth
Storing debug log for failure in /home/ubuntu/.pip/pip.log
STDERR:
---- End output of pip install  --upgrade setuptools ----
Ran pip install  --upgrade setuptools returned 1


Cookbook Trace:
---------------
/var/chef/cache/cookbooks/python/providers/pip.rb:158:in `pip_cmd'
/var/chef/cache/cookbooks/python/providers/pip.rb:139:in `install_package'
/var/chef/cache/cookbooks/python/providers/pip.rb:144:in `upgrade_package'
/var/chef/cache/cookbooks/python/providers/pip.rb:60:in `block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/python/providers/pip.rb:58:in `block in class_from_file'


Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/python/recipes/pip.rb

 50: python_pip 'setuptools' do
 51:   action :upgrade
 52:   version node['python']['setuptools_version']
 53: end


Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/python/recipes/pip.rb:50:in `from_file'

python_pip("setuptools") do
  action [:upgrade]
  retries 0
  retry_delay 2
  cookbook_name "python"
  recipe_name "pip"
  package_name "setuptools"
  options " --upgrade"
  timeout 900
end


[2014-09-07T20:31:57+00:00] ERROR: Running exception handlers
[2014-09-07T20:31:57+00:00] ERROR: Exception handlers complete
[2014-09-07T20:31:57+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 4 resources updated
[2014-09-07T20:31:57+00:00] ERROR: python_pip[setuptools] (python::pip line 50) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but rec
eived '1'
---- Begin output of pip install  --upgrade setuptools ----
STDOUT: Downloading/unpacking setuptools from https://pypi.python.org/packages/3.4/s/setuptools/setuptools-5.7-py2.py3-none-any.whl#md5=94eedce8d9b793d4affa4a85cd45edfa
Installing collected packages: setuptools
  Found existing installation: setuptools 3.6
Cleaning up...
Cannot remove entries from nonexistent file /opt/anaconda/2.0.1/lib/python2.7/site-packages/easy-install.pth
Storing debug log for failure in /home/ubuntu/.pip/pip.log
STDERR:
---- End output of pip install  --upgrade setuptools ----
Ran pip install  --upgrade setuptools returned 1

For now, the best workaround is to use chef-rewind to remove that resource, but this requires the user to know to include the workaround recipe (and can break other stuff). Clearly a hack.

This is just a hypothesis; comments, feedback, logs, new/better ideas, etc are appreciated!

@stxlvt
Copy link

stxlvt commented Jan 7, 2016

See pypa/pip#2751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants