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

nAttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?\n", "module_stdout #14633

Open
Lexicanium opened this issue Jul 28, 2023 · 1 comment

Comments

@Lexicanium
Copy link

Describe the bug

on fresh installation, from master trying to deploy on fresh Azure cloud

Enter the number of your desired region
[20]
:
41^M
TASK [cloud-azure : pause] ***************************************************************************************************************************
ok: [localhost]

TASK [cloud-azure : set_fact] ************************************************************************************************************************
ok: [localhost]

TASK [cloud-azure : Create AlgoVPN Server] ***********************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"<stdin>\", line 107, in <module>\n  File \"<stdin>\", line 99, in _ansiballz_main\n  File \"<stdin>\", line 47, in invoke_module\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py\", line 706, in <module>\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py\", line 702, in main\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py\", line 465, in __init__\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 469, in __init__\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py\", line 475, in exec_module\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/modules/azure_rm_deployment.py\", line 532, in deploy_template\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 1071, in rm_client\n  File \"/var/folders/gf/k97vplfs0kq5rgx4cp5557sh0000gn/T/ansible_azure_rm_deployment_payload_8me0orst/ansible_azure_rm_deployment_payload.zip/ansible_collections/azure/azcollection/plugins/module_utils/azure_rm_common.py\", line 882, in get_mgmt_svc_client\nAttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

TASK [include_tasks] *********************************************************************************************************************************
included: /Users/standard/Downloads/algo-master/playbooks/rescue.yml for localhost

TASK [debug] *****************************************************************************************************************************************
ok: [localhost] => {
    "fail_hint": [
        "Sorry, but something went wrong!",
        "Please check the troubleshooting guide.",
        "https://trailofbits.github.io/algo/troubleshooting.html"
    ]
}

TASK [Fail the installation] *************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed as requested from task"}

PLAY RECAP *******************************************************************************************************************************************
localhost                  : ok=31   changed=6    unreachable=0    failed=1    skipped=1    rescued=1    ignored=0   

(.env) 

@xrubioj
Copy link

xrubioj commented Sep 27, 2023

The issue seems to be with Python 3.11+. The azure package used is quite old. It depends on ansible-collections, which got support for Python 3.11 in v1.15.0 https://github.com/ansible-collections/azure/releases. I tried to update the dependency to ansible 7.7.0, but given the change is a major version (from current 6.1.0) I got lots of problems.

My workaround has been to use Python 3.10 (which happened to be in my system) by replacing python3 with python3.10 in the installation commands:

python3.10 -m pip install --user --upgrade virtualenv

and:

python3.10 -m virtualenv --python="$(command -v python3.10)" .env &&
 source .env/bin/activate &&
 python3.10 -m pip install -U pip virtualenv &&
 python3.10 -m pip install -r requirements.txt

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