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?
And here is the error in the “Connect to DB” step:
#!/bin/bash -eo pipefail
mongo --username=mongouser --password=mongopass --eval "printjson(db.apikeys.count());" dbname
MongoDB shell version: 3.2.11
connecting to: dbname
2021-04-01T17:13:49.031+0000 E QUERY [thread1] Error: Authentication failed. :
DB.prototype._authOrThrow@src/mongo/shell/db.js:1441:20
@(auth):6:1
@(auth):1:2
exception: login failed
Exited with code exit status 1
CircleCI received exit code 1
I’ve noticed there are a lot of questions here about getting up and running with a Mongo app, not a lot of good answers. I want to use Mongo 4.x but cannot figure out how to install the db tools alone. So I’ve tried 3.6 and now I can’t authenticate for some reason? What am I missing?
Do you absolutely need auth to run your app in CI? I was able to get your config to run a green job by omitting the auth. If you need the auth do let me know, but it might be easier to bypass this blocker by removing it if unnecessary.
Maybe you could also share a bit more about your issue with Mongo4.x. I’m not sure I totally understand the issue with installing the db tools and that version. Additional insights would be helpful.
But you get an error because those client tools require libcurl4 and you cannot install it:
The following packages have unmet dependencies:
mongodb-org-shell : Depends: libcurl4 (>= 7.16.2) but it is not installable
E: Unable to correct problems, you have held broken packages.
I was able to get the 4.x shell tools installed into the circleci/node:10-browsers image using the instructions here. Can you try them and see if they work for your job?