{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/27321","labels_url":"https://api.github.com/repos/saltstack/salt/issues/27321/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/27321/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/27321/events","html_url":"https://github.com/saltstack/salt/issues/27321","id":107872518,"number":27321,"title":"KeyError when trying to create new postgres user with salt state","user":{"login":"midihenry","id":7854083,"avatar_url":"https://avatars.githubusercontent.com/u/7854083?v=3","gravatar_id":"","url":"https://api.github.com/users/midihenry","html_url":"https://github.com/midihenry","followers_url":"https://api.github.com/users/midihenry/followers","following_url":"https://api.github.com/users/midihenry/following{/other_user}","gists_url":"https://api.github.com/users/midihenry/gists{/gist_id}","starred_url":"https://api.github.com/users/midihenry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/midihenry/subscriptions","organizations_url":"https://api.github.com/users/midihenry/orgs","repos_url":"https://api.github.com/users/midihenry/repos","events_url":"https://api.github.com/users/midihenry/events{/privacy}","received_events_url":"https://api.github.com/users/midihenry/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/saltstack/salt/labels/Info%20Needed","name":"Info Needed","color":"c7def8"},{"url":"https://api.github.com/repos/saltstack/salt/labels/Pending%20Discussion","name":"Pending Discussion","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/37","html_url":"https://github.com/saltstack/salt/milestones/Blocked","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/37/labels","id":343741,"number":37,"title":"Blocked","description":"Issues which are blocked in some way, whether they need further discussion, clarification, justification, or are blocked for some other reason.","creator":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"open_issues":281,"closed_issues":646,"state":"open","created_at":"2013-05-28T22:24:12Z","updated_at":"2015-09-28T20:57:58Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-09-23T08:33:40Z","updated_at":"2015-09-28T23:44:06Z","closed_at":null,"body":"When trying to create a new postgresql user using the following state\r\n```saltstack\r\n...\r\nadd_user:\r\n  postgres_user.present:\r\n    - name: {{ postgres.db_user }}\r\n    - password: {{ postgres.db_password }}\r\n    - user: postgres\r\n    - require:\r\n      - pkg: postgresql_install\r\n...\r\n```\r\nI get this error\r\n```python-traceback\r\nThe minion function caused an exception: Traceback (most recent call last):\r\n      File \"/usr/lib/python2.7/dist-packages/salt/minion.py\", line 1161, in _thread_return\r\n        return_data = func(*args, **kwargs)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/modules/state.py\", line 523, in highstate\r\n        whitelist=kwargs.get('whitelist')\r\n      File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 2968, in call_highstate\r\n        return self.state.call_high(high)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 2067, in call_high\r\n        ret = dict(list(disabled.items()) + list(self.call_chunks(chunks).items()))\r\n      File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 1623, in call_chunks\r\n        running = self.call_chunk(low, running, chunks)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 1769, in call_chunk\r\n        self._mod_init(low)\r\n      File \"/usr/lib/python2.7/dist-packages/salt/state.py\", line 612, in _mod_init\r\n        self.states['{0}.{1}'.format(low['state'], low['fun'])]  # pylint: disable=W0106\r\n      File \"/usr/lib/python2.7/dist-packages/salt/utils/lazy.py\", line 90, in __getitem__\r\n        raise KeyError(key)\r\n    KeyError: 'postgres_user.present'\r\n\r\n```\r\n\r\nI'm using salt-master version 2015.5.5 and 2015.5.3 for the salt-minion "},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/143903136","html_url":"https://github.com/saltstack/salt/issues/27321#issuecomment-143903136","issue_url":"https://api.github.com/repos/saltstack/salt/issues/27321","id":143903136,"user":{"login":"basepi","id":702318,"avatar_url":"https://avatars.githubusercontent.com/u/702318?v=3","gravatar_id":"","url":"https://api.github.com/users/basepi","html_url":"https://github.com/basepi","followers_url":"https://api.github.com/users/basepi/followers","following_url":"https://api.github.com/users/basepi/following{/other_user}","gists_url":"https://api.github.com/users/basepi/gists{/gist_id}","starred_url":"https://api.github.com/users/basepi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basepi/subscriptions","organizations_url":"https://api.github.com/users/basepi/orgs","repos_url":"https://api.github.com/users/basepi/repos","events_url":"https://api.github.com/users/basepi/events{/privacy}","received_events_url":"https://api.github.com/users/basepi/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T23:44:06Z","updated_at":"2015-09-28T23:44:06Z","body":"Alright, so there are two things going on. One is that the `postgres` module is not loading properly. The only requirement for loading this module is that the module can find `psql` on the command line. Is that not being installed, or being installed to a nonstandard location?\r\n\r\nIt is weird, however, that that KeyError is getting through in the state system. It should just report that `postgres_user.present` is unavailable, much like it does with the module. May be a separate bug there."}}