{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/20826","labels_url":"https://api.github.com/repos/saltstack/salt/issues/20826/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/20826/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/20826/events","html_url":"https://github.com/saltstack/salt/issues/20826","id":58226025,"number":20826,"title":"Elasticsearch Returner \"trying to serialize a value with no field associated with it\"","user":{"login":"clinta","id":3177437,"avatar_url":"https://avatars.githubusercontent.com/u/3177437?v=3","gravatar_id":"","url":"https://api.github.com/users/clinta","html_url":"https://github.com/clinta","followers_url":"https://api.github.com/users/clinta/followers","following_url":"https://api.github.com/users/clinta/following{/other_user}","gists_url":"https://api.github.com/users/clinta/gists{/gist_id}","starred_url":"https://api.github.com/users/clinta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clinta/subscriptions","organizations_url":"https://api.github.com/users/clinta/orgs","repos_url":"https://api.github.com/users/clinta/repos","events_url":"https://api.github.com/users/clinta/events{/privacy}","received_events_url":"https://api.github.com/users/clinta/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Medium%20Severity","name":"Medium Severity","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/13","html_url":"https://github.com/saltstack/salt/milestones/Approved","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/13/labels","id":9265,"number":13,"title":"Approved","description":"All issues that are ready to be worked on, both bugs and features.","creator":{"login":"thatch45","id":507599,"avatar_url":"https://avatars.githubusercontent.com/u/507599?v=3","gravatar_id":"","url":"https://api.github.com/users/thatch45","html_url":"https://github.com/thatch45","followers_url":"https://api.github.com/users/thatch45/followers","following_url":"https://api.github.com/users/thatch45/following{/other_user}","gists_url":"https://api.github.com/users/thatch45/gists{/gist_id}","starred_url":"https://api.github.com/users/thatch45/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thatch45/subscriptions","organizations_url":"https://api.github.com/users/thatch45/orgs","repos_url":"https://api.github.com/users/thatch45/repos","events_url":"https://api.github.com/users/thatch45/events{/privacy}","received_events_url":"https://api.github.com/users/thatch45/received_events","type":"User","site_admin":false},"open_issues":2000,"closed_issues":1607,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2015-03-03T23:14:39Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-02-19T15:52:30Z","updated_at":"2015-03-03T23:17:48Z","closed_at":null,"body":"When using the Elasticsearch returner as the ext_job_cache the minion logs the following error:\r\n\r\n```\r\n2015-02-19 10:43:03,680 [salt.utils.schedule][ERROR   ] Unhandled exception running state.highstate\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/dist-packages/salt/utils/schedule.py\", line 452, in handle_func\r\n    self.returners[ret_str](ret)\r\n  File \"/usr/lib/python2.7/dist-packages/salt/returners/elasticsearch_return.py\", line 124, in returner\r\n    body=_get_pickler().flatten(ret),\r\n  File \"/usr/lib/python2.7/dist-packages/elasticsearch/client/utils.py\", line 68, in _wrapped\r\n    return func(*args, params=params, **kwargs)\r\n  File \"/usr/lib/python2.7/dist-packages/elasticsearch/client/__init__.py\", line 213, in index\r\n    _make_path(index, doc_type, id), params=params, body=body)\r\n  File \"/usr/lib/python2.7/dist-packages/elasticsearch/transport.py\", line 284, in perform_request\r\n    status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout)\r\n  File \"/usr/lib/python2.7/dist-packages/elasticsearch/connection/http_urllib3.py\", line 55, in perform_request\r\n    self._raise_error(response.status, raw_data)\r\n  File \"/usr/lib/python2.7/dist-packages/elasticsearch/connection/base.py\", line 97, in _raise_error\r\n    raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)\r\nRequestError: TransportError(400, u'MapperParsingException[object mapping [return] trying to serialize a value with no field associated with it, current value [The function \"state.highstate\" is running as PID 32561 and was started at 2015, Feb 19 10:43:03.874881 with jid 20150219104303874881]]')\r\n```\r\n\r\nVersion report for the minion:\r\n\r\n```\r\n           Salt: 2014.7.1\r\n         Python: 2.7.6 (default, Mar 22 2014, 22:59:56)\r\n         Jinja2: 2.7.2\r\n       M2Crypto: 0.21.1\r\n msgpack-python: 0.3.0\r\n   msgpack-pure: Not Installed\r\n       pycrypto: 2.6.1\r\n        libnacl: Not Installed\r\n         PyYAML: 3.10\r\n          ioflo: Not Installed\r\n          PyZMQ: 14.0.1\r\n           RAET: Not Installed\r\n            ZMQ: 4.0.4\r\n           Mako: 0.9.1\r\n```\r\n\r\nAnd here's the versions of the elasticsearch packages I'm running:\r\n```\r\n$ pip freeze | egrep '(elasticsearch|jsonpickle)'\r\nelasticsearch==1.2.0\r\njsonpickle==0.6.1\r\n```"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/77061152","html_url":"https://github.com/saltstack/salt/issues/20826#issuecomment-77061152","issue_url":"https://api.github.com/repos/saltstack/salt/issues/20826","id":77061152,"user":{"login":"timoguin","id":671968,"avatar_url":"https://avatars.githubusercontent.com/u/671968?v=3","gravatar_id":"","url":"https://api.github.com/users/timoguin","html_url":"https://github.com/timoguin","followers_url":"https://api.github.com/users/timoguin/followers","following_url":"https://api.github.com/users/timoguin/following{/other_user}","gists_url":"https://api.github.com/users/timoguin/gists{/gist_id}","starred_url":"https://api.github.com/users/timoguin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timoguin/subscriptions","organizations_url":"https://api.github.com/users/timoguin/orgs","repos_url":"https://api.github.com/users/timoguin/repos","events_url":"https://api.github.com/users/timoguin/events{/privacy}","received_events_url":"https://api.github.com/users/timoguin/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T23:17:48Z","updated_at":"2015-03-03T23:17:48Z","body":"The error output @clinta posted looks like an async job returning before the job is actually finished. Not sure why it's trying to return to ES at that point.\r\n\r\nConfirmed with @jcockhren that all the returns were working with 2014.1.\r\n\r\nIt seems like the current issue (at least one of the issues) with 2014.7 is that the return formats are different between execution modules and state modules. For example, `test.ping` returns `true`, so ElasticSearch will map the `return` field to a boolean type, which causes it to choke when a state module returns a dictionary for the same field."}}