-
-
Notifications
You must be signed in to change notification settings - Fork 11
Create Server Fails - UnicodeEncodeError: 'ascii' codec can't encode character u'\\xe3' in position 1: ordinal not in range(128)\n #31
Comments
@stuevansuk I think, there is typo in your configs for creating a vultr server with an unexpected unicode char. According to my quick research, this should be an |
Had a good look and cant see anything, created a simple playbook and this is still failing with the same error;
Not sure if I'm missing somehing or you can validate? |
I see so, the thing is, this modules still uses the old API v1 and plan "vc2-2c-4gb" is a plan of the API v2. To get the v1 plans you have to use the vultr-cli https://github.com/vultr/vultr-cli/releases/tag/v1.0.0 the plan "vc2-c2-4gb" would be the ID 203 or "4096 MB RAM,80 GB SSD,3.00 TB BW" |
Oh nice that's great! I hadn't realised the v1 view was available in that formMany thanks for your help, I can transfer across now and continue to work.. Looking forward to your new module deployment and instance management within that. Many thanks again, great work! |
You're welcome, thanks for your patience, I'll let you know when the new instance module is ready. |
I think I spoke too soon! Still no luck with the following playbook;
Also comes with the same error; An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 1: ordinal not in range(128) Running Centos 7 with Python 3.9 and Python System on 2.6 |
I can not reproduce: - name: Provision & Bootstrap New node
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Provision Node.....
block:
- name: Provision - Create Vultr Instance
vultr_server:
name: "test"
os: "CentOS 7 x64"
plan: "4096 MB RAM,80 GB SSD,3.00 TB BW"
firewall_group: "default"
ssh_key: "resmo"
region: "Amsterdam"
register: vultr ran it:
verified it
what does |
Interesting? What OS are you using? Im wondering if its due to some OS makeup? ansible [core 2.11.11] |
Deployed a Centos 8 Stream Machine with Ansible and works fine, issue seems to be related to be with Centos 7, deployed a Centos 7 machine from scratch and failed with same result. Will research more. |
i wanted to let you know that vultr.cloud (https://github.com/vultr/ansible-collection-vultr) now includes an instance module. The arguments have changed a bit but not that much. Give it a shot https://docs.ansible.com/ansible/latest/collections/vultr/cloud/instance_module.html#ansible-collections-vultr-cloud-instance-module (btw, VPC support in the module is ready in 1.5.0) |
Not sure if this is due to the API change, but my Ansible Runs are failing with the following output, the only change in my playbook is around the plan definition, this has now changed on the Vultr API to "vc2-2c-4gb"
ESTABLISH LOCAL CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "
echo /root/.ansible/tmp
"&& mkdir "echo /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133
" && echo ansible-tmp-1654631972.6608722-30354-211416328878133="echo /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133
" ) && sleep 0'redirecting (type: modules) ansible.builtin.vultr_server to ngine_io.vultr.vultr_server
Using module file /root/.local/lib/python3.6/site-packages/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py
PUT /root/.ansible/tmp/ansible-local-30249c_wa2x6q/tmpy541dbze TO /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/ /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py && sleep 0'
EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 100, in
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 92, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 41, in invoke_module
run_name='main', alter_sys=True)
File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 933, in
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 926, in main
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 508, in present_server
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 529, in _create_server
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 444, in get_region
File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/module_utils/vultr.py", line 248, in query_resource_by_key
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 1: ordinal not in range(128)
fatal: [localhost -> localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 100, in \n _ansiballz_main()\n File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/root/.ansible/tmp/ansible-tmp-1654631972.6608722-30354-211416328878133/AnsiballZ_vultr_server.py", line 41, in invoke_module\n run_name='main', alter_sys=True)\n File "/usr/lib64/python2.7/runpy.py", line 176, in run_module\n fname, loader, pkg_name)\n File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code\n mod_name, mod_fname, mod_loader, pkg_name)\n File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code\n exec code in run_globals\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 933, in \n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 926, in main\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 508, in present_server\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 529, in _create_server\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/modules/vultr_server.py", line 444, in get_region\n File "/tmp/ansible_vultr_server_payload_hLoMA8/ansible_vultr_server_payload.zip/ansible_collections/ngine_io/vultr/plugins/module_utils/vultr.py", line 248, in query_resource_by_key\nUnicodeEncodeError: 'ascii' codec can't encode character u'\xe3' in position 1: ordinal not in range(128)\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
The text was updated successfully, but these errors were encountered: