Error map

Replica set lost quorum: no primary elected not primary and secondaryOk=false / No primary available after election timeout

MongoDB · layer 5, Data

Open the full error page →

Centre: this error. First ring: errors it is linked with (10). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

Replica set lost quorum: no primary elected — not primary and secondaryOk=false / No primary available after election timeout (MongoDB)Replica set…Transaction numbers are only allowed on a replica set member or mongos — MongoServerError: Transaction numbers are only allowed on a replica set member or mongos (MongoDB)Transaction numbers…Could not find host matching read preference — MongoServerSelectionError: Could not find host matching read preference { mode: "secondary" } for set rs0 (MongoDB)Could not find host…Secondary too stale to catch up (RECOVERING) — MongoDB: We are too stale to use X as a sync source / replSet too stale to catch up — member in RECOVERING state (MongoDB)Secondary too stale…AlreadyInitialized: already initialized — MongoServerError: already initialized (rs.initiate on a configured replica set) (MongoDB)AlreadyInitialized:…No primary found in replica set / ReplicaSetNoPrimary — MongoServerSelectionError: Server selection timed out after 30000 ms — topology type ReplicaSetNoPrimary (MongoDB)No primary found in…rs.initiate failed: member not reachable / no host described in new configuration — MongoDB: replSetInitiate quorum check failed: Could not connect to mongo2:27017 / No host described in new configuration 1 for replica set rs0 maps to this node (MongoDB)rs.initiate failed:…NotWritablePrimary: not primary and secondaryOk=false — MongoServerError: not primary and secondaryOk=false / NotWritablePrimary: not master (MongoDB)NotWritablePrimary:…Change streams are only supported on replica sets — MongoServerError: The $changeStream stage is only supported on replica sets (MongoDB)Change streams are …permissions on /etc/mongo.key are too open — error opening file: /etc/mongo.key: permissions on /etc/mongo.key are too open (MongoDB)permissions on /etc…Replica set member is not reachable / heartbeat failed — ReplicaSetMonitor: Heartbeat failed, host not reachable / Couldn't get a connection within the time limit (MongoDB)Replica set member …MongoServerSelectionError — MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 (Node.js)MongoServerSelectio…WriteConflict: Write conflict during plan execution — MongoServerError: WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction (MongoDB)WriteConflict: Writ…NoSuchTransaction: Transaction was aborted or expired — MongoServerError: Transaction 1 has been aborted / NoSuchTransaction: transaction has expired (transactionLifetimeLimitSeconds) (MongoDB)NoSuchTransaction: …Sort/Group exceeded memory limit of 100 MB (allowDiskUse) — MongoServerError: Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in (MongoDB)Sort/Group exceeded…Query for sharded collection must contain the shard key — MongoServerError: Query for sharded findAndModify must contain the shard key / Must run update to shard key (MongoDB)Query for sharded c…Jumbo chunk cannot be moved (balancer) — Chunk marked as jumbo / moveChunk failed: chunk too big to move (MongoDB)Jumbo chunk cannot …Unclean shutdown: mongod.lock not empty / repair needed — MongoDB: Detected unclean shutdown - /var/lib/mongodb/mongod.lock is not empty (MongoDB)Unclean shutdown: m…WiredTiger: No space left on device — MongoDB: WiredTiger error (28) [...] No space left on device / Fatal assertion 28558 ... disk full (MongoDB)WiredTiger: No spac…WriteConcernError: waiting for replication timed out — MongoServerError: Write concern error: waiting for replication timed out { w: 'majority', wtimeout: 5000 } (MongoDB)WriteConcernError: …MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017 — MongoDB: MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 (MongoDB)MongoNetworkError: …CursorNotFound: cursor id not found — MongoServerError: cursor id 1234567890 not found (CursorNotFound) (MongoDB)CursorNotFound: cur…CannotPullContainerError — ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried (AWS)CannotPullContainer…network not found — Error response from daemon: network X not found (Docker)network not foundPool overlaps — Error response from daemon: Pool overlaps with other one on this address space (Docker)Pool overlapsREADONLY You can't write against a read only replica — Redis: READONLY You can't write against a read only replica (Redis)READONLY You can't …pymongo.errors.AutoReconnect: connection closed / NotPrimaryError — pymongo.errors.AutoReconnect: cluster0-shard-00-01.mongodb.net:27017: connection closed (_ssl.c:1129) (MongoDB)pymongo.errors.Auto…mongod exited with code 14 (data dir permission / lock) — mongod: Process exited with status 14 — Exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory (MongoDB)mongod exited with …Received disconnect: Too many authentication failures — Received disconnect from host port 22:2: Too many authentication failures (Linux)Received disconnect…MongoServerError: Authentication failed (SCRAM-SHA-256 / authSource) — MongoServerError: Authentication failed. code: 18, codeName: 'AuthenticationFailed' (MongoDB)MongoServerError: A…ECONNREFUSED — Error: connect ECONNREFUSED 127.0.0.1:5432 (Node.js)ECONNREFUSEDERR_STREAM_PREMATURE_CLOSE — Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close (Node.js)ERR_STREAM_PREMATUR…fetch failed — TypeError: fetch failed (cause: ConnectTimeoutError / ECONNREFUSED / UND_ERR) (Node.js)fetch failed

Directly related (10)

Transaction numbers are only allowed on a replica set member or mongosMongoDB

MongoServerError: Transaction numbers are only allowed on a replica set member or mongos

You started a transaction (or used retryWrites) on a standalone MongoDB server, which doesn't support them.

Could not find host matching read preferenceMongoDB

MongoServerSelectionError: Could not find host matching read preference { mode: "secondary" } for set rs0

The requested read preference (secondary, nearest with tags) matches no available member.

Secondary too stale to catch up (RECOVERING)MongoDB

MongoDB: We are too stale to use X as a sync source / replSet too stale to catch up — member in RECOVERING state

A secondary fell so far behind that the primary's oplog no longer covers the gap, so it can't resync by replaying.

AlreadyInitialized: already initializedMongoDB

MongoServerError: already initialized (rs.initiate on a configured replica set)

`rs.initiate()` was called on a node that already has a replica set configuration.

No primary found in replica set / ReplicaSetNoPrimaryMongoDB

MongoServerSelectionError: Server selection timed out after 30000 ms — topology type ReplicaSetNoPrimary

The driver sees the replica set members but none is a primary (election failing or members unreachable).

rs.initiate failed: member not reachable / no host described in new configurationMongoDB

MongoDB: replSetInitiate quorum check failed: Could not connect to mongo2:27017 / No host described in new configuration 1 for replica set rs0 maps to this node

`rs.initiate()`/`rs.add()` couldn't reach a listed member or the config doesn't include the current node's hostname.

NotWritablePrimary: not primary and secondaryOk=falseMongoDB

MongoServerError: not primary and secondaryOk=false / NotWritablePrimary: not master

A write (or read without secondary preference) hit a secondary — the primary changed or you connected directly to a secondary.

Change streams are only supported on replica setsMongoDB

MongoServerError: The $changeStream stage is only supported on replica sets

Change streams need a replica set or sharded cluster.

permissions on /etc/mongo.key are too openMongoDB

error opening file: /etc/mongo.key: permissions on /etc/mongo.key are too open

The replica set keyfile must be private.

Replica set member is not reachable / heartbeat failedMongoDB

ReplicaSetMonitor: Heartbeat failed, host not reachable / Couldn't get a connection within the time limit

Replica set members can't talk to each other.

Two steps away (22)

MongoServerSelectionErrorNode.js

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

The MongoDB driver couldn’t find a reachable server for the connection string.

WriteConflict: Write conflict during plan executionMongoDB

MongoServerError: WriteConflict error: this operation conflicted with another operation. Please retry your operation or multi-document transaction

Two operations tried to modify the same document at once; one was aborted with a transient error.

NoSuchTransaction: Transaction was aborted or expiredMongoDB

MongoServerError: Transaction 1 has been aborted / NoSuchTransaction: transaction has expired (transactionLifetimeLimitSeconds)

A transaction ran longer than the allowed lifetime (60 s default) or was aborted, so later operations fail.

Sort/Group exceeded memory limit of 100 MB (allowDiskUse)MongoDB

MongoServerError: Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true to opt in

An aggregation stage needed more than 100 MB of RAM and spilling to disk wasn't enabled.

Query for sharded collection must contain the shard keyMongoDB

MongoServerError: Query for sharded findAndModify must contain the shard key / Must run update to shard key

A write on a sharded collection lacks the shard key.

Jumbo chunk cannot be moved (balancer)MongoDB

Chunk marked as jumbo / moveChunk failed: chunk too big to move

A chunk grew too large to migrate.

Unclean shutdown: mongod.lock not empty / repair neededMongoDB

MongoDB: Detected unclean shutdown - /var/lib/mongodb/mongod.lock is not empty

MongoDB wasn't shut down cleanly (crash/power loss), so it warns or refuses to start without recovery.

WiredTiger: No space left on deviceMongoDB

MongoDB: WiredTiger error (28) [...] No space left on device / Fatal assertion 28558 ... disk full

MongoDB ran out of disk space on the data volume and stopped or refuses writes.

WriteConcernError: waiting for replication timed outMongoDB

MongoServerError: Write concern error: waiting for replication timed out { w: 'majority', wtimeout: 5000 }

The write wasn't acknowledged by enough members in time.

MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017MongoDB

MongoDB: MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017

The driver couldn't connect to a MongoDB server on localhost:27017 — nothing is listening there.

CursorNotFound: cursor id not foundMongoDB

MongoServerError: cursor id 1234567890 not found (CursorNotFound)

A cursor you were iterating timed out or was killed on the server, so the next batch fails.

CannotPullContainerErrorAWS

ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried

The ECS task couldn’t pull its image — no network route to the registry, missing ECR permissions, or a wrong image tag.

network not foundDocker

Error response from daemon: network X not found

The container or Compose project refers to a Docker network that doesn’t exist (any more).

Pool overlapsDocker

Error response from daemon: Pool overlaps with other one on this address space

Docker tried to create a network whose subnet clashes with an existing Docker network (or a VPN/host route).

READONLY You can't write against a read only replicaRedis

Redis: READONLY You can't write against a read only replica

The client is connected to a replica (or a failed-over node) and tried to write.

pymongo.errors.AutoReconnect: connection closed / NotPrimaryErrorMongoDB

pymongo.errors.AutoReconnect: cluster0-shard-00-01.mongodb.net:27017: connection closed (_ssl.c:1129)

PyMongo lost the connection and may retry.

mongod exited with code 14 (data dir permission / lock)MongoDB

mongod: Process exited with status 14 — Exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory

`mongod` couldn't start because the data directory or log/socket file isn't writable or already locked.

Received disconnect: Too many authentication failuresLinux

Received disconnect from host port 22:2: Too many authentication failures

The ssh-agent offered too many keys before the right one.

MongoServerError: Authentication failed (SCRAM-SHA-256 / authSource)MongoDB

MongoServerError: Authentication failed. code: 18, codeName: 'AuthenticationFailed'

The credentials or auth database were wrong.

ECONNREFUSEDNode.js

Error: connect ECONNREFUSED 127.0.0.1:5432

Nothing is listening at that host:port — the target service is down or you’re connecting to the wrong address.

ERR_STREAM_PREMATURE_CLOSENode.js

Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close

A stream ended or was destroyed before it finished — often a client disconnect or upstream aborting a download.

fetch failedNode.js

TypeError: fetch failed (cause: ConnectTimeoutError / ECONNREFUSED / UND_ERR)

Node’s built-in fetch (undici) couldn’t complete the request; the real reason is in error.cause.