How to Fix MongoDB Error 148 (ReadConcernMajorityNotEnabled)
You get mongodb error 148 when a query asks for majority read concern on a node that disables it. To fix this error, enable majority read concern in your cluster setup or lower the query read level. MongoDB names this failure ReadConcernMajorityNotEnabled and groups it under the VoteAbortError category. It stops transactions and reads when the storage engine cannot verify data across most nodes. Teams see this issue during cluster migrations, storage tweaks, or replica set repairs. What cause
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You get mongodb error 148 when a query asks for majority read concern on a node that disables it. To fix this error, enable majority read concern in your cluster setup or lower the query read level.
MongoDB names this failure ReadConcernMajorityNotEnabled and groups it under the VoteAbortError category. It stops transactions and reads when the storage engine cannot verify data across most nodes. Teams see this issue during cluster migrations, storage tweaks, or replica set repairs.
What causes mongodb error 148 in your cluster
A replica set uses majority read concern to return data that most nodes wrote to disk. This feature needs extra memory and disk cache to track old data states. Some admins turn off majority read concern to save memory on small servers.
When an app sends a read request with a majority level, the database checks its local state. If the node has majority reads turned off, it rejects the request right away. The server then returns code 148 to the client app.
Multi-document transactions also trigger this error when they need to abort a commit vote. Because code 148 falls under the VoteAbortError category, a node cannot confirm its transaction state. The transaction fails so your app does not read uncommitted or rolled-back records.
You might also see this error if a replica set member falls into a bad state. A misconfigured secondary node or an arbiter change can break how the cluster tracks majority writes. In other cases, a client driver upgrade changes the default read level without the team knowing.
How to diagnose and fix ReadConcernMajorityNotEnabled
Start by checking which app or user sent the failing read request. You do not need to give engineers full admin rights to check cluster settings. MongoDB grants access through role-based rules that apply to a single database down to the collection level.
Give your on-call engineer a basic read role to inspect the database state safely. The built-in read role lets a user run find, listCollections, listIndexes, dbStats, collStats, and changeStream actions. It blocks write actions like insert, update, remove, or dropCollection so no one changes live data by mistake.
MongoDB Authentication & Authorization + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Next, check the startup settings on each replica set node in your cluster. Look at whether an admin turned off majority read support on the storage engine. If your servers have enough memory and disk speed, turn majority read support back on across all nodes.
Restart each secondary node one at a time, and step down the primary node last. This rolling restart keeps your app online while the cluster applies the new setting. Once all nodes support majority reads, the VoteAbortError failures will stop.
If you cannot restart the cluster right away, change the read concern level in your client app. Set the client read level to local or available for queries that do not need strict checks. Keep in mind that transactions and change streams often require majority reads to work at all.
How to prevent majority read errors in production
Keep your staging and live clusters on the exact same storage settings. Many teams hit code 148 because they test on a single node and deploy to a replica set. Make sure every replica set member uses the same startup rules.
Limit who can change cluster settings or run heavy queries in production. MongoDB Atlas database users have different built-in roles than self-hosted users, though both use the same privilege actions. Only give the readWrite role to services that must insert, update, remove, or create indexes.
When engineers inspect live data to debug read errors, protect sensitive fields in query results. Data masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in query results. This lets your team fix database errors while keeping customer records safe.
Add command guardrails and field masking beside MongoDB
Collection roles and IP rules control who connects to MongoDB. Yet an active client or agent session can still run a pipeline that writes data or reads raw personal fields. In practice, hoop.dev sits inline in the wire protocol beside your database as a sidecar for your MongoDB. For every command an agent or human sends in production, hoop.dev decides to pass, mask, block, or escalate it for review.
Using hoop.dev MongoDB controls, guardrails refuse banned commands before they run or hold risky calls for approval, and data masking rewrites matched fields in returned documents in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and generates evidence for GDPR, HIPAA, and PCI DSS programs. View the project on GitHub.
Frequently asked questions
What does ReadConcernMajorityNotEnabled mean in MongoDB?
It means a client asked for data confirmed by most replica set nodes, but the server disabled that feature. MongoDB returns error code 148 and stops the query or transaction vote.
Can I fix mongodb error 148 without restarting the database?
Yes, you can lower the read concern level in your app driver to local instead of majority. Still, if you use change streams or transactions that require majority reads, you must update and restart the nodes.
Which MongoDB role should I use to check collection stats during an outage?
Use the built-in read role on the target database. It allows safe diagnostic actions like dbStats, collStats, and find without allowing any data changes.
Related guides
In this post