seppevs / migrate-mongo

A database migration tool for MongoDB in Node
MIT License
927 stars 163 forks source link

ERROR: command find requires authentication #288

Closed Tagman closed 1 year ago

Tagman commented 3 years ago

I setup a mongo db via docker. Using the basic example from docker-hub. Using the mongo-express web interface I can correctly see the initial databases 'admin', 'config', etc.

But when I try to simply check the migrations with npx migrate-mongo status my terminal just return the error in the title ERROR: command find requires authentication

I couldnt find a way to add my mongo credentials. I set them up via the docker-compose file. Is it trying to use any credentials saved locally somewhere?

Tagman commented 3 years ago

Using the url property inside migrate-mongo-config.js like this makes it work. Is their any way to configure the password without writing it in plain-text inside the config?

sushanth-shetty commented 2 years ago

Hi Tagman, are you able to run migrations inside docker? I am getting the following error even if the migrate-mongo is installed globally inside docker. const utf8Encoder = new TextEncoder(); api | ^ api | api | ReferenceError: TextEncoder is not defined api | at Object. (/usr/local/lib/node_modules/migrate-mongo/node_modules/whatwg-url/lib/encoding.js:2:21) api | at Module._compile (internal/modules/cjs/loader.js:778:30) api | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) api | at Module.load (internal/modules/cjs/loader.js:653:32) api | at tryModuleLoad (internal/modules/cjs/loader.js:593:12) api | at Function.Module._load (internal/modules/cjs/loader.js:585:3) api | at Module.require (internal/modules/cjs/loader.js:692:17) api | at require (internal/modules/cjs/helpers.js:25:18) api | at Object. (/usr/local/lib/node_modules/migrate-mongo/node_modules/whatwg-url/lib/url-state-machine.js:5:34)

seppevs commented 1 year ago

Closing this. Issue is not caused by migrate-mongo IMHO.