DBAtlas · Database operations atlas

118 NamespaceNotSharded: NamespaceNotSharded

MongoDB

What does it mean?

An operation that only makes sense on sharded collections was run against a collection/namespace that is not yet sharded. The command could not be applied because the target collection is not sharded.

Why does it happen?

moveChunk, split, or certain shard-key-based administrative commands were called on a collection without sharding enabled. It usually happens because the collection was not sharded with shardCollection or the wrong namespace was targeted.

How to fix it

Check the collection's sharding status: sh.status() or config.collections. If the operation really requires sharding, first enable sharding on the database (sh.enableSharding) and shard the collection (sh.shardCollection with a suitable shard key). Otherwise these administrative commands are not needed on unsharded collections; verify that you are targeting the correct namespace.

Open in DBAtlas →

More from this engine