Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

MongoError: Invalid namespace specified '<database>.system.indexes' #241

Open
AudriusMasiulionis opened this issue Oct 15, 2019 · 8 comments

Comments

@AudriusMasiulionis
Copy link

Getting this error:
UnhandledPromiseRejectionWarning: MongoError: Invalid namespace specified '.system.indexes'
After npm start.

OS: windows 10
MongoDB server version: 4.2.0

@TuanWorkMail
Copy link

I also have that error

@peterblazejewicz
Copy link
Collaborator

Can you folks verify the db name in the connection string is valid one?
The configuration file ships with template db name (MONGODB_URI_LOCAL=mongodb://localhost:27017/<database>). Verify you're on the latest version too and reinstalll NPM deps.
I'll try to review this on the Windows (tried on mac OS)

@HadiGolkarian
Copy link

HadiGolkarian commented Jan 26, 2020

Can you folks verify the db name in the connection string is valid one?
The configuration file ships with template db name (MONGODB_URI_LOCAL=mongodb://localhost:27017/<database>). Verify you're on the latest version too and reinstalll NPM deps.
I'll try to review this on the Windows (tried on mac OS)

setting <database> to something like test1 solved my issue

@HoseinGhanbari
Copy link

HoseinGhanbari commented May 8, 2020

this can be closed, as the same issue can be fixed by replacing the entire <database> with dbname

MONGODB_URI_LOCAL=mongodb://localhost:27017/<database>
MONGODB_URI_LOCAL=mongodb://localhost:27017/dbname

@peterblazejewicz
Copy link
Collaborator

@AudMasiulionis is that OK to close this one?

@johnasterling
Copy link

It would be nice to fix it so it works out of the box but that did fix it for me as @HoseinGhanbari said:

2020-06-04 running on windows with MongoDB installed to run as service, I needed to set the name to: dbname

#MONGODB_URI_LOCAL=mongodb://localhost:27017/
MONGODB_URI_LOCAL=mongodb://localhost:27017/dbname

@ligerno1
Copy link

in TypeScript-Node-Starter.env.example
MONGODB_URI_LOCAL=mongodb://localhost:27017/
edit your dbname

@mikereiche
Copy link

I hit this running an older mongodb driver against a newer mongodb server. Using a new driver fixed the problem.

MongoError: Invalid namespace specified 'mydatabase.system.indexes'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants