# \#mongo

**URL:** https://discuss.circleci.com/tag/mongo/17.md

[Latest](https://discuss.circleci.com/latest.md) · [Categories](https://discuss.circleci.com/categories.md) · [Tags](https://discuss.circleci.com/tags.md)

---

## [Mongo container failed](https://discuss.circleci.com/t/mongo-container-failed/46448)

<div class="topic-metadata">

**Author:** [@hantsy](https://discuss.circleci.com/u/hantsy)\
**Replies:** 0\
**Last updated:** [January 2, 2023, 4:44am UTC](https://discuss.circleci.com/t/mongo-container-failed/46448 "2023-01-02T04:44:39Z")

</div>

I used the new Circle v2.1 format, and declare an executor using the latest OpenJDK and mongo, but the mongo container always failed when running the pipeline. version: 2.1 orbs: maven: circleci/maven@1.4.0 codecov…

---

## [Testing a REST API which depends on MongoDB backend, and using Cypress - fails to start API](https://discuss.circleci.com/t/testing-a-rest-api-which-depends-on-mongodb-backend-and-using-cypress-fails-to-start-api/42799)

<div class="topic-metadata">

**Author:** [@sharepointoscar](https://discuss.circleci.com/u/sharepointoscar)\
**Replies:** 3\
**Last updated:** [February 2, 2022, 2:34pm UTC](https://discuss.circleci.com/t/testing-a-rest-api-which-depends-on-mongodb-backend-and-using-cypress-fails-to-start-api/42799 "2022-02-02T14:34:24Z")

</div>

I have a config file which contains a REST API testing image using Cypress and MongoDB which is required as a backend via an env var MONGODB\_URI. If I run cypress npm test command locally, it works as expected. On Circl…

---

## [Connecting an application to a MongoDB running in a remote docker container](https://discuss.circleci.com/t/connecting-an-application-to-a-mongodb-running-in-a-remote-docker-container/42600)

<div class="topic-metadata">

**Author:** [@Robertito1](https://discuss.circleci.com/u/Robertito1)\
**Replies:** 0\
**Last updated:** [January 12, 2022, 10:08am UTC](https://discuss.circleci.com/t/connecting-an-application-to-a-mongodb-running-in-a-remote-docker-container/42600 "2022-01-12T10:08:41Z")

</div>

Hello guys, I am new to circle ci. I am trying to setup a pipleline to run the jest tests, for the tests to run the app connects to a remote docker image of the mongoDB but for some reason the app is unable to connect, I…

---

## [Container step shows 'Build was cancelled' and is a missing the green checkmark although all tests run and pass](https://discuss.circleci.com/t/container-step-shows-build-was-cancelled-and-is-a-missing-the-green-checkmark-although-all-tests-run-and-pass/37600)

<div class="topic-metadata">

**Author:** [@philosopher](https://discuss.circleci.com/u/philosopher)\
**Replies:** 8\
**Last updated:** [June 3, 2021, 11:30am UTC](https://discuss.circleci.com/t/container-step-shows-build-was-cancelled-and-is-a-missing-the-green-checkmark-although-all-tests-run-and-pass/37600 "2021-06-03T11:30:25Z")

</div>

I have integrated CircleCI into my app such that every branch that is pushed to Github gets tests run against it and can only be merged with master if all tests pass. It is working as expected but I observed some peculia…

---

## [MongoDB Up And Running](https://discuss.circleci.com/t/mongodb-up-and-running/39624)

<div class="topic-metadata">

**Author:** [@danielahedges](https://discuss.circleci.com/u/danielahedges)\
**Replies:** 5\
**Last updated:** [April 8, 2021, 2:34pm UTC](https://discuss.circleci.com/t/mongodb-up-and-running/39624 "2021-04-08T14:34:41Z")

</div>

I’ve tried to get up-and-running with a small MongoDB web application. I need to connect to a fresh mongodb on every CI run. I cannot connect. What am I missing? Here is my config.yml: version: 2.1 orbs: node: circle…

---

## [Is MongoDB really supported?](https://discuss.circleci.com/t/is-mongodb-really-supported/35750)

<div class="topic-metadata">

**Author:** [@chaim1221](https://discuss.circleci.com/u/chaim1221)\
**Replies:** 1\
**Last updated:** [May 2, 2020, 7:10pm UTC](https://discuss.circleci.com/t/is-mongodb-really-supported/35750 "2020-05-02T19:10:24Z")

</div>

It seems a lot of people have trouble with MongoDB. My particular issue right now is that I can’t get the container to stay up so that my NodeJS app can connect to it. I have tried specifying the ports as in the posts be…

---

## [Cannot read property 'split' of null, from mongoose connect with CircleCI build, works fine locally](https://discuss.circleci.com/t/cannot-read-property-split-of-null-from-mongoose-connect-with-circleci-build-works-fine-locally/34212)

<div class="topic-metadata">

**Author:** [@Archaeologist03](https://discuss.circleci.com/u/Archaeologist03)\
**Replies:** 0\
**Last updated:** [January 23, 2020, 10:07pm UTC](https://discuss.circleci.com/t/cannot-read-property-split-of-null-from-mongoose-connect-with-circleci-build-works-fine-locally/34212 "2020-01-23T22:07:19Z")

</div>

I am getting error object from mongoose.connect fail when circleCI runs tests, it doesn’t when i tested with very simple tests that does not require app(database-mongoose connect). Mongoose.connect code: mongoose .c…

---

## [Not able to connect to mongo container](https://discuss.circleci.com/t/not-able-to-connect-to-mongo-container/30210)

<div class="topic-metadata">

**Author:** [@kloudd](https://discuss.circleci.com/u/kloudd)\
**Replies:** 9\
**Last updated:** [July 14, 2019, 1:02pm UTC](https://discuss.circleci.com/t/not-able-to-connect-to-mongo-container/30210 "2019-07-14T13:02:14Z")

</div>

Hi I am not able to connect to mongoDB container. The tests were running fine till may 1st. Haven’t changed the config.yml. config.yml docker: # use django-base, which has basic stuff needed to run tests …

---

## [Docker replica sets configuration - How to run \`rs.initiate()\`?](https://discuss.circleci.com/t/docker-replica-sets-configuration-how-to-run-rs-initiate/31205)

<div class="topic-metadata">

**Author:** [@hackedieter](https://discuss.circleci.com/u/hackedieter)\
**Replies:** 1\
**Last updated:** [July 4, 2019, 11:43am UTC](https://discuss.circleci.com/t/docker-replica-sets-configuration-how-to-run-rs-initiate/31205 "2019-07-04T11:43:23Z")

</div>

Since this is closed, I can’t ask there. How is this actually achieved to configure the replica set. Do I have to run a setup script, which connects to the instance and runs the rs.initiate() command? So I added mon…

---

## [Circleci/mongo randomly fails](https://discuss.circleci.com/t/circleci-mongo-randomly-fails/30158)

<div class="topic-metadata">

**Author:** [@timsuchanek](https://discuss.circleci.com/u/timsuchanek)\
**Replies:** 9\
**Last updated:** [July 3, 2019, 2:29pm UTC](https://discuss.circleci.com/t/circleci-mongo-randomly-fails/30158 "2019-07-03T14:29:07Z")

</div>

We’re using circleci/mongo:3 in our .circleci/config.yml and for about 2 weeks it randomly fails some times to boot. The error: 2019-05-02T12:25:38.857+0000 E - \[main\] Error saving history file: FileOpenFailed: …

---

## [Go tests can't reach mongo container](https://discuss.circleci.com/t/go-tests-cant-reach-mongo-container/23913)

<div class="topic-metadata">

**Author:** [@lucasmdrs](https://discuss.circleci.com/u/lucasmdrs)\
**Replies:** 4\
**Last updated:** [July 28, 2018, 7:52am UTC](https://discuss.circleci.com/t/go-tests-cant-reach-mongo-container/23913 "2018-07-28T07:52:47Z")

</div>

I’ve been trying to improve my test job in one of my Go projects, which tries to connect to a mongo database. Here’s the config yml test: &test working\_directory: /go/src/project docker: - image: ${AWS\_REGISTRY}…

---

## [Trying to set up Mongo with authorisation enabled](https://discuss.circleci.com/t/trying-to-set-up-mongo-with-authorisation-enabled/21970)

<div class="topic-metadata">

**Author:** [@vincenzo](https://discuss.circleci.com/u/vincenzo)\
**Replies:** 13\
**Last updated:** [May 1, 2018, 9:01pm UTC](https://discuss.circleci.com/t/trying-to-set-up-mongo-with-authorisation-enabled/21970 "2018-05-01T21:01:56Z")

</div>

Hi everybody! I’ve got a little query for you all. For the sake of consistency across all the envs our apps ends up running (Platform.sh, local Lando, etc.) I’d like to configure MongoDB on CircleCI so that authorisati…

---

## [Mongo cannot initAndListen](https://discuss.circleci.com/t/mongo-cannot-initandlisten/19565)

<div class="topic-metadata">

**Author:** [@roopakv](https://discuss.circleci.com/u/roopakv)\
**Replies:** 1\
**Last updated:** [January 23, 2018, 4:13pm UTC](https://discuss.circleci.com/t/mongo-cannot-initandlisten/19565 "2018-01-23T16:13:29Z")

</div>

We’ve been seeing some issues with our circle workflowsa since yesterday evening. All mongo images fail to come up and this is what we see in the logs. We currently use the circleci/mongo:3.2-ram image. This is causi…

---

## [Node application fails to connect to MongoDB](https://discuss.circleci.com/t/node-application-fails-to-connect-to-mongodb/17378)

<div class="topic-metadata">

**Author:** [@dvidsilva](https://discuss.circleci.com/u/dvidsilva)\
**Replies:** 2\
**Last updated:** [October 15, 2017, 3:59pm UTC](https://discuss.circleci.com/t/node-application-fails-to-connect-to-mongodb/17378 "2017-10-15T15:59:26Z")

</div>

I’m getting the following error when trying to run my tests: 1) Uncaught error outside test suite Unhandled rejection MongoError: failed to connect to server \[127.0.0.1:27017\] on first connect \[MongoError: connect E…

---

## [How to build MongoDB Connection URI?](https://discuss.circleci.com/t/how-to-build-mongodb-connection-uri/1235)

<div class="topic-metadata">

**Author:** [@tejasmanohar](https://discuss.circleci.com/u/tejasmanohar)\
**Replies:** 2\
**Last updated:** [October 14, 2017, 6:29pm UTC](https://discuss.circleci.com/t/how-to-build-mongodb-connection-uri/1235 "2017-10-14T18:29:26Z")

</div>

I see here that you can include MongoDB in the CircleCI builds, but in order to connect to it programmatically from my Node.js application (via Mongoose), I'll need a connection URI / credentials + host + rest of details…

---

## [Mongo executable for pytest-mongo](https://discuss.circleci.com/t/mongo-executable-for-pytest-mongo/14821)

<div class="topic-metadata">

**Author:** [@lohrmann](https://discuss.circleci.com/u/lohrmann)\
**Replies:** 0\
**Last updated:** [July 27, 2017, 12:34am UTC](https://discuss.circleci.com/t/mongo-executable-for-pytest-mongo/14821 "2017-07-27T00:34:48Z")

</div>

Hi, I'm running pytest which needs access to /usr/bin/mongod. What path is the mongo executable accessible on if I add it with the docker image command? Is it at all? Or do I need to install it separately? On a siden…

---

## [Unable to connect to MongoDB](https://discuss.circleci.com/t/unable-to-connect-to-mongodb/11381)

<div class="topic-metadata">

**Author:** [@wildunne](https://discuss.circleci.com/u/wildunne)\
**Replies:** 0\
**Last updated:** [March 25, 2017, 3:02pm UTC](https://discuss.circleci.com/t/unable-to-connect-to-mongodb/11381 "2017-03-25T15:02:26Z")

</div>

I'm trying to get my tests working on the 14.04 image, but I'm having difficulty with the MongoDB connection. I have some rather unexciting code to connect to the database: final Datastore datastore = morphia.createD…

---

## [Action failed: Starting mongodb](https://discuss.circleci.com/t/action-failed-starting-mongodb/6377)

<div class="topic-metadata">

**Author:** [@afoninsky](https://discuss.circleci.com/u/afoninsky)\
**Replies:** 16\
**Last updated:** [March 23, 2017, 2:39pm UTC](https://discuss.circleci.com/t/action-failed-starting-mongodb/6377 "2017-03-23T14:39:18Z")

</div>

With this config: machine: services: - mongodb i’m getting error: service mongodb status || service mongodb start mongodb: unrecognized service service mongodb status || service mongodb start returned exit code…

---

## [Docker Compose With Mongo throwing connection error](https://discuss.circleci.com/t/docker-compose-with-mongo-throwing-connection-error/8066)

<div class="topic-metadata">

**Author:** [@JustNeph](https://discuss.circleci.com/u/JustNeph)\
**Replies:** 0\
**Last updated:** [November 11, 2016, 8:53pm UTC](https://discuss.circleci.com/t/docker-compose-with-mongo-throwing-connection-error/8066 "2016-11-11T20:53:01Z")

</div>

When I run my docker compose command it dies due to it not being able to connect to mongo. docker-compose.yml rspec: image: notifications/api:$APP\_ENV environment: MONGODB\_HOST: mongodb REDIS\_HOST: redis…

---

## [Random failure to connect to MongoDB](https://discuss.circleci.com/t/random-failure-to-connect-to-mongodb/597)

<div class="topic-metadata">

**Author:** [@Weblors](https://discuss.circleci.com/u/Weblors)\
**Replies:** 6\
**Last updated:** [November 3, 2016, 7:38pm UTC](https://discuss.circleci.com/t/random-failure-to-connect-to-mongodb/597 "2016-11-03T19:38:42Z")

</div>

My build failed because of the error: MongoError: server localhost:27017 sockets closed (see attachment) A rebuild fixed it. Any ideas why this might happen?

---

## [Go test inconsistent failures with linked mongodb container](https://discuss.circleci.com/t/go-test-inconsistent-failures-with-linked-mongodb-container/5793)

<div class="topic-metadata">

**Author:** [@goalbookproduct](https://discuss.circleci.com/u/goalbookproduct)\
**Replies:** 0\
**Last updated:** [August 19, 2016, 6:54pm UTC](https://discuss.circleci.com/t/go-test-inconsistent-failures-with-linked-mongodb-container/5793 "2016-08-19T18:54:23Z")

</div>

We’re using circle to build, test, and deploy a go webapp using docker. We also use mongodb as our database and we have unit tests that interact with mongodb. On local the command “go test ./…” passes fine, and until re…

---

## [Can't start mongo container as it conflicts with some other mongo service?](https://discuss.circleci.com/t/cant-start-mongo-container-as-it-conflicts-with-some-other-mongo-service/1628)

<div class="topic-metadata">

**Author:** [@viztastic](https://discuss.circleci.com/u/viztastic)\
**Replies:** 2\
**Last updated:** [January 20, 2016, 10:07pm UTC](https://discuss.circleci.com/t/cant-start-mongo-container-as-it-conflicts-with-some-other-mongo-service/1628 "2016-01-20T22:07:46Z")

</div>

I am trying to run a docker compose that initiates a mongo service (At default port 27017) and then also a nodejs container with the repo. I get this error ERROR: Cannot start container b484d55f3534accbfec60bae5a8a478b…

---

## [Fetching and Installing MongoDB 3 suddenly takes too long](https://discuss.circleci.com/t/fetching-and-installing-mongodb-3-suddenly-takes-too-long/877)

<div class="topic-metadata">

**Author:** [@Weblors](https://discuss.circleci.com/u/Weblors)\
**Replies:** 3\
**Last updated:** [December 2, 2015, 8:45am UTC](https://discuss.circleci.com/t/fetching-and-installing-mongodb-3-suddenly-takes-too-long/877 "2015-12-02T08:45:35Z")

</div>

For our project, we use mongoDB 3 and need to install it before each build. While this usually takes less than a minute, it suddenly started taking over 15. It’s still running at the time of this writing. What are th…

---

## [Using MongoDB 3.0+](https://discuss.circleci.com/t/using-mongodb-3-0/527)

<div class="topic-metadata">

**Author:** [@camsaul](https://discuss.circleci.com/u/camsaul)\
**Replies:** 2\
**Last updated:** [November 14, 2015, 5:40am UTC](https://discuss.circleci.com/t/using-mongodb-3-0/527 "2015-11-14T05:40:53Z")

</div>

How do I configure my build environment to use a non-ancient version of MongoDB?
