Open jmatraszek opened 1 year ago
same issue for me:
TASK [cloud-vultr : Creating a server] ************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: invalid literal for int() with base 10: '1.524'
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 \"/tmp/ansible_vultr_server_payload_3sw6n4wn/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py\", line 933, in <module>\n File \"/tmp/ansible_vultr_server_payload_3sw6n4wn/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py\", line 928, in main\n File \"/tmp/ansible_vultr_server_payload_3sw6n4wn/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/module_utils/vultr.py\", line 291, in get_result\n File \"/tmp/ansible_vultr_server_payload_3sw6n4wn/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/module_utils/vultr.py\", line 271, in normalize_result\nValueError: invalid literal for int() with base 10: '1.524'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
did a bit of debugging, the problem is in "allowed_bandwidth_gb" parameter:
'allowed_bandwidth_gb': '1.524'
it's trying to convert it to int and fails.
as a workaround i patched vultr module and was able to depoy:
https://github.com/ngine-io/ansible-collection-vultr/blob/master/plugins/module_utils/vultr.py#L271
if config['convert_to'] == 'int':
try:
resource[search_key] = int(resource[search_key])
except:
resource[search_key] = int(float(resource[search_key]))
Workaround worked for me also, I was able to deploy the server
once you have activated virtualenv, using ansible-galaxy i installed ngine_io _vultr to version 1.1.3 (seems the problem is with version 1.1.2), and it worked successfully.
As ngine_io.vultr
uses the deprecated API v1, which is going to be disabled on Jun 30, this workaround will stop working too tomorrow. algo needs to change to use vultr.cloud
.
So know that we're after June 30, 2023... @louy2 What are the steps to workaround that issue?
I am using the fix by #14587 I also met the problem fixed by #14622 and using that too
Describe the bug
Error during deploying Algo using Vultr cloud provider. The server is created in Vultr and it is running, the Algo script fails with an unexpected error:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Algo is deployed.
Additional context
Not sure if this may be related, but stumbled upon this, which looks like it may be related somehow.
Full log
Truncated log from
./algo -vvv
invocation (better formating of the error):