poise / poise-python

A Chef cookbook to provide a unified interface for installing Python, managing Python packages, and creating virtualenvs.
Apache License 2.0
124 stars 108 forks source link

No handlers could be found for logger "pip.index" #106

Open jblaine opened 6 years ago

jblaine commented 6 years ago

poise 2.8.1 poise-languages 2.1.1 poise-python 1.6.0

Cannot really make sense out of what is happening here.

* python_package[wheel] action install
  ================================================================================
  Error executing action `install` on resource 'python_package[wheel]'
  ================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
python_package[wheel] (/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb line 153) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of ["/usr/bin/python", "-", "wheel"] ----
STDOUT:
STDERR: No handlers could be found for logger "pip.index"
Traceback (most recent call last):
  File "<stdin>", line 38, in <module>
  File "/usr/lib/python2.7/site-packages/pip/index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
pip.exceptions.DistributionNotFound: No matching distribution found for wheel
---- End output of ["/usr/bin/python", "-", "wheel"] ----
Ran ["/usr/bin/python", "-", "wheel"] returned 1

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `tap'
/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `language_command_shell_out!'
/var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:222:in `block in language_command_mixin'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:282:in `pip_command'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:306:in `pip_outdated'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:180:in `check_package_versions'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:160:in `load_current_resource'
/var/chef/cache/cookbooks/poise/files/halite_gem/poise/helpers/notifying_block.rb:69:in `notifying_block'
/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb:50:in `action_install'

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

  8: python_runtime '2' do
  9:   not_if {node['platform_family'] == 'rhel' && node['platform_version'].to_i == 5}
 10:   provider :system
 11:   setuptools_version false
 12: end

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/r701-python/recipes/default.rb:8:in `from_file'

python_runtime("2") do
  provider PoisePython::PythonProviders::System
  action [:install]
  retries 0
  retry_delay 2
  default_guard_interpreter :default
  subresources [python_runtime_pip[2], python_package[wheel], python_package[virtualenv]]
  declared_type :python_runtime
  cookbook_name "r701-python"
  recipe_name "default"
  get_pip_url "https://bootstrap.pypa.io/get-pip.py"
  pip_version true
  version "2"
  virtualenv_version true
  wheel_version true
  not_if { #code block }
end

Platform:
---------
x86_64-linux
jblaine commented 6 years ago

I'll add that if I mask the problem by setting wheel_version false in my resource, it just falls through to the next problem (virtualenv):

* python_package[virtualenv] action install

  ================================================================================
  Error executing action `install` on resource 'python_package[virtualenv]'
  ================================================================================

  Mixlib::ShellOut::ShellCommandFailed
  ------------------------------------
  Expected process to exit with [0], but received '1'
  ---- Begin output of ["/usr/bin/python", "-", "virtualenv"] ----
  STDOUT:
  STDERR: No handlers could be found for logger "pip.index"
  Traceback (most recent call last):
    File "<stdin>", line 38, in <module>
    File "/usr/lib/python2.7/site-packages/pip/index.py", line 514, in find_requirement
      'No matching distribution found for %s' % req
  pip.exceptions.DistributionNotFound: No matching distribution found for virtualenv
  ---- End output of ["/usr/bin/python", "-", "virtualenv"] ----
  Ran ["/usr/bin/python", "-", "virtualenv"] returned 1
...
...
coderanger commented 6 years ago

Pip released a new rev yesterday, so that might be related. Does it get better if you lock pip to 9.0.2?

coderanger commented 6 years ago

(or 9.0.1)

jazaval commented 6 years ago

Observing this as well, but intermittently between multiple runs on the same node.

jblaine commented 6 years ago

Ours stopped freaking out sometime over the weekend on all of our nodes. I could be wrong, but it seemed to only be happening on RHEL 7 nodes.

jazaval commented 6 years ago

Happening for us on our macOS nodes.

coderanger commented 6 years ago

This might also be due to the pending removal of TLS 1.0 and 1.1 on PyPI. They have been doing rolling brownouts to test the removal so you might be failing. You will need to upgrade to versions of things which support TLS 1.2 to use PyPI going forward.

salsa-dev commented 5 years ago

the workaround here https://github.com/poise/poise-python/issues/140#issuecomment-462688078