{"action":"created","issue":{"url":"https://api.github.com/repos/bflad/chef-stash/issues/157","repository_url":"https://api.github.com/repos/bflad/chef-stash","labels_url":"https://api.github.com/repos/bflad/chef-stash/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/bflad/chef-stash/issues/157/comments","events_url":"https://api.github.com/repos/bflad/chef-stash/issues/157/events","html_url":"https://github.com/bflad/chef-stash/pull/157","id":157543515,"number":157,"title":"Bitbucket 4.6 needs set-bitbucket-home.sh and set-bitbucket-user.sh","user":{"login":"atikhono","id":5199836,"avatar_url":"https://avatars.githubusercontent.com/u/5199836?v=3","gravatar_id":"","url":"https://api.github.com/users/atikhono","html_url":"https://github.com/atikhono","followers_url":"https://api.github.com/users/atikhono/followers","following_url":"https://api.github.com/users/atikhono/following{/other_user}","gists_url":"https://api.github.com/users/atikhono/gists{/gist_id}","starred_url":"https://api.github.com/users/atikhono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atikhono/subscriptions","organizations_url":"https://api.github.com/users/atikhono/orgs","repos_url":"https://api.github.com/users/atikhono/repos","events_url":"https://api.github.com/users/atikhono/events{/privacy}","received_events_url":"https://api.github.com/users/atikhono/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-30T18:40:23Z","updated_at":"2016-05-31T15:04:49Z","closed_at":"2016-05-31T00:42:59Z","pull_request":{"url":"https://api.github.com/repos/bflad/chef-stash/pulls/157","html_url":"https://github.com/bflad/chef-stash/pull/157","diff_url":"https://github.com/bflad/chef-stash/pull/157.diff","patch_url":"https://github.com/bflad/chef-stash/pull/157.patch"},"body":"The setup scripts in $BITBUCKET_HOME/bin were refactored and now they call set-bitbucket-home.sh to set BITBUCKET_HOME and set-bitbucket-user.sh to set BITBUCKET_USER instead of user.sh.\r\n\r\nWithout this patch, a Bitbucket instance starts up under root. A bundled Elasticsearch instance can't run as root and fails to start. That's the reason code search doesn't work. You get behaviour like described here: https://jira.atlassian.com/browse/BSERV-8763 (Search is currently unavailable)\r\n\r\nWe need to have $BITBUCKET_HOME/bin/set-bitbucket-home.sh and $BITBUCKET_HOME/bin/set-bitbucket-user.sh instead of  $BITBUCKET_HOME/bin/user.sh for Bitbucket 4.6.0 and higher.\r\n\r\nI tested the change with Bitbucket 4.6.2.\r\n\r\nFixes #156\r\n\r\n@linc01n @bflad Please have a look"},"comment":{"url":"https://api.github.com/repos/bflad/chef-stash/issues/comments/222717469","html_url":"https://github.com/bflad/chef-stash/pull/157#issuecomment-222717469","issue_url":"https://api.github.com/repos/bflad/chef-stash/issues/157","id":222717469,"user":{"login":"atikhono","id":5199836,"avatar_url":"https://avatars.githubusercontent.com/u/5199836?v=3","gravatar_id":"","url":"https://api.github.com/users/atikhono","html_url":"https://github.com/atikhono","followers_url":"https://api.github.com/users/atikhono/followers","following_url":"https://api.github.com/users/atikhono/following{/other_user}","gists_url":"https://api.github.com/users/atikhono/gists{/gist_id}","starred_url":"https://api.github.com/users/atikhono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atikhono/subscriptions","organizations_url":"https://api.github.com/users/atikhono/orgs","repos_url":"https://api.github.com/users/atikhono/repos","events_url":"https://api.github.com/users/atikhono/events{/privacy}","received_events_url":"https://api.github.com/users/atikhono/received_events","type":"User","site_admin":false},"created_at":"2016-05-31T15:04:49Z","updated_at":"2016-05-31T15:04:49Z","body":"The reason is in this line (start-search.sh):\r\n`$sucmd -l $BITBUCKET_USER -c \"mkdir -p \\\"$ES_CONFIG_PATH\\\" && cp -r \\\"$PRGDIR/../elasticsearch/config-template/\\\"* \\\"$ES_CONFIG_PATH\\\"\"`\r\n\r\nstart-search.sh is called from start-bitbucket.sh. start-bitbucket.sh is called by the init script:\r\n```\r\nstart() {\r\n    ./start-bitbucket.sh\r\n}\r\n```\r\nSo PRGDIR is ./. We can workaround by running $BASE/bin/start-bitbucket.sh instead of ./start-bitbucket.sh in the init script."}}
{"actor":{"display_login":"atikhono"}}