{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/packer/issues/4719","repository_url":"https://api.github.com/repos/hashicorp/packer","labels_url":"https://api.github.com/repos/hashicorp/packer/issues/4719/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/packer/issues/4719/comments","events_url":"https://api.github.com/repos/hashicorp/packer/issues/4719/events","html_url":"https://github.com/hashicorp/packer/issues/4719","id":217405688,"number":4719,"title":"Shell provisioner truncates output when using `set -e` and `bash`","user":{"login":"benmullin333","id":575601,"avatar_url":"https://avatars3.githubusercontent.com/u/575601?v=3","gravatar_id":"","url":"https://api.github.com/users/benmullin333","html_url":"https://github.com/benmullin333","followers_url":"https://api.github.com/users/benmullin333/followers","following_url":"https://api.github.com/users/benmullin333/following{/other_user}","gists_url":"https://api.github.com/users/benmullin333/gists{/gist_id}","starred_url":"https://api.github.com/users/benmullin333/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benmullin333/subscriptions","organizations_url":"https://api.github.com/users/benmullin333/orgs","repos_url":"https://api.github.com/users/benmullin333/repos","events_url":"https://api.github.com/users/benmullin333/events{/privacy}","received_events_url":"https://api.github.com/users/benmullin333/received_events","type":"User","site_admin":false},"labels":[{"id":33051538,"url":"https://api.github.com/repos/hashicorp/packer/labels/bug","name":"bug","color":"f7c6c7","default":true},{"id":337722134,"url":"https://api.github.com/repos/hashicorp/packer/labels/communicator/ssh","name":"communicator/ssh","color":"006b75","default":false},{"id":137901112,"url":"https://api.github.com/repos/hashicorp/packer/labels/provisioner/shell","name":"provisioner/shell","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/hashicorp/packer/milestones/23","html_url":"https://github.com/hashicorp/packer/milestone/23","labels_url":"https://api.github.com/repos/hashicorp/packer/milestones/23/labels","id":2462111,"number":23,"title":"v1.0.3","description":"","creator":{"login":"mwhooker","id":15618,"avatar_url":"https://avatars0.githubusercontent.com/u/15618?v=3","gravatar_id":"","url":"https://api.github.com/users/mwhooker","html_url":"https://github.com/mwhooker","followers_url":"https://api.github.com/users/mwhooker/followers","following_url":"https://api.github.com/users/mwhooker/following{/other_user}","gists_url":"https://api.github.com/users/mwhooker/gists{/gist_id}","starred_url":"https://api.github.com/users/mwhooker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwhooker/subscriptions","organizations_url":"https://api.github.com/users/mwhooker/orgs","repos_url":"https://api.github.com/users/mwhooker/repos","events_url":"https://api.github.com/users/mwhooker/events{/privacy}","received_events_url":"https://api.github.com/users/mwhooker/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":18,"state":"open","created_at":"2017-04-17T23:06:20Z","updated_at":"2017-07-06T09:59:03Z","due_on":"2017-07-10T07:00:00Z","closed_at":null},"comments":10,"created_at":"2017-03-27T23:34:25Z","updated_at":"2017-07-06T18:26:24Z","closed_at":null,"body":"Hi!  I ran into an interesting scenario where useful error output from a shell provisioner was truncated:\r\n\r\nHere is a provisioner snippet, note the `set -e`:\r\n\r\n```\r\n    {\r\n      \"type\": \"shell\",\r\n      \"inline\": [\r\n\t...<truncated>...\r\n        \"sudo -u service_user bash <<'DEPLOY_BASH'\",\r\n        \"set -e\",\r\n\t...<truncated>...\r\n        \"ln -nfs ${RELEASE_DIR} ${CURRENT_DIR}\",\r\n        \"cd ${CURRENT_DIR}\",\r\n        \"npm install\",\r\n\t...<truncated>...\r\n        \"curl https://s3-us-west-2.amazonaws.com/static_assets/dist/dist.${SHA}.tar | tar -xv\",\r\n\t...<truncated>...\r\n        \"DEPLOY_BASH\"\r\n      ]\r\n    }\r\n```\r\n\r\nThis would yield a failure that was opaque.  The output of the `npm install` was truncated, leading us to believe the problem was with our NPM libraries.  However the problem was later with the `tar` command on a malformed tar file.\r\n\r\nHere is the output with `set -e`.  \r\nhttps://gist.github.com/benmullin333/fd84c941f1a81f0e3048c955e2f1585a\r\n\r\nHere is the output with the same provisioner, _without_ the `set -e`:\r\nhttps://gist.github.com/benmullin333/bbe195dce4002cde47a7ac245206b1b5\r\n\r\nI'm not sure if this falls under \"user error\" or not.  However, it would have been useful if someone had shared this information to save time.\r\n"},"comment":{"url":"https://api.github.com/repos/hashicorp/packer/issues/comments/313479829","html_url":"https://github.com/hashicorp/packer/issues/4719#issuecomment-313479829","issue_url":"https://api.github.com/repos/hashicorp/packer/issues/4719","id":313479829,"user":{"login":"SwampDragons","id":1008838,"avatar_url":"https://avatars1.githubusercontent.com/u/1008838?v=3","gravatar_id":"","url":"https://api.github.com/users/SwampDragons","html_url":"https://github.com/SwampDragons","followers_url":"https://api.github.com/users/SwampDragons/followers","following_url":"https://api.github.com/users/SwampDragons/following{/other_user}","gists_url":"https://api.github.com/users/SwampDragons/gists{/gist_id}","starred_url":"https://api.github.com/users/SwampDragons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwampDragons/subscriptions","organizations_url":"https://api.github.com/users/SwampDragons/orgs","repos_url":"https://api.github.com/users/SwampDragons/repos","events_url":"https://api.github.com/users/SwampDragons/events{/privacy}","received_events_url":"https://api.github.com/users/SwampDragons/received_events","type":"User","site_admin":false},"created_at":"2017-07-06T18:26:24Z","updated_at":"2017-07-06T18:26:24Z","body":"@PerGon I pushed the change described above... any improvement?"}}
{"actor":{"display_login":"SwampDragons"}}