{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/30066","labels_url":"https://api.github.com/repos/saltstack/salt/issues/30066/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/30066/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/30066/events","html_url":"https://github.com/saltstack/salt/issues/30066","id":124270768,"number":30066,"title":"salt Caller throws 'string indices must be integers, not str'","user":{"login":"sjmh","id":12321,"avatar_url":"https://avatars.githubusercontent.com/u/12321?v=3","gravatar_id":"","url":"https://api.github.com/users/sjmh","html_url":"https://github.com/sjmh","followers_url":"https://api.github.com/users/sjmh/followers","following_url":"https://api.github.com/users/sjmh/following{/other_user}","gists_url":"https://api.github.com/users/sjmh/gists{/gist_id}","starred_url":"https://api.github.com/users/sjmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjmh/subscriptions","organizations_url":"https://api.github.com/users/sjmh/orgs","repos_url":"https://api.github.com/users/sjmh/repos","events_url":"https://api.github.com/users/sjmh/events{/privacy}","received_events_url":"https://api.github.com/users/sjmh/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/Core","name":"Core","color":"fef2c0"},{"url":"https://api.github.com/repos/saltstack/salt/labels/High%20Severity","name":"High Severity","color":"ff9143"},{"url":"https://api.github.com/repos/saltstack/salt/labels/P2","name":"P2","color":"155fb5"}],"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":2824,"closed_issues":3142,"state":"open","created_at":"2011-05-14T04:00:56Z","updated_at":"2016-01-05T20:19:29Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-12-29T21:29:28Z","updated_at":"2016-01-05T21:33:06Z","closed_at":null,"body":"I have a trigger written in Cobbler that is trying to use the salt python API to throw an event back to the master.\r\n\r\nBoth the master and minion running on the Cobbler server are on 2015.8.3.\r\n\r\nThe trigger function is rather simple:\r\n```\r\nimport salt.client\r\nimport salt.config\r\n\r\ndef run(api, args, logger):\r\n    (objtype, name, ip) = args\r\n    if objtype != 'system':\r\n        # something bad happened here, so get out\r\n        return 0\r\n\r\n    system = api.find_system(name)\r\n    if not system:\r\n        # something worse - we couldn't find the system\r\n        # that just called us, so bail\r\n        return 0\r\n\r\n    opts = salt.config.minion_config('/etc/salt/minion')\r\n    caller = salt.client.Caller(mopts=opts)\r\n    rid = system.ks_meta['rid']\r\n    if logger:\r\n        logger.info('Updating quickbase for record {0}'.format(rid))\r\n    caller.cmd('event.send', 'hes/prov/v1/pxe_done/{0}'.format(rid))\r\n    return 0\r\n```\r\n\r\nHowever, it often ends up throwing this:\r\n\r\n```\r\nTue Dec 29 13:22:14 2015 - DEBUG | running python trigger cobbler.modules.install_pre_pxedone\r\nTue Dec 29 13:22:14 2015 - INFO | Exception occured: <type 'exceptions.TypeError'>\r\nTue Dec 29 13:22:14 2015 - INFO | Exception value: string indices must be integers, not str\r\nTue Dec 29 13:22:14 2015 - INFO | Exception Info:\r\n  File \"/usr/lib/python2.6/site-packages/cobbler/remote.py\", line 2080, in _dispatch\r\n    return method_handle(*params)\r\n   File \"/usr/lib/python2.6/site-packages/cobbler/remote.py\", line 1397, in run_install_triggers\r\n    utils.run_triggers(self.api, None, \"/var/lib/cobbler/triggers/install/%s/*\" % mode, additional=[objtype,name,ip],logger=self.logger)\r\n   File \"/usr/lib/python2.6/site-packages/cobbler/utils.py\", line 944, in run_triggers\r\n    rc = m.run(api, arglist, logger)\r\n   File \"/usr/lib/python2.6/site-packages/cobbler/modules/install_pre_pxedone.py\", line 33, in run\r\n    caller = salt.client.Caller(mopts=opts)\r\n   File \"/usr/lib/python2.6/site-packages/salt/client/__init__.py\", line 1571, in __init__\r\n    self.sminion = salt.minion.SMinion(self.opts)\r\n   File \"/usr/lib/python2.6/site-packages/salt/minion.py\", line 518, in __init__\r\n    self.gen_modules(initial_load=True)\r\n   File \"/usr/lib/python2.6/site-packages/salt/minion.py\", line 529, in gen_modules\r\n    pillarenv=self.opts.get('pillarenv'),\r\n   File \"/usr/lib/python2.6/site-packages/salt/pillar/__init__.py\", line 163, in compile_pillar\r\n    dictkey='pillar',\r\n   File \"/usr/lib/python2.6/site-packages/salt/utils/async.py\", line 73, in wrap\r\n    ret = self._block_future(ret)\r\n   File \"/usr/lib/python2.6/site-packages/salt/utils/async.py\", line 83, in _block_future\r\n    return future.result()\r\n   File \"/usr/lib64/python2.6/site-packages/tornado/concurrent.py\", line 214, in result\r\n    raise_exc_info(self._exc_info)\r\n   File \"/usr/lib64/python2.6/site-packages/tornado/gen.py\", line 879, in run\r\n    yielded = self.gen.send(value)\r\n   File \"/usr/lib/python2.6/site-packages/salt/transport/zeromq.py\", line 160, in crypted_transfer_decode_dictentry\r\n    aes = cipher.decrypt(ret['key'])\r\n```\r\n\r\nNow, it doesn't do this all the time, but it does it pretty often.  I can send the events manually with no issue via salt-call.  The cobbler daemon is running as root, although the apache daemon that runs the web portion of it isn't.  I've added a few debug statements though and the effective user is root in context of the function.\r\n\r\nWas going to start digging into the stacktrace, but figured I'd post this in the meantime if someone had seen this before and had a suggestion."},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/169140175","html_url":"https://github.com/saltstack/salt/issues/30066#issuecomment-169140175","issue_url":"https://api.github.com/repos/saltstack/salt/issues/30066","id":169140175,"user":{"login":"cachedout","id":111616,"avatar_url":"https://avatars.githubusercontent.com/u/111616?v=3","gravatar_id":"","url":"https://api.github.com/users/cachedout","html_url":"https://github.com/cachedout","followers_url":"https://api.github.com/users/cachedout/followers","following_url":"https://api.github.com/users/cachedout/following{/other_user}","gists_url":"https://api.github.com/users/cachedout/gists{/gist_id}","starred_url":"https://api.github.com/users/cachedout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cachedout/subscriptions","organizations_url":"https://api.github.com/users/cachedout/orgs","repos_url":"https://api.github.com/users/cachedout/repos","events_url":"https://api.github.com/users/cachedout/events{/privacy}","received_events_url":"https://api.github.com/users/cachedout/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T21:33:06Z","updated_at":"2016-01-05T21:33:06Z","body":"Are you running this with a local minion process running alongside or are you setting the `local` flag in the Salt options that you're passing in? I'm a little curious if you see anything in the local minion logs (if relevant) or on the associated master."}}