StreisandEffect / streisand

Streisand sets up a new server running your choice of WireGuard, OpenConnect, OpenSSH, OpenVPN, Shadowsocks, sslh, Stunnel, or a Tor bridge. It also generates custom instructions for all of these services. At the end of the run you are given an HTML file with instructions that can be shared with friends, family members, and fellow activists.
https://twitter.com/streisandvpn
Other
23.17k stars 2k forks source link

Azure Deployment failed: Ansible packaging.version error #735

Closed markojak closed 7 years ago

markojak commented 7 years ago

Thanks to everyone who contributed to Azure support for Streisand.

I've decided to give deployment to Azure a go but am experiencing issues with the Ansible deployment and I'm getting an error that appears to be generated from Ansible when creating a resource group for the resources.

Error generated / Traceback below:

TASK [azure-security-group : Create Azure resource group] **********************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named packaging.version
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_lPAZTj/ansible_module_azure_rm_resourcegroup.py\", line 107, in <module>\n    from ansible.module_utils.azure_rm_common import *\n  File \"/tmp/ansible_lPAZTj/ansible_modlib.zip/ansible/module_utils/azure_rm_common.py\", line 29, in <module>\nImportError: No module named packaging.version\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

I believe that this is being caused by an incompatibility between ansible version and azure package version which is unusual as I've also tried running ansible 2.3.0.0

I've also tried the following:

Does anyone think that it is possible there are some incompatibilities if I have Azure CLI v2.0 installed as well?

$ pip freeze |grep azure
azure==2.0.0rc5
azure-batch==0.30.0rc5
azure-common==1.1.4
azure-graphrbac==0.30.0rc5
azure-mgmt==0.30.0rc5
azure-mgmt-authorization==0.30.0rc5
azure-mgmt-batch==0.30.0rc5
azure-mgmt-cdn==0.30.0rc5
azure-mgmt-cognitiveservices==0.30.0rc5
azure-mgmt-commerce==0.30.0rc5
azure-mgmt-compute==0.30.0rc5
azure-mgmt-keyvault==0.30.0rc5
azure-mgmt-logic==0.30.0rc5
azure-mgmt-network==0.30.0rc5
azure-mgmt-notificationhubs==0.30.0rc5
azure-mgmt-nspkg==2.0.0
azure-mgmt-powerbiembedded==0.30.0rc5
azure-mgmt-redis==0.30.0rc5
azure-mgmt-resource==0.30.0rc5
azure-mgmt-scheduler==0.30.0rc5
azure-mgmt-storage==0.30.0rc5
azure-mgmt-web==0.30.0rc5
azure-nspkg==2.0.0
azure-servicebus==0.20.2
azure-servicemanagement-legacy==0.20.3
azure-storage==0.32.0
msrestazure==0.4.8

Additional Details:

Target Cloud Provider:

Azure

Operating System of target host:

As per the script?

Operating System of client:

Ubuntu 16.04

Version of Ansible, using ansible --version :

Ansible version is ansible==2.3.1.0

soundman666 commented 7 years ago

I have the same error ansible 2.3.1.0

cpu commented 7 years ago

Speaking personally I don't have access/bandwidth to dig into Azure issues, though it seems like this may be a client side issue with the Azure module & Ansible.

@alimakki @jlund Do either of you have a working Azure setup? @blotzu Do you have interest in looking at this?

blotzu commented 7 years ago

I remember seeing this error as well when I ran the setup on windows bash. The setup works fine for me.

pip 9.0.1 Python 2.7.6

pip freeze | grep azure
azure==2.0.0rc5
azure-batch==0.30.0rc5
azure-common==1.1.4
azure-graphrbac==0.30.0rc5
azure-mgmt==0.30.0rc5
azure-mgmt-authorization==0.30.0rc5
azure-mgmt-batch==0.30.0rc5
azure-mgmt-cdn==0.30.0rc5
azure-mgmt-cognitiveservices==0.30.0rc5
azure-mgmt-commerce==0.30.0rc5
azure-mgmt-compute==0.30.0rc5
azure-mgmt-keyvault==0.30.0rc5
azure-mgmt-logic==0.30.0rc5
azure-mgmt-network==0.30.0rc5
azure-mgmt-notificationhubs==0.30.0rc5
azure-mgmt-nspkg==1.0.0
azure-mgmt-powerbiembedded==0.30.0rc5
azure-mgmt-redis==0.30.0rc5
azure-mgmt-resource==0.30.0rc5
azure-mgmt-scheduler==0.30.0rc5
azure-mgmt-storage==0.30.0rc5
azure-mgmt-web==0.30.0rc5
azure-nspkg==1.0.0
azure-servicebus==0.20.2
azure-servicemanagement-legacy==0.20.3
azure-storage==0.32.0
msrestazure==0.4.7
pip freeze | grep packaging
packaging==16.8

From the above list the only difference is msrestazure==0.4.7 @marchofreason @soundman666 What versions do you have for

moofkit commented 7 years ago

have same issue here

ansible 2.3.1.0
pip 9.0.1
Python 2.7.13

$ pip freeze | grep azure
azure==2.0.0rc5
azure-batch==0.30.0rc5
azure-common==1.1.4
azure-graphrbac==0.30.0rc5
azure-mgmt==0.30.0rc5
azure-mgmt-authorization==0.30.0rc5
azure-mgmt-batch==0.30.0rc5
azure-mgmt-cdn==0.30.0rc5
azure-mgmt-cognitiveservices==0.30.0rc5
azure-mgmt-commerce==0.30.0rc5
azure-mgmt-compute==0.30.0rc5
azure-mgmt-keyvault==0.30.0rc5
azure-mgmt-logic==0.30.0rc5
azure-mgmt-network==0.30.0rc5
azure-mgmt-notificationhubs==0.30.0rc5
azure-mgmt-nspkg==2.0.0
azure-mgmt-powerbiembedded==0.30.0rc5
azure-mgmt-redis==0.30.0rc5
azure-mgmt-resource==0.30.0rc5
azure-mgmt-scheduler==0.30.0rc5
azure-mgmt-storage==0.30.0rc5
azure-mgmt-web==0.30.0rc5
azure-nspkg==2.0.0
azure-servicebus==0.20.2
azure-servicemanagement-legacy==0.20.3
azure-storage==0.32.0
msrestazure==0.4.8

and there is empty with pip freeze | grep packaging

frazercol commented 7 years ago

I had the same error running from a VirtualBox lubuntu 17.04 client. pip freeze | grep packaging didn't return anything.

Running the sudo pip install packaging command fixed the issue for me. Hope this helps!