Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

None type exception when setting UDP Port via Ansible #817

Closed
jhg03a opened this issue Apr 11, 2020 · 5 comments
Closed

None type exception when setting UDP Port via Ansible #817

jhg03a opened this issue Apr 11, 2020 · 5 comments
Labels

Comments

@jhg03a
Copy link

jhg03a commented Apr 11, 2020

  • InfluxDB version: 1.3.2
  • InfluxDB-python version: 5.3.0
  • Python version: 2.7.5
  • Operating system version: Centos 7.6

The 5.3.0 release appears to no longer be compatible with Ansible when leveraging default ports for influxdb. The same playbooks have been running fine on the 5.2.3 release.

Traceback (most recent call last):
  File "<stdin>", line 102, in <module>
  File "<stdin>", line 94, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  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_influxdb_database_payload_lJyiY4/ansible_influxdb_database_payload.zip/ansible/modules/database/influxdb/influxdb_database.py", line 143, in <module>
  File "/tmp/ansible_influxdb_database_payload_lJyiY4/ansible_influxdb_database_payload.zip/ansible/modules/database/influxdb/influxdb_database.py", line 125, in main
  File "/tmp/ansible_influxdb_database_payload_lJyiY4/ansible_influxdb_database_payload.zip/ansible/module_utils/influxdb.py", line 85, in connect_to_influxdb
  File "/usr/lib/python2.7/site-packages/influxdb/client.py", line 118, in __init__
    self.__udp_port = int(udp_port)
TypeError: int() argument must be a string or a number, not 'NoneType'
@jhg03a
Copy link
Author

jhg03a commented Apr 11, 2020

It appears to be a result of #815

@sebito91
Copy link
Contributor

The default value for udp_port is set to 4444, an int. This should not break anything if you're not choosing to set it.

@jhg03a
Copy link
Author

jhg03a commented Apr 13, 2020

I believe it's being explicitly set to None, but I'm not 100% sure

@jhg03a
Copy link
Author

jhg03a commented Apr 13, 2020

Rolling back to 5.2.3 did fix the issue too btw.

@sebito91
Copy link
Contributor

The flip back to v5.2.3 will "work" because there isn't any type-set of this. The parameter expects an int value but will not be used unless the use_udp boolean parameter is set. Can you please update your ansible script to avoid setting udp_port to None?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants