{"action":"created","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/29643","labels_url":"https://api.github.com/repos/saltstack/salt/issues/29643/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/29643/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/29643/events","html_url":"https://github.com/saltstack/salt/issues/29643","id":121809002,"number":29643,"title":"Can't get batch mode and --failhard to work as expected","user":{"login":"matthayes","id":212331,"avatar_url":"https://avatars.githubusercontent.com/u/212331?v=3","gravatar_id":"","url":"https://api.github.com/users/matthayes","html_url":"https://github.com/matthayes","followers_url":"https://api.github.com/users/matthayes/followers","following_url":"https://api.github.com/users/matthayes/following{/other_user}","gists_url":"https://api.github.com/users/matthayes/gists{/gist_id}","starred_url":"https://api.github.com/users/matthayes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthayes/subscriptions","organizations_url":"https://api.github.com/users/matthayes/orgs","repos_url":"https://api.github.com/users/matthayes/repos","events_url":"https://api.github.com/users/matthayes/events{/privacy}","received_events_url":"https://api.github.com/users/matthayes/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/P3","name":"P3","color":"0a3d77"},{"url":"https://api.github.com/repos/saltstack/salt/labels/State%20Compiler","name":"State Compiler","color":"006b75"}],"state":"open","locked":false,"assignee":{"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},"milestone":{"url":"https://api.github.com/repos/saltstack/salt/milestones/71","html_url":"https://github.com/saltstack/salt/milestones/B%206","labels_url":"https://api.github.com/repos/saltstack/salt/milestones/71/labels","id":1425950,"number":71,"title":"B 6","description":"","creator":{"login":"meggiebot","id":12242451,"avatar_url":"https://avatars.githubusercontent.com/u/12242451?v=3","gravatar_id":"","url":"https://api.github.com/users/meggiebot","html_url":"https://github.com/meggiebot","followers_url":"https://api.github.com/users/meggiebot/followers","following_url":"https://api.github.com/users/meggiebot/following{/other_user}","gists_url":"https://api.github.com/users/meggiebot/gists{/gist_id}","starred_url":"https://api.github.com/users/meggiebot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meggiebot/subscriptions","organizations_url":"https://api.github.com/users/meggiebot/orgs","repos_url":"https://api.github.com/users/meggiebot/repos","events_url":"https://api.github.com/users/meggiebot/events{/privacy}","received_events_url":"https://api.github.com/users/meggiebot/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":3,"state":"open","created_at":"2015-11-23T20:01:29Z","updated_at":"2015-12-17T16:55:08Z","due_on":"2016-01-04T07:00:00Z","closed_at":null},"comments":52,"created_at":"2015-12-11T23:02:31Z","updated_at":"2015-12-18T17:32:30Z","closed_at":null,"body":"I'm using a command like this below to execute `state.highstate` on one machine at a time, with the intention that it stop on the first failure.  But, it's not stopping even though there is a failure.\r\n\r\n```\r\nsudo salt -b 1 --failhard -G 'roles:foo' state.highstate\r\n```\r\n\r\nThe cause of the failure is a `http_test.ping` custom module function I wrote that checks that an HTTP call is succeeding.  I gave it a bogus path to force it to fail.  I'm testing this against two minions.  Looking at the minion logs I can see the calls are failing.  But, the output I get from the salt command above is essentially:\r\n\r\n```\r\nExecuting run on ['some-machine-A']\r\n\r\nretcode:\r\n    0\r\n\r\nExecuting run on ['some-machine-B']\r\n\r\nsome-machine-B:    <-- highlighted red\r\n\r\n(... lots of SLS state output ...)\r\n\r\n----------\r\nID: Ping the web app    <-- all highlighted red\r\n    Function: http_test.ping\r\n      Result: False\r\n     Comment: Call to http://localhost:80/pingping failed. Error: HTTP 404: NOT FOUND. HTTP status: 404\r\n     Started: 22:52:49.686395\r\n    Duration: 57.519 ms\r\n     Changes: \r\n\r\n(... more SLS state output ...)\r\n```\r\n\r\nSo, you can see that the `Ping the web app` call is failing and has `Result: False`.  This happens for both machines.  But, the `retcode` for both machines is apparently 0.  I ran the same command again with `--out=yaml` appended, which showed me that `retcode` is 0 for both machines.\r\n\r\nMaybe this isn't a problem with the batch mode but instead a problem with how `retcode` is determined.  Am I missing something?  Shouldn't the `retcode` be non-zero since the state has `Result: False`?"},"comment":{"url":"https://api.github.com/repos/saltstack/salt/issues/comments/165848124","html_url":"https://github.com/saltstack/salt/issues/29643#issuecomment-165848124","issue_url":"https://api.github.com/repos/saltstack/salt/issues/29643","id":165848124,"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-12-18T17:32:30Z","updated_at":"2015-12-18T17:32:30Z","body":"I think I'm going to actually try to tackle this on the loader/minion end of things. I'm going to see if I can stop the `__context__` from being switched with a new object, by holding onto the object before the module reload and shoving it back in afterwards. I may not get the fix done until January, though, since I'm going on holiday after today until the new year."}}