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

Error during "Get current value for innodb_default_row_format" #804

Closed
derekpurdy opened this issue Sep 14, 2022 · 6 comments · Fixed by #823
Closed

Error during "Get current value for innodb_default_row_format" #804

derekpurdy opened this issue Sep 14, 2022 · 6 comments · Fixed by #823

Comments

@derekpurdy
Copy link
Contributor

SUMMARY

mysql task in the zabbix server role fails to complete with error in conditional check.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

zabbix_server role
mysql task

ANSIBLE VERSION
ansible [core 2.13.4]
  config file = /home/derek/.ansible.cfg
  configured module search path = ['/home/derek/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/derek/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/derek/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/derek/.local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
CONFIGURATION
DEFAULT_HOST_LIST(/home/derek/.ansible.cfg) = ['/home/derek/.ansible/inventories/hosts.yml']
DEFAULT_ROLES_PATH(/home/derek/.ansible.cfg) = ['/home/derek/.ansible/roles']
HOST_KEY_CHECKING(/home/derek/.ansible.cfg) = False
OS / ENVIRONMENT / Zabbix Version

Ubuntu 20.04.5
mysql Ver 8.0.30-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
Zabbix 6.0.8
community.zabbix 1.8.0

STEPS TO REPRODUCE
Issue was observed while running the mysql.yml task in zabbix_server role.
EXPECTED RESULTS

previously completed successful as I was able to install the zabbix server

ACTUAL RESULTS
fatal: [zabbix-server.lan -> {{ delegated_dbhost }}]: FAILED! => {"msg": "The conditional check 'install_mysql_version.msg is version('5.6', '>=')' failed. The error was: Version comparison failed: '<' not supported between instances of 'str' and 'int'\n\nThe error appears to be in '/home/derek/.ansible/collections/ansible_collections/community/zabbix/roles/zabbix_server/tasks/mysql.yml': line 99, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"MySQL | Get current value for innodb_default_row_format\"\n  ^ here\n"}

offending task below.

- name: "MySQL | Get current value for innodb_default_row_format"
  community.mysql.mysql_variables:
    variable: innodb_default_row_format
    login_host: "{{ zabbix_server_mysql_login_host | default(omit) }}"
    login_user: "{{ zabbix_server_mysql_login_user | default(omit) }}"
    login_password: "{{ zabbix_server_mysql_login_password | default(omit) }}"
    login_port: "{{ zabbix_server_mysql_login_port | default(omit) }}"
    login_unix_socket: "{{ zabbix_server_mysql_login_unix_socket | default(omit) }}"
  delegate_to: "{{ delegated_dbhost }}"
  register: mysql_innodb_default_row_format
  when:
    - install_mysql_version.msg is version('5.6', '>=')
  tags:
    - zabbix-server
    - database
@derekpurdy
Copy link
Contributor Author

derekpurdy commented Oct 14, 2022

I was able to solve this issue, and I believe it should be fixed as it was an issue while running in 'check mode'

There should be an added when clause to check if ansible is in 'check mode' as the register does not store the version correctly.

"msg": "remote module (community.mysql.mysql_variables) does not support check mode",

code addition:

when:
    - not ansible_check_mode
    - install_mysql_version.msg is version('5.6', '>=')

@BGmot
Copy link
Collaborator

BGmot commented Oct 14, 2022

Hey @derekpurdy ! Yev is here -) can you submit a PR?

@derekpurdy
Copy link
Contributor Author

@BGmot I definitely can, I just wanted to make sure it was the best method for fixing the issue.

@BGmot
Copy link
Collaborator

BGmot commented Oct 14, 2022

well... here we can't fix community.mysql.mysql_variables module so if you have a fix that fixes our role then let's do it.

@derekpurdy
Copy link
Contributor Author

derekpurdy commented Oct 14, 2022

I have created PR #823

I'm not sure if the fix should be added to the other tasks with the comparison as well. We seem to not hit those in our installation, but I assume someone else may come across this issue.

D3DeFi pushed a commit that referenced this issue Oct 15, 2022
@D3DeFi
Copy link
Contributor

D3DeFi commented Oct 15, 2022

I have created PR #823

I'm not sure if the fix should be added to the other tasks with the comparison as well. We seem to not hit those in our installation, but I assume someone else may come across this issue.

Thanks for fixing this issue. Don't worry about other tasks, if someone finds this issue, they can ask for it to be re-open.

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

Successfully merging a pull request may close this issue.

3 participants