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

2019.2 influxdb_retention_policy.present broken when used extra arguments #52041

Open
arsiesys opened this issue Mar 7, 2019 · 1 comment

Comments

@arsiesys
Copy link

commented Mar 7, 2019

Description of Issue/Question

The state influxdb_retention_policy.present is broken in 2019.2 as the extra data in client_args are not transmitted to the influxdb client in a new recently merged call:

In the following trace, we clearly understand that the ssl: True flag was not transmit to the client then a http connexion was initialized to a https endpoint.

    Function: influxdb_retention_policy.present
        Name: rp_telegraf_1year
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
                  chunked=chunked)
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 387, in _make_request
                  six.raise_from(e, None)
                File "<string>", line 3, in raise_from
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 383, in _make_request
                  httplib_response = conn.getresponse()
                File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
                  response.begin()
                File "/usr/lib/python3.6/http/client.py", line 297, in begin
                  version, status, reason = self._read_status()
                File "/usr/lib/python3.6/http/client.py", line 279, in _read_status
                  raise BadStatusLine(line)
              http.client.BadStatusLine: �����
              
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/usr/lib/python3/dist-packages/requests/adapters.py", line 440, in send
                  timeout=timeout
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 639, in urlopen
                  _stacktrace=sys.exc_info()[2])
                File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 357, in increment
                  raise six.reraise(type(error), error, _stacktrace)
                File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
                  raise value.with_traceback(tb)
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 601, in urlopen
                  chunked=chunked)
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 387, in _make_request
                  six.raise_from(e, None)
                File "<string>", line 3, in raise_from
                File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 383, in _make_request
                  httplib_response = conn.getresponse()
                File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
                  response.begin()
                File "/usr/lib/python3.6/http/client.py", line 297, in begin
                  version, status, reason = self._read_status()
                File "/usr/lib/python3.6/http/client.py", line 279, in _read_status
                  raise BadStatusLine(line)
              urllib3.exceptions.ProtocolError: ('Connection aborted.', BadStatusLine('\x15\x03\x01\x00\x02\x02\n',))
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/usr/lib/python3/dist-packages/salt/state.py", line 1933, in call
                  **cdata['kwargs'])
                File "/usr/lib/python3/dist-packages/salt/loader.py", line 1939, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/states/influxdb_retention_policy.py", line 92, in present
                  current_policy = __salt__['influxdb.get_retention_policy'](database=database, name=name)
                File "/usr/lib/python3/dist-packages/salt/modules/influx.py", line 354, in get_retention_policy
                  return next((p for p in client.get_list_retention_policies(database)
                File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 749, in get_list_retention_policies
                  quote_ident(database or self._database))
                File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 416, in query
                  expected_response_code=expected_response_code
                File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 267, in request
                  timeout=self._timeout
                File "/usr/lib/python3/dist-packages/requests/sessions.py", line 520, in request
                  resp = self.send(prep, **send_kwargs)
                File "/usr/lib/python3/dist-packages/requests/sessions.py", line 630, in send
                  r = adapter.send(request, **kwargs)
                File "/usr/lib/python3/dist-packages/requests/adapters.py", line 490, in send
                  raise ConnectionError(err, request=request)
              pip._vendor.requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('\x15\x03\x01\x00\x02\x02\n',))
     Started: 20:36:05.863657
    Duration: 44.999 ms
     Changes:   

It seems that the arguments (including ssl, and the database credentials) are not transmitted to the influxdb client.

Versions Reportversions.)

Salt Version:
           Salt: 2019.2.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: unknown
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.8
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: 0.26.0
        libnacl: Not Installed
       M2Crypto: 0.32.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.2
         Python: 3.6.7 (default, Oct 22 2018, 11:32:17)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.3
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5
 
System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-1032-aws
         system: Linux
        version: Ubuntu 18.04 bionic

@arsiesys arsiesys changed the title 2019.2 influxdb_retention_policy.present broken when used with ssl 2019.2 influxdb_retention_policy.present broken when used extra arguments Mar 7, 2019
@dwoz

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2019

@arsiesys Thanks for reporting this issue and the PR!

@dwoz dwoz added this to the Approved milestone Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.