Error
Error Code:
137
MongoDB Error 137: Incompatible Sharding Config
Description
This error indicates a mismatch in the sharding configuration version across different components of your MongoDB sharded cluster. It typically occurs when config servers or `mongos` instances are out of sync regarding the cluster's metadata.
Error Message
Incompatible Sharding Config Version
Known Causes
4 known causesMismatched Config Server Versions
Different config servers in the replica set hold varying versions of the sharding metadata, causing inconsistencies.
Stale `mongos` Cache
A `mongos` router instance is operating with an outdated sharding configuration cached locally, not reflecting the current cluster state.
Incomplete Configuration Propagation
Recent sharding configuration changes (e.g., adding a shard) have not fully propagated to all cluster components.
Manual Config Database Tampering
Direct, unauthorized modifications to the `config` database can corrupt metadata and lead to version discrepancies.
Solutions
Coming SoonGeneral Troubleshooting Tips
- Check the error message carefully for specific details
- Review recent changes that might have caused the error
- Search for the exact error code in the official documentation
- Check log files for additional context
- Try restarting the application or service