Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Run start-bitbucket.sh with the full path in Bitbucket init script #158

Merged
merged 1 commit into from
Jun 7, 2016

Conversation

atikhono
Copy link
Contributor

@atikhono atikhono commented Jun 1, 2016

After merging #157 I've converged a new bitbucket instance, and it seems that patch isn't enough to bring the code search up.

When I start Bitbucket manually, I get 'cannot stat' error and elasticsearch fails as log4j isn't configured properly (elasticsearch/config-template/ contains logging configuration). The result is the same -- 'Search is unavailable'.

/etc/init.d/bitbucket start
-------------------------------------------------------------------------------
Starting Atlassian Bitbucket and bundled Elasticsearch
To start Atlassian Bitbucket on its own, run start-webapp.sh instead
-------------------------------------------------------------------------------
Starting Elasticsearch bundled with Atlassian Bitbucket
BITBUCKET_HOME set to /var/atlassian/application-data/bitbucket
Starting Elasticsearch bundled with Atlassian Bitbucket as dedicated user stash 

cp: cannot stat `./../elasticsearch/config-template/*': No such file or directory

Elasticsearch bundled with Atlassian Bitbucket started successfully

The culprit is this line (in start-search.sh):
$sucmd -l $BITBUCKET_USER -c "mkdir -p "$ES_CONFIG_PATH" && cp -r "$PRGDIR/../elasticsearch/config-template/"* "$ES_CONFIG_PATH""

It copies logging configuration to where elasticsearch is set to look for it.

start-search.sh is called by start-bitbucket.sh, and start-bitbucket.sh is called by the init script:

start() {
    ./start-bitbucket.sh
}

So PRGDIR is ./. It looks like a bug in start-search.sh.
We can workaround by running $BASE/bin/start-bitbucket.sh instead of ./start-bitbucket.sh in the init script. Worked for me.

@atikhono
Copy link
Contributor Author

atikhono commented Jun 1, 2016

@linc01n please have a look

@linc01n
Copy link
Collaborator

linc01n commented Jun 1, 2016

I can start bitbucket and search with d779f76 of the cookbook on an upgrade of existing instance. Let me try fresh one.

@atikhono
Copy link
Contributor Author

atikhono commented Jun 6, 2016

@linc01n have you got a fresh instance working without this patch?

@linc01n linc01n added the fix label Jun 7, 2016
@linc01n linc01n merged commit bc81c99 into bflad:master Jun 7, 2016
@linc01n
Copy link
Collaborator

linc01n commented Jun 7, 2016

@atikhono I tried a fresh install and reproduce this bug. It is about the copying of the elasticsearch config files. Merged. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants