Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB Compass "Topology Type: Unknown is not writable"

I've configured my MongoDB database as a single-node replica set. I can access it via the api (write data to it), and the also from the shell:

rs0:PRIMARY> rs.status()
{
    "set" : "rs0",
    "date" : ISODate("2017-12-18T14:37:13.487Z"),
    "myState" : 1,
    "term" : NumberLong(1),
    "heartbeatIntervalMillis" : NumberLong(2000),
    "optimes" : {
            "lastCommittedOpTime" : {
                    "ts" : Timestamp(1513607826, 1),
                    "t" : NumberLong(1)
            },
            "readConcernMajorityOpTime" : {
                    "ts" : Timestamp(1513607826, 1),
                    "t" : NumberLong(1)
            },
            "appliedOpTime" : {
                    "ts" : Timestamp(1513607826, 1),
                    "t" : NumberLong(1)
            },
            "durableOpTime" : {
                    "ts" : Timestamp(1513607826, 1),
                    "t" : NumberLong(1)
            }
    },
    "members" : [
            {
                    "_id" : 0,
                    "name" : "srvlx02:27017",
                    "health" : 1,
                    "state" : 1,
                    "stateStr" : "PRIMARY",
                    "uptime" : 14633,
                    "optime" : {
                            "ts" : Timestamp(1513607826, 1),
                            "t" : NumberLong(1)
                    },
                    "optimeDate" : ISODate("2017-12-18T14:37:06Z"),
                    "electionTime" : Timestamp(1513593354, 2),
                    "electionDate" : ISODate("2017-12-18T10:35:54Z"),
                    "configVersion" : 1,
                    "self" : true
            }
    ],
    "ok" : 1,
    "operationTime" : Timestamp(1513607826, 1),
    "$clusterTime" : {
            "clusterTime" : Timestamp(1513607826, 1),
            "signature" : {
                    "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                    "keyId" : NumberLong(0)
            }
    }
}
rs0:PRIMARY> rs.conf()
{
    "_id" : "rs0",
    "version" : 1,
    "protocolVersion" : NumberLong(1),
    "members" : [
            {
                    "_id" : 0,
                    "host" : "srvlx02:27017",
                    "arbiterOnly" : false,
                    "buildIndexes" : true,
                    "hidden" : false,
                    "priority" : 1,
                    "tags" : {

                    },
                    "slaveDelay" : NumberLong(0),
                    "votes" : 1
            }
    ],
    "settings" : {
            "chainingAllowed" : true,
            "heartbeatIntervalMillis" : 2000,
            "heartbeatTimeoutSecs" : 10,
            "electionTimeoutMillis" : 10000,
            "catchUpTimeoutMillis" : -1,
            "catchUpTakeoverDelayMillis" : 30000,
            "getLastErrorModes" : {

            },
            "getLastErrorDefaults" : {
                    "w" : 1,
                    "wtimeout" : 0
            },
            "replicaSetId" : ObjectId("5a379a0abe6cad70a6b66c7c")
    }
}
rs0:PRIMARY>

However, when I connect to it via Compass, it shows the topology as UNKNOWN, and does not allow to modify/delete collections/databases.

enter image description here

What could be the problem? Why Compass cannot determine the topology? Is a single-node Replica Set special case which is not supported?

Thanks for any tips!

MongoDB version: 3.6.0

MongoDB shell version v3.6.0
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.0

Compass version: 1.11.1 Community Edition

enter image description here

like image 808
Denis Avatar asked Sep 18 '25 04:09

Denis


1 Answers

If anybody else is having the same issue, I just found a bug report on MongoDB Jira about the same problem: https://jira.mongodb.org/browse/COMPASS-3264.

The solution is to leave the "Replica Set Name" field empty and it will work just fine :)

like image 66
Étienne Avatar answered Sep 20 '25 06:09

Étienne