-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Deploy error: The error was: AttributeError: module 'time' has no attribute 'clock' #1881
Comments
I think the problem is in this file: algo/roles/cloud-azure/tasks/venv.yml The version of azure-cli-core is too old. So this line has to change: I've changed it to this, and the deploy worked: Hope this helps... I could do a pull request I guess? |
…esolve errors trailofbits#1881 I needed the update to azure-cli-core as suggested by @benzin1984 but the new version didn't work for me without an update to msrestazure as well. Dependency changes: msrestazure==0.6.4 azure-cli-core==2.16.0
This should probably mirror the official Ansible collection for azure, rather than just trying to update random modules until it works: https://github.com/ansible-collections/azure/blob/dev/requirements-azure.txt (It seems likely this is where the list came from in the first place) EDIT: Tested this, and unfortunately the update to azure-mgmt-resource breaks the ansible module, so that change should probably not be added. But at least aligning to |
Still hitting this issue today. Has this not been addressed in master yet? I'll try the tip above in the meantime.
|
This issue still persists running Python 3.8.2 trying to connect to Azure. Neither changing azure-cli-core to 2.12.0 or 2.11.1 works. |
So i updated the algo/roles/cloud-azure/tasks/venv.yml file with the following values: I am running az core version 2.24.2, you can check it with az --version. Also in my case i had to refresh the azure toke running |
…esolve errors (#14109) #1881 I needed the update to azure-cli-core as suggested by @benzin1984 but the new version didn't work for me without an update to msrestazure as well. Dependency changes: msrestazure==0.6.4 azure-cli-core==2.16.0
…esolve errors (trailofbits#14109) trailofbits#1881 I needed the update to azure-cli-core as suggested by @benzin1984 but the new version didn't work for me without an update to msrestazure as well. Dependency changes: msrestazure==0.6.4 azure-cli-core==2.16.0
While deploying to Azure, got this error:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: module 'time' has no attribute 'clock'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File "/home/ll/.ansible/tmp/ansible-tmp-1600930951.3805804-16482-30144226544439/AnsiballZ_azure_rm_deployment.py", line 102, in \n _ansiballz_main()\n File "/home/ll/.ansible/tmp/ansible-tmp-1600930951.3805804-16482-30144226544439/AnsiballZ_azure_rm_deployment.py", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/ll/.ansible/tmp/ansible-tmp-1600930951.3805804-16482-30144226544439/AnsiballZ_azure_rm_deployment.py", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.cloud.azure.azure_rm_deployment', init_globals=None, run_name='main', alter_sys=True)\n File "/usr/lib/python3.8/runpy.py", line 206, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib/python3.8/runpy.py", line 96, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/usr/lib/python3.8/runpy.py", line 86, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/modules/cloud/azure/azure_rm_deployment.py", line 702, in \n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/modules/cloud/azure/azure_rm_deployment.py", line 698, in main\n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/modules/cloud/azure/azure_rm_deployment.py", line 469, in init\n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/module_utils/azure_rm_common.py", line 341, in init\n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/module_utils/azure_rm_common.py", line 1145, in init\n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/module_utils/azure_rm_common.py", line 1378, in _get_credentials\n File "/tmp/ansible_azure_rm_deployment_payload_jjehvh8g/ansible_azure_rm_deployment_payload.zip/ansible/module_utils/azure_rm_common.py", line 1289, in _get_azure_cli_credentials\n File "/home/ll/algo/.env/lib/python3.8/site-packages/azure/common/credentials.py", line 46, in get_azure_cli_credentials\n profile = get_cli_profile()\n File "/home/ll/algo/.env/lib/python3.8/site-packages/azure/common/credentials.py", line 29, in get_cli_profile\n return Profile(storage=ACCOUNT)\n File "/home/ll/algo/.env/lib/python3.8/site-packages/azure/cli/core/_profile.py", line 125, in init\n self.cli_ctx = cli_ctx or get_default_cli()\n File "/home/ll/algo/.env/lib/python3.8/site-packages/azure/cli/core/init.py", line 485, in get_default_cli\n return AzCli(cli_name='az',\n File "/home/ll/algo/.env/lib/python3.8/site-packages/azure/cli/core/init.py", line 52, in init\n SESSION.load(os.path.join(azure_folder, 'az.sess'), max_age=3600)\n File "/home/ll/algo/.env/lib/python3.8/site-packages/azure/cli/core/_session.py", line 37, in load\n if st.st_mtime + max_age < time.clock():\nAttributeError: module 'time' has no attribute 'clock'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
The deployment env is Win10 running Ubuntu WSL2.
It looks like the python 3.8 may be using a depricated library for key generation. This here may describe the issue:
https://stackoverflow.com/questions/58569361/attributeerror-module-time-has-no-attribute-clock-in-python-3-8
I tried to install PyCryptoDome and remove Cryptography, but Cryptography gets re-installed at runtime of ./algo.
Thanks guys!
The text was updated successfully, but these errors were encountered: