Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

fix mongodb error while provisioning devstack #650

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

mraarif
Copy link
Contributor

@mraarif mraarif commented Oct 29, 2020

have been facing issues while performing make dev.provision and running upgrade_mongo_3_6.sh (to migrate 3.4 mongodb to 3.6),
I got this output while running without /dev/null

▶ docker exec 9c418d58eeb804d5eaec10f9d1c929a51fa1cddb9cfa6812cb9e93f3360e676c bash -c 'mongo --eval \"printjson(db.serverStatus())\"'
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `mongo --eval \"printjson(db.serverStatus())\"'

I updated the script to directly use mongo shell.

@mraarif mraarif changed the title updated docker command for mongodb container's db status fix mongodb error while provisioning devstack Oct 29, 2020
@mraarif mraarif marked this pull request as ready for review October 31, 2020 09:31
@mraarif mraarif requested a review from jmbowman October 31, 2020 09:32
@@ -167,7 +167,8 @@ docker-compose exec -T mysql57 bash -c "mysql -uroot mysql" < provision.sql
# and create its users.
if needs_mongo "$to_provision_ordered"; then
echo -e "${GREEN}Waiting for MongoDB...${NC}"
until docker-compose exec -T mongo bash -c 'mongo --eval "printjson(db.serverStatus())"' &> /dev/null
# mongo container and mongo process/shell inside the container
until docker-compose exec -T mongo mongo --eval "db.serverStatus()" &> /dev/null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This partially undoes one of the changes made in https://github.com/edx/devstack/pull/532 to support multiple devstack releases; @ztraboo , did you encounter problems trying this without wrapping in bash -c?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmbowman I executed both the following commands and they seemed to give similar results.

With bash

(venv)ztraboo@ztraboo-macbookpro devstack % COMPOSE_PROJECT_NAME=devstack-juniper.master docker-compose exec -T mongo bash -c 'mongo --eval "printjson(db.serverStatus())"'

Without bash

(venv)ztraboo@ztraboo-macbookpro devstack % COMPOSE_PROJECT_NAME=devstack-juniper.master docker-compose exec -T mongo mongo --eval "db.serverStatus()"

@mraarif mraarif merged commit cd63e3a into master Nov 4, 2020
@mraarif mraarif deleted the fix-mongo-upgrade-script branch November 4, 2020 10:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants