Homebrew-core: ansible 2.3.2.0 is not getting installed properly

Created on 24 Aug 2017  路  13Comments  路  Source: Homebrew/homebrew-core

  • [x] Confirmed this is a problem with brew installing one, specific formula (not cask) and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Homebrew/brew/issues/new. If it's a brew cask problem please file this issue at https://github.com/Homebrew/caskroom/homebrew-cask/new
  • [x] Ran brew update and retried your prior step?
  • [x] Ran brew doctor, fixed all issues and retried your prior step?
  • [x] Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
$ brew gist-logs ansible
Error: No logs.
  • [x] If brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
$ brew config
HOMEBREW_VERSION: 1.3.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: 69799d97b1e7314912b2ee234dec2c179c5fb969
Last commit: 2 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 8e536a2695eff1751ec3ec984173e75146a9b825
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.14.1 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_144
macOS: 10.11.6-x86_64
Xcode: N/A
CLT: 8.2.0.0.1.1480973914
X11: N/A

$ brew doctor
Your system is ready to brew.

Please note we will close your issue without comment if you delete or do not fill out the issue checklist and provide ALL the requested information.

To help us debug your issue please explain:

  • What you were trying to do (and why)

Run an ansible playbook that was working until today (I hadn't ran it for a couple of weeks or so though).

  • What happened (include command output)

I think a recent executing of brew update/upgrade had upgraded Ansible to 2.3.2.0 and since this morning I am getting this error message when I want to run the playbook:

fatal: [cdcadaptutl01q3.qa.svc.sb.int]: FAILED! => {"failed": true, "msg": "paramiko is not installed"}
  • What you expected to happen

In the past the playbook was working without any problems. Also I have removed all previous installs of Ansible and there doesn't seem to be a way to downgrade to 2.2.x.

  • Step-by-step reproduction instructions (by running brew install commands)
* On a clean install of OS X 10.11.6, install Homebrew
* Then install ansible 2.3.2.0 (current version in HB)
* Run a playbook that has a remote inventory

All 13 comments

Is there a way to temporary downgrade to 2.2.x?

If you haven't yet run brew cleanup you should be able to simply brew switch ansible 2.3.1.0.

Unfortunately it is too late. :(

IMHO this formula should be converted into [email protected] and added to the core: https://raw.githubusercontent.com/Homebrew/homebrew-core/2da35c549a8e273ad3e421b7b2e8a94ff3ab04fa/Formula/ansible.rb.

Well, if you're feeling particularly dedicated you could:

brew rm ansible
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/2da35c549a8e273ad3e421b7b2e8a94ff3ab04fa/Formula/ansible.rb
brew pin ansible

I suspect that would work. You'd have to remember to unpin it at some point, presuming you ever wanted it upgraded again, but otherwise.

What's peculiar is that paramiko is still very much part of the ansible formula, so perhaps the "real" issue here is that upstream has a silently-pinned dependency or something and is rejecting 2.2.1 as a valid paramiko. But it's strange nobody else has complained yet IIRC; ansible is pretty popular. Hmm.

I have a feeling this will only occur if the brew installation is relatively new. A couple of weeks ago our help desk re-imaged my machine so I had to re-install home-brew again.

In the first few days it was working fine but today I needed to run it again locally and it started failing.

Thanks for the tip above. It fixed my problem. I will create a PR for the 2.2.x version later today.

Cheers.

Probably not going to add a 2.2 if it's just because 2.3 is misbehaving, which should be fixed not papered over. But I'm skeptical it's actually broken given

Josephs-MacBook-Pro:~ joe$ brew formula-analytics ansible
install events in the last 30 days for ansible
=====================================================================================================
1 | ansible                                                                        | 17,462 |  99.82%
2 | ansible --HEAD                                                                 |     32 |   0.18%
=====================================================================================================
Total                                                                              | 17,494 |    100%
=====================================================================================================

and this is the only issue report we've had.

In https://github.com/Homebrew/homebrew-core/pull/16902 parmiko was upgraded from 2.1.2 to 2.2.1

   resource "paramiko" do
-    url "https://files.pythonhosted.org/packages/64/79/5e8baeedb6baf1d5879efa8cd012f801efc232e56a068550ba00d7e82625/paramiko-2.1.2.tar.gz"
-    sha256 "5fae49bed35e2e3d45c4f7b0db2d38b9ca626312d91119b3991d0ecf8125e310"
+    url "https://files.pythonhosted.org/packages/d1/0b/c8bc96c79bbda0bcc9f2912389fa59789bb8e7e161f24b01082b4c3f948d/paramiko-2.2.1.tar.gz"
+    sha256 "ff94ae65379914ec3c960de731381f49092057b6dd1d24d18842ead5a2eb2277"
   end

So you could try downgrading that.

Yup it's messed up:

iMac-TMP:2.3.2.0 joe$ . libexec/bin/activate
(libexec) iMac-TMP:2.3.2.0 joe$ which python
/usr/local/Cellar/ansible/2.3.2.0/libexec/bin/python
(libexec) iMac-TMP:2.3.2.0 joe$ python
Python 2.7.13 (default, Jul 18 2017, 09:16:53) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/ansible/2.3.2.0/libexec/lib/python2.7/site-packages/paramiko/__init__.py", line 31, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/local/Cellar/ansible/2.3.2.0/libexec/lib/python2.7/site-packages/paramiko/transport.py", line 57, in <module>
    from paramiko.ed25519key import Ed25519Key
  File "/usr/local/Cellar/ansible/2.3.2.0/libexec/lib/python2.7/site-packages/paramiko/ed25519key.py", line 17, in <module>
    import bcrypt
ImportError: No module named bcrypt
>>> 
(libexec) iMac-TMP:2.3.2.0 joe$ pip2 install bcrypt
Collecting bcrypt
  Using cached bcrypt-3.1.3-cp27-cp27m-macosx_10_6_intel.whl
Requirement already satisfied: six>=1.4.1 in ./libexec/lib/python2.7/site-packages (from bcrypt)
Requirement already satisfied: cffi>=1.1 in ./libexec/lib/python2.7/site-packages (from bcrypt)
Requirement already satisfied: pycparser in ./libexec/lib/python2.7/site-packages (from cffi>=1.1->bcrypt)
Installing collected packages: bcrypt
Successfully installed bcrypt-3.1.3
(libexec) iMac-TMP:2.3.2.0 joe$ python
Python 2.7.13 (default, Jul 18 2017, 09:16:53) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/ansible/2.3.2.0/libexec/lib/python2.7/site-packages/paramiko/__init__.py", line 31, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/usr/local/Cellar/ansible/2.3.2.0/libexec/lib/python2.7/site-packages/paramiko/transport.py", line 57, in <module>
    from paramiko.ed25519key import Ed25519Key
  File "/usr/local/Cellar/ansible/2.3.2.0/libexec/lib/python2.7/site-packages/paramiko/ed25519key.py", line 22, in <module>
    import nacl.signing
ImportError: No module named nacl.signing
>>> 
(libexec) iMac-TMP:2.3.2.0 joe$ pip2 install PyNaCl
Collecting PyNaCl
  Using cached PyNaCl-1.1.2-cp27-cp27m-macosx_10_6_intel.whl
Requirement already satisfied: cffi>=1.4.1 in ./libexec/lib/python2.7/site-packages (from PyNaCl)
Requirement already satisfied: six in ./libexec/lib/python2.7/site-packages (from PyNaCl)
Requirement already satisfied: pycparser in ./libexec/lib/python2.7/site-packages (from cffi>=1.4.1->PyNaCl)
Installing collected packages: PyNaCl
Successfully installed PyNaCl-1.1.2
(libexec) iMac-TMP:2.3.2.0 joe$ python
Python 2.7.13 (default, Jul 18 2017, 09:16:53) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import paramiko
>>> 

Missing bcrypt and PyNaCl.

@behrangsa This should now be fixed.

brew update
brew unpin ansible
brew upgrade

@ilovezfs Ta for sorting this 鉂わ笍. Was going to take a look later today but wanted to sleep a bit, heh.

@ilovezfs thanks mate!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sstadick picture sstadick  路  4Comments

faraazkhan picture faraazkhan  路  3Comments

jyutzler picture jyutzler  路  4Comments

jakepetroules picture jakepetroules  路  3Comments

xeoneux picture xeoneux  路  3Comments