Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

fix mongodb error while provisioning devstack#650

Merged
mraarif merged 1 commit into
masterfrom
fix-mongo-upgrade-script
Nov 4, 2020
Merged

fix mongodb error while provisioning devstack#650
mraarif merged 1 commit into
masterfrom
fix-mongo-upgrade-script

Conversation

@mraarif

@mraarif mraarif commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

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
Comment thread provision.sh
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
Copy Markdown
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
Copy Markdown
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.

3 participants