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

proxysql_global_variables issues #6

Open
moos3 opened this issue Dec 5, 2019 · 3 comments
Open

proxysql_global_variables issues #6

moos3 opened this issue Dec 5, 2019 · 3 comments

Comments

@moos3
Copy link

moos3 commented Dec 5, 2019

It seems to be an issue with variables in the templates. Not 100% why it would be failing. Using the example values.

ansible 2.9.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.3 (default, Apr  3 2019, 05:39:12) [GCC 8.3.0]
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793 `" && echo ansible-tmp-1575573481.9743962-172483146853793="` echo /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793 `" ) && sleep 0'
Using module file /usr/local/lib/python3.7/dist-packages/ansible/modules/database/proxysql/proxysql_global_variables.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-1167956qcxqd5/tmp01oqtk3r TO /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/ /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py", line 102, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.database.proxysql.proxysql_global_variables', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python2.7/runpy.py", line 188, in run_module
    fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_proxysql_global_variables_payload_YwSAYX/ansible_proxysql_global_variables_payload.zip/ansible/modules/database/proxysql/proxysql_global_variables.py", line 266, in <module>
  File "/tmp/ansible_proxysql_global_variables_payload_YwSAYX/ansible_proxysql_global_variables_payload.zip/ansible/modules/database/proxysql/proxysql_global_variables.py", line 231, in main
  File "/tmp/ansible_proxysql_global_variables_payload_YwSAYX/ansible_proxysql_global_variables_payload.zip/ansible/modules/database/proxysql/proxysql_global_variables.py", line 122, in check_config
TypeError: tuple indices must be integers, not str

failed: [127.0.0.1] (item={'key': 'mysql-sessions_sort', 'value': 'True'}) => {
    "ansible_loop_var": "item",
    "changed": false,
    "item": {
        "key": "mysql-sessions_sort",
        "value": "True"
    },
    "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1575573481.9743962-172483146853793/AnsiballZ_proxysql_global_variables.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.database.proxysql.proxysql_global_variables', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python2.7/runpy.py\", line 188, in run_module\n    fname, loader, pkg_name)\n  File \"/usr/lib/python2.7/runpy.py\", line 82, in _run_module_code\n    mod_name, mod_fname, mod_loader, pkg_name)\n  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/tmp/ansible_proxysql_global_variables_payload_YwSAYX/ansible_proxysql_global_variables_payload.zip/ansible/modules/database/proxysql/proxysql_global_variables.py\", line 266, in <module>\n  File \"/tmp/ansible_proxysql_global_variables_payload_YwSAYX/ansible_proxysql_global_variables_payload.zip/ansible/modules/database/proxysql/proxysql_global_variables.py\", line 231, in main\n  File \"/tmp/ansible_proxysql_global_variables_payload_YwSAYX/ansible_proxysql_global_variables_payload.zip/ansible/modules/database/proxysql/proxysql_global_variables.py\", line 122, in check_config\nTypeError: tuple indices must be integers, not str\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
@timorunge
Copy link
Owner

Hey @moos3,

  • How is your configuration looking? Especially the KV for mysql-sessions_sort.
  • Also if python3 should be supported by Ansible have you tried to use python2 (on your local machine, remote seems to be 2.7) instead?

Generally speaking it seems to be a problem not of the module itself but from the Ansible core.

@stclark-incomm
Copy link

This is probably related to the issue in the upstream ansible/ansible#65525
It's working with ansible 2.8.8, 2.9 appears to have broken the proxysql modules.

@Andersson007
Copy link

ansible/ansible#66850

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

4 participants