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

[BUG] 3002.5 influxdb_continuous_query.present state not passing **client_args to influxdb.create_continuous_query module #59766

Closed
m0duspwnens opened this issue Mar 10, 2021 · 2 comments
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@m0duspwnens
Copy link

Description
The influxdb_continuous_query.present state is not passing **client_args to the influxdb.create_continuous_query module. This creates an issue when trying to create a continuous query on an SSL enabled InfluxDB.

Setup
(Please provide relevant configs and/or SLS files (be sure to remove sensitive info).

downsample_cpu_cq:
  influxdb_continuous_query.present:
    - name: downsample_cpu_cq
    - database: telegraf
    - ssl: True
    - query: SELECT mean(*) INTO "long_term"."cpu" FROM "cpu" GROUP BY time(30m)

Steps to Reproduce the behavior
Create the state above, and apply it. The following output will be received:

          ID: downsample_cpu_cq
    Function: influxdb_continuous_query.present
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3.6/site-packages/salt/state.py", line 2154, in call
                  *cdata["args"], **cdata["kwargs"]
                File "/usr/lib/python3.6/site-packages/salt/loader.py", line 2106, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3.6/site-packages/salt/states/influxdb_continuous_query.py", line 60, in present
                  database, name, query, resample_time, coverage_period
                File "/usr/lib/python3.6/site-packages/salt/modules/influxdbmod.py", line 659, in create_continuous_query
                  client.query(query)
                File "/root/.local/lib/python3.6/site-packages/influxdb/client.py", line 527, in query
                  expected_response_code=expected_response_code
                File "/root/.local/lib/python3.6/site-packages/influxdb/client.py", line 378, in request
                  raise InfluxDBClientError(err_msg, response.status_code)
              influxdb.exceptions.InfluxDBClientError: 400: Client sent an HTTP request to an HTTPS server.
     Started: 16:59:27.937636
    Duration: 50.238 ms
     Changes:

Expected behavior
It is expected that the continuous query would be created.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
          Salt: 3002.5

Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.8.1
     docker-py: 2.6.1
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.11.1
       libgit2: Not Installed
      M2Crypto: 0.35.2
          Mako: Not Installed
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: 1.3.12
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: Not Installed
        pygit2: Not Installed
        Python: 3.6.8 (default, Nov 16 2020, 16:55:22)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.0.0
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.1.4

System Versions:
          dist: centos 7 Core
        locale: UTF-8
       machine: x86_64
       release: 3.10.0-1160.15.2.el7.x86_64
        system: Linux
       version: CentOS Linux 7 Core

Additional context
The issue appears to be on line 60 in influxdb_continuous_query.py database, name, query, resample_time, coverage_period should be database, name, query, resample_time, coverage_period, **client_args. When testing the change locally, the expected output is produced:

          ID: downsample_cpu_cq
    Function: influxdb_continuous_query.present
      Result: True
     Comment: continuous query downsample_cpu_cq has been created
     Started: 17:03:14.444281
    Duration: 86.889 ms
     Changes:
              ----------
              downsample_cpu_cq:
                  Present
@m0duspwnens m0duspwnens added Bug broken, incorrect, or confusing behavior needs-triage labels Mar 10, 2021
@sagetherage sagetherage changed the title [BUG] influxdb_continuous_query.present state not passing **client_args to influxdb.create_continuous_query module [BUG] 3002.5 influxdb_continuous_query.present state not passing **client_args to influxdb.create_continuous_query module Mar 15, 2021
@sagetherage sagetherage added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around and removed needs-triage labels Apr 30, 2021
@sagetherage sagetherage added this to the Approved milestone Apr 30, 2021
@sagetherage
Copy link
Contributor

@m0duspwnens we will review a PR if you are willing to submit one

@Ch3LL
Copy link
Contributor

Ch3LL commented Sep 12, 2023

closed by #63007

@Ch3LL Ch3LL closed this as completed Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

5 participants