{"action":"created","issue":{"url":"https://api.github.com/repos/RexOps/Rex/issues/400","labels_url":"https://api.github.com/repos/RexOps/Rex/issues/400/labels{/name}","comments_url":"https://api.github.com/repos/RexOps/Rex/issues/400/comments","events_url":"https://api.github.com/repos/RexOps/Rex/issues/400/events","html_url":"https://github.com/RexOps/Rex/issues/400","id":39727619,"number":400,"title":"exit_status is not very transparent","user":{"login":"aowi","id":64353,"avatar_url":"https://avatars.githubusercontent.com/u/64353?v=3","gravatar_id":"","url":"https://api.github.com/users/aowi","html_url":"https://github.com/aowi","followers_url":"https://api.github.com/users/aowi/followers","following_url":"https://api.github.com/users/aowi/following{/other_user}","gists_url":"https://api.github.com/users/aowi/gists{/gist_id}","starred_url":"https://api.github.com/users/aowi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aowi/subscriptions","organizations_url":"https://api.github.com/users/aowi/orgs","repos_url":"https://api.github.com/users/aowi/repos","events_url":"https://api.github.com/users/aowi/events{/privacy}","received_events_url":"https://api.github.com/users/aowi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/RexOps/Rex/milestones/13","html_url":"https://github.com/RexOps/Rex/milestones/backlog","labels_url":"https://api.github.com/repos/RexOps/Rex/milestones/13/labels","id":299513,"number":13,"title":"backlog","description":"These are task that should be done","creator":{"login":"krimdomu","id":388436,"avatar_url":"https://avatars.githubusercontent.com/u/388436?v=3","gravatar_id":"","url":"https://api.github.com/users/krimdomu","html_url":"https://github.com/krimdomu","followers_url":"https://api.github.com/users/krimdomu/followers","following_url":"https://api.github.com/users/krimdomu/following{/other_user}","gists_url":"https://api.github.com/users/krimdomu/gists{/gist_id}","starred_url":"https://api.github.com/users/krimdomu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krimdomu/subscriptions","organizations_url":"https://api.github.com/users/krimdomu/orgs","repos_url":"https://api.github.com/users/krimdomu/repos","events_url":"https://api.github.com/users/krimdomu/events{/privacy}","received_events_url":"https://api.github.com/users/krimdomu/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":2,"state":"open","created_at":"2013-03-30T07:59:54Z","updated_at":"2015-11-22T11:36:13Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2014-08-07T13:57:25Z","updated_at":"2015-12-06T12:52:57Z","closed_at":null,"body":"With exit_status enabled by default since 0.50, Rex has started to return 255 for us every now and then, with no sign of the actual error in the output from Rex.\r\n\r\nInternally, there is one or two -1's in @exit_codes. lib/Rex/CLI.pm:549:\r\n ```perl\r\n@exit_codes = Rex::TaskList->create()->get_exit_codes();\r\n```\r\n\r\nThe feature itself is both good and something we want to use, but just using the first non-zero exit code returned from any of the tasks tells us nothing about what went wrong or where it went wrong. This makes it very hard to figure out why something failed. \r\n\r\nThe fact that Rex got an exit code of -1 is also somewhat baffling.\r\n\r\nThere's also no nice way (as far as I can tell) to disable this feature. For now, we've just set `$Rex::WITH_EXIT_STATUS = 0` in the Rexfile as a workaround.\r\n\r\nThings that would be nice to have:\r\n\r\n- [ ] Configurable exit_status\r\n- [ ] Per-task output of exit status, to make post-mortem possible\r\n- [ ] No -1's without a good explanation in the output. Whatever caused these should probably also have made Rex yell at me.\r\n\r\nSince I don't know the exact source for the last issue, it might not actually be a problem.\r\n\r\nI'm more than happy to fix this myself, I'd just like to touch base before I do it."},"comment":{"url":"https://api.github.com/repos/RexOps/Rex/issues/comments/162313473","html_url":"https://github.com/RexOps/Rex/issues/400#issuecomment-162313473","issue_url":"https://api.github.com/repos/RexOps/Rex/issues/400","id":162313473,"user":{"login":"ferki","id":3117609,"avatar_url":"https://avatars.githubusercontent.com/u/3117609?v=3","gravatar_id":"","url":"https://api.github.com/users/ferki","html_url":"https://github.com/ferki","followers_url":"https://api.github.com/users/ferki/followers","following_url":"https://api.github.com/users/ferki/following{/other_user}","gists_url":"https://api.github.com/users/ferki/gists{/gist_id}","starred_url":"https://api.github.com/users/ferki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ferki/subscriptions","organizations_url":"https://api.github.com/users/ferki/orgs","repos_url":"https://api.github.com/users/ferki/repos","events_url":"https://api.github.com/users/ferki/events{/privacy}","received_events_url":"https://api.github.com/users/ferki/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T12:52:56Z","updated_at":"2015-12-06T12:52:56Z","body":"@kablamo: I propose opening a new issue for tracking the \"tests for exit code\", so here we can focus on resolving the last remaining elements from your list above.\r\n\r\n- I think `Configurable exit_status` can be crossed off for now (and maybe we can create another tracking issue about things that should be deprecated, and add it there)\r\n- `When Rex exits from no Rexfile the exit code is 0` can now be worked on since #778 has been merged\r\n- `When Rex exits from no task found the exit code is 0` is reported on #841 too, and #729 is at least partially related\r\n\r\n@aowi: would you still feel the need to add a feature flag to disable returning exit codes once we fixed the behaviour? I couldn't come up with a use case for that on my own, but you might have one :)"}}