saltstack / saltstack/salt

Elasticsearch `get_load` throws warning trying to return JSON

Open
#53,472 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

This issue has shown up in a previous issue in the repo, but it appears that sometime along the line the elasticsearch Python API changed to return dictionaries instead of the current behavior which is to return a dictionary of the job cache.

Originally posted by @msteed in https://github.com/saltstack/salt/issues/23125#issuecomment-140512958

$ salt --versions-report
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.3
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.12 (default, Nov 12 2018, 14:36:49)
   python-gnupg: 0.3.8
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
         locale: UTF-8
        machine: x86_64
        release: 4.4.0-148-generic
         system: Linux
        version: Ubuntu 16.04 xenial
$ pip freeze | grep elastic
elasticsearch==6.4.0
$ salt salt elasticsearch.info
salt:
    ----------
    cluster_name:
        elasticsearch_calvin
    cluster_uuid:
        GjYi_ICTQJGolj3Lo42DQg
    name:
        Yv7_FY8
    tagline:
        You Know, for Search
    version:
        ----------
        build_date:
            2019-05-15T20:06:13.172855Z
        build_flavor:
            oss
        build_hash:
            65b6179
        build_snapshot:
            False
        build_type:
            tar
        lucene_version:
            7.7.0
        minimum_index_compatibility_version:
            5.0.0
        minimum_wire_compatibility_version:
            5.6.0
        number:
            6.8.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Salt Elasticsearch integration entry point for get_load and reproduce the warning with elasticsearch 6.4.0, comparing its response shape with the current handling. Confirm the expected dictionary result and verify that the command returns JSON without the warning across the relevant Elasticsearch API behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, python
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.