{"action":"created","issue":{"url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory/issues/8","repository_url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory","labels_url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory/issues/8/comments","events_url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory/issues/8/events","html_url":"https://github.com/neilmunday/Salt-Minion-Inventory/issues/8","id":393524479,"node_id":"MDU6SXNzdWUzOTM1MjQ0Nzk=","number":8,"title":"Exception occurred in runner inventory.audit: Traceback...","user":{"login":"d-a-v","id":4800356,"node_id":"MDQ6VXNlcjQ4MDAzNTY=","avatar_url":"https://avatars3.githubusercontent.com/u/4800356?v=4","gravatar_id":"","url":"https://api.github.com/users/d-a-v","html_url":"https://github.com/d-a-v","followers_url":"https://api.github.com/users/d-a-v/followers","following_url":"https://api.github.com/users/d-a-v/following{/other_user}","gists_url":"https://api.github.com/users/d-a-v/gists{/gist_id}","starred_url":"https://api.github.com/users/d-a-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-a-v/subscriptions","organizations_url":"https://api.github.com/users/d-a-v/orgs","repos_url":"https://api.github.com/users/d-a-v/repos","events_url":"https://api.github.com/users/d-a-v/events{/privacy}","received_events_url":"https://api.github.com/users/d-a-v/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-21T16:52:42Z","updated_at":"2018-12-21T17:16:33Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nWe are trying your inventory runner, thanks for that,\r\nwe are facing issues.\r\n\r\ndatabase is setup and working,\r\nmodule is functionnal,\r\n```\r\n$ salt -l debug minion1 inventory.audit force=True\r\n[...]\r\n[DEBUG   ] LazyLoaded nested.output\r\nminion1:\r\n    Success\r\n[DEBUG   ] jid 20181221174623203872 found all minions set([u'minion1'])\r\n```\r\n\r\nWe added a log line in `__doQuery`:\r\n```\r\ndef __doQuery(cursor, query):\r\n        \"\"\"\r\n        Helper function to execute a query on the given cursor object.\r\n        \"\"\"\r\n        try:\r\n                log.debug(\"query: %s\" % query);       # <-------- here\r\n                cursor.execute(query)\r\n        except Exception as e:\r\n                raise Exception(\"inventory.__query: %s\\nquery was: %s\" % (e, query))\r\n```\r\n\r\nAll what we can see in logs are `SELECT`s (no `INSERT`, `UPDATE`...)\r\n\r\n\r\nand salt logs show lines like that \r\n```\r\n2018-12-21 17:33:53,422 [salt.utils.event :739 ][DEBUG   ][29868] Sending event: tag = salt/run/20181221173353399703/ret; data = {u'fun_args': [u'2018-12-21T16:33:53.272762', OrderedDict([(u'server_id', 1564434732)]), False], u'jid': u'20181221173353399703', u'return': u'Exception occurred in runner inventory.audit: Traceback (most recent call last):\\n  File \"/usr/lib/python2.7/site-packages/salt/client/mixins.py\", line 387, in _low\\n    data[\\'return\\'] = self.functions[fun](*args, **kwargs)\\n  File \"/srv/salt/_runners/inventory.py\", line 208, in audit\\n    properties[\"id\"],\\nKeyError: \\'id\\'\\n', u'success': False, u'_stamp': '2018-12-21T16:33:53.421964', u'user': u'Reactor', u'fun': u'runner.inventory.audit'}\r\n```\r\n\r\n```\r\nException occurred in runner inventory.audit: Traceback (most recent call last):\r\n  File \"/usr/lib/python2.7/site-packages/salt/client/mixins.py\", line 387, in _low\r\n    data[\\'return\\'] = self.functions[fun](*args, **kwargs)\r\n  File \"/srv/salt/_runners/inventory.py\", line 208, in audit\r\n```\r\n\r\nLine 208 is an access to `properties[]`, all accesses to `properties[]` give this error,\r\nThe error originally occurs in [this line](https://github.com/neilmunday/Salt-Minion-Inventory/blob/e094d2c05a3f5d75dd0579f5248bcaa3261bef26/runners/inventory.py#L159) (we added our logs and debugs).\r\n\r\n\r\nWe are not at this point bearded enough to debug the `properties` argument in the `audit` python function.\r\nCan you please provide us some help ?\r\n\r\nAlso, thanks for setting this repository up !"},"comment":{"url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory/issues/comments/449445969","html_url":"https://github.com/neilmunday/Salt-Minion-Inventory/issues/8#issuecomment-449445969","issue_url":"https://api.github.com/repos/neilmunday/Salt-Minion-Inventory/issues/8","id":449445969,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTQ0NTk2OQ==","user":{"login":"neilmunday","id":8867300,"node_id":"MDQ6VXNlcjg4NjczMDA=","avatar_url":"https://avatars0.githubusercontent.com/u/8867300?v=4","gravatar_id":"","url":"https://api.github.com/users/neilmunday","html_url":"https://github.com/neilmunday","followers_url":"https://api.github.com/users/neilmunday/followers","following_url":"https://api.github.com/users/neilmunday/following{/other_user}","gists_url":"https://api.github.com/users/neilmunday/gists{/gist_id}","starred_url":"https://api.github.com/users/neilmunday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilmunday/subscriptions","organizations_url":"https://api.github.com/users/neilmunday/orgs","repos_url":"https://api.github.com/users/neilmunday/repos","events_url":"https://api.github.com/users/neilmunday/events{/privacy}","received_events_url":"https://api.github.com/users/neilmunday/received_events","type":"User","site_admin":false},"created_at":"2018-12-21T17:16:33Z","updated_at":"2018-12-21T17:16:33Z","author_association":"OWNER","body":"Hi,\r\n\r\nThanks for adding the detailed issue report.\r\n\r\nCan you confirm which version of Salt you are running on the Salt master and client(s)?\r\n\r\nJust to make sure the state of the database is ok, can you delete all records (if there are any) from the _minion_ table and then try running a force audit on a minion?\r\n\r\nIf this does not work, then it would also be useful if you could share the output of your event queue on the Salt master when a minion runs an audit. This can be done by running on the master:\r\n\r\n`salt-run state.event pretty=True`\r\n\r\nThis should show the arguments and their values being passed from the minion to the reactor and finally to the runner.\r\n\r\nCheers,\r\n\r\nNeil."}}
{"actor":{"display_login":"neilmunday"}}