Command not found error in CircleCI 2.0

If you see something like this on CircleCI 2.0 builds:

/bin/bash: mongo: command not found

This is because all of your commands will run in the first container that is listed (primary container). This is typically not the database container, which means that the mongo cli is likely not installed in the primary container. The same can happen for mysql and postgresql.

In these cases you can install the client using sudo apt install or the relevant package manager for the distro your image is running.

example:

- run: sudo apt-get install mongodb-clients

More details on Discuss here: https://discuss.circleci.com/t/bin-bash-mongo-command-not-found/16218/6

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.