{"action":"opened","number":217,"pull_request":{"url":"https://api.github.com/repos/acidprime/r10k/pulls/217","id":39535209,"html_url":"https://github.com/acidprime/r10k/pull/217","diff_url":"https://github.com/acidprime/r10k/pull/217.diff","patch_url":"https://github.com/acidprime/r10k/pull/217.patch","issue_url":"https://api.github.com/repos/acidprime/r10k/issues/217","number":217,"state":"open","locked":false,"title":"Don't set ENV['HOME'] inside webhook","user":{"login":"brdude","id":410764,"avatar_url":"https://avatars.githubusercontent.com/u/410764?v=3","gravatar_id":"","url":"https://api.github.com/users/brdude","html_url":"https://github.com/brdude","followers_url":"https://api.github.com/users/brdude/followers","following_url":"https://api.github.com/users/brdude/following{/other_user}","gists_url":"https://api.github.com/users/brdude/gists{/gist_id}","starred_url":"https://api.github.com/users/brdude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brdude/subscriptions","organizations_url":"https://api.github.com/users/brdude/orgs","repos_url":"https://api.github.com/users/brdude/repos","events_url":"https://api.github.com/users/brdude/events{/privacy}","received_events_url":"https://api.github.com/users/brdude/received_events","type":"User","site_admin":false},"body":"Don't set ENV['HOME'] inside webhook, and let the application inherit from the user it is running at.\r\n\r\nBy setting HOME it causes the application to cause an error whenever the users home is not located in /var/lib. Some more information bellow:\r\n\r\n/var/log/webhook/access.log:\r\n<pre>\r\n[2015-07-08 19:12:39] DEBUG Rack::Handler::WEBrick is mounted on /.\r\n[2015-07-08 19:12:39] INFO  WEBrick::HTTPServer#start: pid=16933 port=8088\r\n[2015-07-08 19:13:26] DEBUG accept: 127.0.0.1:45979\r\n[2015-07-08 19:13:26] DEBUG Rack::Handler::WEBrick is invoked.\r\n[2015-07-08 19:13:26] INFO  authenticated: puppet\r\n[2015-07-08 19:13:26] ERROR message: \r\n/usr/share/rubygems/rubygems/path_support.rb:68:in `path=': undefined method `+' for nil:NilClass (NoMethodError)\r\n        from /usr/share/rubygems/rubygems/path_support.rb:30:in `initialize'\r\n        from /usr/share/rubygems/rubygems.rb:357:in `new'\r\n        from /usr/share/rubygems/rubygems.rb:357:in `paths'\r\n        from /usr/share/rubygems/rubygems.rb:379:in `path'\r\n        from /usr/share/rubygems/rubygems/specification.rb:794:in `dirs'\r\n        from /usr/share/rubygems/rubygems/specification.rb:658:in `each_normal'\r\n        from /usr/share/rubygems/rubygems/specification.rb:669:in `_all'\r\n        from /usr/share/rubygems/rubygems/specification.rb:822:in `each'\r\n        from /usr/share/rubygems/rubygems/specification.rb:864:in `find'\r\n        from /usr/share/rubygems/rubygems/specification.rb:864:in `find_inactive_by_path'\r\n        from /usr/share/rubygems/rubygems.rb:175:in `try_activate'\r\n        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'\r\n        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'\r\n        from <internal:abrt_prelude>:2:in `<compiled>'\r\n trace: [\"/usr/local/bin/webhook:168:in `deploy'\", \"/usr/local/bin/webhook:121:in `block in <class:Server>'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'\", \"/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'\", \"/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'\", \"/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'\", \"/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'\", \"/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'\", \"/usr/local/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'\", \"/usr/local/share/gems/gems/rack-1.6.4/lib/rack/nulllogger.rb:9:in `call'\", \"/usr/local/share/gems/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/show_exceptions.rb:21:in `call'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'\", \"/usr/local/share/gems/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'\", \"/usr/local/share/gems/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in `service'\", \"/usr/share/ruby/webrick/httpserver.rb:138:in `service'\", \"/usr/share/ruby/webrick/httpserver.rb:94:in `run'\", \"/usr/share/ruby/webrick/server.rb:295:in `block in start_thread'\"]\r\n[2015-07-08 19:13:26] DEBUG close: 127.0.0.1:45979\r\n</pre>\r\n\r\n\r\nA snipped from a strace:\r\n<pre>\r\nlstat(\"/usr/share\", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0\r\nlstat(\"/usr/share/rubygems\", {st_mode=S_IFDIR|0755, st_size=71, ...}) = 0\r\nlstat(\"/usr/share/rubygems/rubygems\", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0\r\nlstat(\"/usr/share/rubygems/rubygems/path_support.rb\", {st_mode=S_IFREG|0644, st_size=1623, ...}) = 0\r\ngetuid()                                = 0\r\nstat(\"/var/lib/root\", 0x7ffd2249f880)   = -1 ENOENT (No such file or directory)\r\nwrite(2, \"/usr/share/rubygems/rubygems/pat\"..., 58) = 58\r\nwrite(2, \": \", 2)                       = 2\r\nwrite(2, \"undefined method `+' for nil:Nil\"..., 37) = 37\r\nwrite(2, \" (\", 2)                       = 2\r\nwrite(2, \"NoMethodError\", 13)           = 13\r\nwrite(2, \")\\n\", 2)                      = 2\r\n</pre>","created_at":"2015-07-08T23:40:48Z","updated_at":"2015-07-08T23:40:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/acidprime/r10k/pulls/217/commits","review_comments_url":"https://api.github.com/repos/acidprime/r10k/pulls/217/comments","review_comment_url":"https://api.github.com/repos/acidprime/r10k/pulls/comments{/number}","comments_url":"https://api.github.com/repos/acidprime/r10k/issues/217/comments","statuses_url":"https://api.github.com/repos/acidprime/r10k/statuses/1822859035118852bce59090e4d9174c23def5c1","head":{"label":"brdude:master","ref":"master","sha":"1822859035118852bce59090e4d9174c23def5c1","user":{"login":"brdude","id":410764,"avatar_url":"https://avatars.githubusercontent.com/u/410764?v=3","gravatar_id":"","url":"https://api.github.com/users/brdude","html_url":"https://github.com/brdude","followers_url":"https://api.github.com/users/brdude/followers","following_url":"https://api.github.com/users/brdude/following{/other_user}","gists_url":"https://api.github.com/users/brdude/gists{/gist_id}","starred_url":"https://api.github.com/users/brdude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brdude/subscriptions","organizations_url":"https://api.github.com/users/brdude/orgs","repos_url":"https://api.github.com/users/brdude/repos","events_url":"https://api.github.com/users/brdude/events{/privacy}","received_events_url":"https://api.github.com/users/brdude/received_events","type":"User","site_admin":false},"repo":{"id":35518213,"name":"r10k","full_name":"brdude/r10k","owner":{"login":"brdude","id":410764,"avatar_url":"https://avatars.githubusercontent.com/u/410764?v=3","gravatar_id":"","url":"https://api.github.com/users/brdude","html_url":"https://github.com/brdude","followers_url":"https://api.github.com/users/brdude/followers","following_url":"https://api.github.com/users/brdude/following{/other_user}","gists_url":"https://api.github.com/users/brdude/gists{/gist_id}","starred_url":"https://api.github.com/users/brdude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brdude/subscriptions","organizations_url":"https://api.github.com/users/brdude/orgs","repos_url":"https://api.github.com/users/brdude/repos","events_url":"https://api.github.com/users/brdude/events{/privacy}","received_events_url":"https://api.github.com/users/brdude/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brdude/r10k","description":"Setup and configure r10k for use with git based environments in puppet","fork":true,"url":"https://api.github.com/repos/brdude/r10k","forks_url":"https://api.github.com/repos/brdude/r10k/forks","keys_url":"https://api.github.com/repos/brdude/r10k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brdude/r10k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brdude/r10k/teams","hooks_url":"https://api.github.com/repos/brdude/r10k/hooks","issue_events_url":"https://api.github.com/repos/brdude/r10k/issues/events{/number}","events_url":"https://api.github.com/repos/brdude/r10k/events","assignees_url":"https://api.github.com/repos/brdude/r10k/assignees{/user}","branches_url":"https://api.github.com/repos/brdude/r10k/branches{/branch}","tags_url":"https://api.github.com/repos/brdude/r10k/tags","blobs_url":"https://api.github.com/repos/brdude/r10k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brdude/r10k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brdude/r10k/git/refs{/sha}","trees_url":"https://api.github.com/repos/brdude/r10k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brdude/r10k/statuses/{sha}","languages_url":"https://api.github.com/repos/brdude/r10k/languages","stargazers_url":"https://api.github.com/repos/brdude/r10k/stargazers","contributors_url":"https://api.github.com/repos/brdude/r10k/contributors","subscribers_url":"https://api.github.com/repos/brdude/r10k/subscribers","subscription_url":"https://api.github.com/repos/brdude/r10k/subscription","commits_url":"https://api.github.com/repos/brdude/r10k/commits{/sha}","git_commits_url":"https://api.github.com/repos/brdude/r10k/git/commits{/sha}","comments_url":"https://api.github.com/repos/brdude/r10k/comments{/number}","issue_comment_url":"https://api.github.com/repos/brdude/r10k/issues/comments{/number}","contents_url":"https://api.github.com/repos/brdude/r10k/contents/{+path}","compare_url":"https://api.github.com/repos/brdude/r10k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brdude/r10k/merges","archive_url":"https://api.github.com/repos/brdude/r10k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brdude/r10k/downloads","issues_url":"https://api.github.com/repos/brdude/r10k/issues{/number}","pulls_url":"https://api.github.com/repos/brdude/r10k/pulls{/number}","milestones_url":"https://api.github.com/repos/brdude/r10k/milestones{/number}","notifications_url":"https://api.github.com/repos/brdude/r10k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brdude/r10k/labels{/name}","releases_url":"https://api.github.com/repos/brdude/r10k/releases{/id}","created_at":"2015-05-12T23:44:19Z","updated_at":"2015-05-12T23:44:20Z","pushed_at":"2015-07-08T23:28:29Z","git_url":"git://github.com/brdude/r10k.git","ssh_url":"git@github.com:brdude/r10k.git","clone_url":"https://github.com/brdude/r10k.git","svn_url":"https://github.com/brdude/r10k","homepage":"","size":495,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"acidprime:master","ref":"master","sha":"1a4ddba88bbd4193a4b61aa4fe3425cd7c94b2a1","user":{"login":"acidprime","id":1173142,"avatar_url":"https://avatars.githubusercontent.com/u/1173142?v=3","gravatar_id":"","url":"https://api.github.com/users/acidprime","html_url":"https://github.com/acidprime","followers_url":"https://api.github.com/users/acidprime/followers","following_url":"https://api.github.com/users/acidprime/following{/other_user}","gists_url":"https://api.github.com/users/acidprime/gists{/gist_id}","starred_url":"https://api.github.com/users/acidprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acidprime/subscriptions","organizations_url":"https://api.github.com/users/acidprime/orgs","repos_url":"https://api.github.com/users/acidprime/repos","events_url":"https://api.github.com/users/acidprime/events{/privacy}","received_events_url":"https://api.github.com/users/acidprime/received_events","type":"User","site_admin":false},"repo":{"id":9922918,"name":"r10k","full_name":"acidprime/r10k","owner":{"login":"acidprime","id":1173142,"avatar_url":"https://avatars.githubusercontent.com/u/1173142?v=3","gravatar_id":"","url":"https://api.github.com/users/acidprime","html_url":"https://github.com/acidprime","followers_url":"https://api.github.com/users/acidprime/followers","following_url":"https://api.github.com/users/acidprime/following{/other_user}","gists_url":"https://api.github.com/users/acidprime/gists{/gist_id}","starred_url":"https://api.github.com/users/acidprime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acidprime/subscriptions","organizations_url":"https://api.github.com/users/acidprime/orgs","repos_url":"https://api.github.com/users/acidprime/repos","events_url":"https://api.github.com/users/acidprime/events{/privacy}","received_events_url":"https://api.github.com/users/acidprime/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/acidprime/r10k","description":"Setup and configure r10k for use with git based environments in puppet","fork":false,"url":"https://api.github.com/repos/acidprime/r10k","forks_url":"https://api.github.com/repos/acidprime/r10k/forks","keys_url":"https://api.github.com/repos/acidprime/r10k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/acidprime/r10k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/acidprime/r10k/teams","hooks_url":"https://api.github.com/repos/acidprime/r10k/hooks","issue_events_url":"https://api.github.com/repos/acidprime/r10k/issues/events{/number}","events_url":"https://api.github.com/repos/acidprime/r10k/events","assignees_url":"https://api.github.com/repos/acidprime/r10k/assignees{/user}","branches_url":"https://api.github.com/repos/acidprime/r10k/branches{/branch}","tags_url":"https://api.github.com/repos/acidprime/r10k/tags","blobs_url":"https://api.github.com/repos/acidprime/r10k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/acidprime/r10k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/acidprime/r10k/git/refs{/sha}","trees_url":"https://api.github.com/repos/acidprime/r10k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/acidprime/r10k/statuses/{sha}","languages_url":"https://api.github.com/repos/acidprime/r10k/languages","stargazers_url":"https://api.github.com/repos/acidprime/r10k/stargazers","contributors_url":"https://api.github.com/repos/acidprime/r10k/contributors","subscribers_url":"https://api.github.com/repos/acidprime/r10k/subscribers","subscription_url":"https://api.github.com/repos/acidprime/r10k/subscription","commits_url":"https://api.github.com/repos/acidprime/r10k/commits{/sha}","git_commits_url":"https://api.github.com/repos/acidprime/r10k/git/commits{/sha}","comments_url":"https://api.github.com/repos/acidprime/r10k/comments{/number}","issue_comment_url":"https://api.github.com/repos/acidprime/r10k/issues/comments{/number}","contents_url":"https://api.github.com/repos/acidprime/r10k/contents/{+path}","compare_url":"https://api.github.com/repos/acidprime/r10k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/acidprime/r10k/merges","archive_url":"https://api.github.com/repos/acidprime/r10k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/acidprime/r10k/downloads","issues_url":"https://api.github.com/repos/acidprime/r10k/issues{/number}","pulls_url":"https://api.github.com/repos/acidprime/r10k/pulls{/number}","milestones_url":"https://api.github.com/repos/acidprime/r10k/milestones{/number}","notifications_url":"https://api.github.com/repos/acidprime/r10k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/acidprime/r10k/labels{/name}","releases_url":"https://api.github.com/repos/acidprime/r10k/releases{/id}","created_at":"2013-05-07T22:18:04Z","updated_at":"2015-07-01T21:53:35Z","pushed_at":"2015-07-07T17:20:42Z","git_url":"git://github.com/acidprime/r10k.git","ssh_url":"git@github.com:acidprime/r10k.git","clone_url":"https://github.com/acidprime/r10k.git","svn_url":"https://github.com/acidprime/r10k","homepage":"","size":2440,"stargazers_count":58,"watchers_count":58,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":80,"mirror_url":null,"open_issues_count":25,"forks":80,"open_issues":25,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/acidprime/r10k/pulls/217"},"html":{"href":"https://github.com/acidprime/r10k/pull/217"},"issue":{"href":"https://api.github.com/repos/acidprime/r10k/issues/217"},"comments":{"href":"https://api.github.com/repos/acidprime/r10k/issues/217/comments"},"review_comments":{"href":"https://api.github.com/repos/acidprime/r10k/pulls/217/comments"},"review_comment":{"href":"https://api.github.com/repos/acidprime/r10k/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/acidprime/r10k/pulls/217/commits"},"statuses":{"href":"https://api.github.com/repos/acidprime/r10k/statuses/1822859035118852bce59090e4d9174c23def5c1"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":0,"deletions":1,"changed_files":1}}