Closed TiagoSantos84 closed 6 years ago
Hi,
I found the same issue and I investigated. This issue is caused because pip version.
At current, minemeld-ansible requires pip.utils.egg_link_path
.
But the function has no longer available on pip 10.
pip 9.0.3 https://github.com/pypa/pip/blob/9.0.3/pip/utils/__init__.py#L384
pip 10.0.0 (there is no 'utils' package) https://github.com/pypa/pip/tree/10.0.0/src/pip
My workaround I found:
... # preparing based on the current installation document
$ ansible-playbook -K -i 127.0.0.1, local.yml
... # oops! the issue occurred
$ sudo -H /opt/minemeld/engine/current/bin/pip install -U "pip<10.0" # downgrade pip
$ ansible-playbook -K -i 127.0.0.1, local.yml # retry
...
PLAY RECAP *********************************************************************
127.0.0.1 : ok=76 changed=41 unreachable=0 failed=0
Yay!
NOTE: pip 10 was released at 15/4/2018. https://pypi.org/project/pip/#history
My environment:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
$ uname -a
Linux vagrant 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Another solution (much more efficiency):
...
$ git clone https://github.com/PaloAltoNetworks/minemeld-ansible.git
$ cd minemeld-ansible
$ cat << 'EOF' > /tmp/downgrade-pip.patch
diff --git a/roles/minemeld/tasks/core.yml b/roles/minemeld/tasks/core.yml
index 148176a..d676494 100644
--- a/roles/minemeld/tasks/core.yml
+++ b/roles/minemeld/tasks/core.yml
@@ -13,6 +13,10 @@
command: virtualenv "{{venv_directory}}" -p python2.7 creates="{{venv_directory}}"
- name: virtualenv permissions
file: path="{{venv_directory}}" state=directory recurse=yes owner=minemeld group=minemeld mode="{{file_permissions}}"
+- name: downgrade pip
+ pip:
+ virtualenv: "{{venv_directory}}"
+ name: "pip<10.0"
- name: requirements
pip:
virtualenv: "{{venv_directory}}"
EOF
$ patch -p 1 < /tmp/downgrade-pip.patch
patching file roles/minemeld/tasks/core.yml
$ ansible-playbook -K -i 127.0.0.1, local.yml
@satosi-k
Thank you for your reply! In the error I can see the message "No module named utils". However, It never pop up in my mind downgrade pip...
Let me ask you, what is the main difference between methods?
Thank you!!
@TiagoSantos84
There is no essentially difference. The first solution: manually The second solution: automated
BTW,
The above solutions are just workaround. IMHO, it is more better that minemeld supports pip 10 (or more version neutral solution). But the workaround is effectively by now for troubled users. Should I send PR the workaround patch? > development team
pip.utils support in pip10 will be a better solution. If someone develop a patch, it will be nice!
Anyway, for now it work.
Thank you!
@satosi-k yes, please @TiagoSantos84 thanks for reporting this!
I will start working on support for pip 10. I already implemented the patches for MineMeld engine, minemeld-ansible is next.
@jtschichold thanks. I'll send it.
Hi,
I already install minemeld previously, however I'm not able to o it anymore.
I always get this error:
TASK [minemeld : create extensions frigidaire] ****************************************************************************************************************** fatal: [192.168.10.136]: FAILED! => {"changed": true, "cmd": ["/opt/minemeld/engine/current/bin/mm-extensions-freeze", "/opt/minemeld/local/library", "/opt/minemeld/local/library/freeze.txt"], "delta": "0:00:00.563334", "end": "2018-04-19 00:24:58.386675", "msg": "non-zero return code", "rc": 1, "start": "2018-04-19 00:24:57.823341", "stderr": "Traceback (most recent call last):\n File \"/opt/minemeld/engine/current/bin/mm-extensions-freeze\", line 11, in <module>\n load_entry_point('minemeld-core', 'console_scripts', 'mm-extensions-freeze')()\n File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 480, in load_entry_point\n return get_distribution(dist).load_entry_point(group, name)\n File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2693, in load_entry_point\n return ep.load()\n File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2324, in load\n return self.resolve()\n File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2330, in resolve\n module = __import__(self.module_name, fromlist=['__name__'], level=0)\n File \"/opt/minemeld/engine/core/minemeld/run/freeze.py\", line 19, in <module>\n import minemeld.extensions\n File \"/opt/minemeld/engine/core/minemeld/extensions/__init__.py\", line 1, in <module>\n from .manager import * # noqa\n File \"/opt/minemeld/engine/core/minemeld/extensions/manager.py\", line 11, in <module>\n from pip.utils import egg_link_path\nImportError: No module named utils", "stderr_lines": ["Traceback (most recent call last):", " File \"/opt/minemeld/engine/current/bin/mm-extensions-freeze\", line 11, in <module>", " load_entry_point('minemeld-core', 'console_scripts', 'mm-extensions-freeze')()", " File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 480, in load_entry_point", " return get_distribution(dist).load_entry_point(group, name)", " File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2693, in load_entry_point", " return ep.load()", " File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2324, in load", " return self.resolve()", " File \"/opt/minemeld/engine/current/local/lib/python2.7/site-packages/pkg_resources/__init__.py\", line 2330, in resolve", " module = __import__(self.module_name, fromlist=['__name__'], level=0)", " File \"/opt/minemeld/engine/core/minemeld/run/freeze.py\", line 19, in <module>", " import minemeld.extensions", " File \"/opt/minemeld/engine/core/minemeld/extensions/__init__.py\", line 1, in <module>", " from .manager import * # noqa", " File \"/opt/minemeld/engine/core/minemeld/extensions/manager.py\", line 11, in <module>", " from pip.utils import egg_link_path", "ImportError: No module named utils"], "stdout": "", "stdout_lines": []} to retry, use: --limit @/home/mine/minemeld-ansible/local.retry