Secondary node stuck on STARTUP

Hi all!

I’m trying to setup a primary-secondary replica. This is to do a downtime-free migration from first node to second node in the next few days.

The primary node has been setup, the config was updated, I added the keyfile. Did the same with secondary node.

I also initialized the replication, added the secondary node to the replication. I can see a ping and uptime, but the secondary node is stuck in “STARTUP”.

However, there’s no replica config on the secondary node. Furthermore, it’s vomiting this all over the error log againd and again.

{“t”:{“$date”:“2024-11-14T11:05:24.626+00:00”},“s”:“I”, “c”:“CONNPOOL”, “id”:22576, “ctx”:“ReplNetwork”,“msg”:“Connecting”,“attr”:{“hostAndPort”:“Ubuntu-2204-jammy-amd64-base:27017”}}
{“t”:{“$date”:“2024-11-14T11:05:24.818+00:00”},“s”:“W”, “c”:“SHARDING”, “id”:7012500, “ctx”:“QueryAnalysisConfigurationsRefresher”,“msg”:“Failed to refresh query analysis configurations, will try again at the next interval”,“attr”:{“error”:“PrimarySteppedDown: No primary exists currently”}}
{“t”:{“$date”:“2024-11-14T11:05:25.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found.”},“stats”:{},“cmd”:{“aggregate”:“oplog.rs”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“local”}}}
{“t”:{“$date”:“2024-11-14T11:05:25.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found.”},“stats”:{},“cmd”:{“aggregate”:“transactions”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“config”}}}
{“t”:{“$date”:“2024-11-14T11:05:25.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found.”},“stats”:{},“cmd”:{“aggregate”:“image_collection”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“config”}}}
{“t”:{“$date”:“2024-11-14T11:05:25.627+00:00”},“s”:“I”, “c”:“CONNPOOL”, “id”:22576, “ctx”:“ReplNetwork”,“msg”:“Connecting”,“attr”:{“hostAndPort”:“Ubuntu-2204-jammy-amd64-base:27017”}}
{“t”:{“$date”:“2024-11-14T11:05:26.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found.”},“stats”:{},“cmd”:{“aggregate”:“oplog.rs”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“local”}}}
{“t”:{“$date”:“2024-11-14T11:05:26.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found.”},“stats”:{},“cmd”:{“aggregate”:“transactions”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“config”}}}
{“t”:{“$date”:“2024-11-14T11:05:26.001+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found.”},“stats”:{},“cmd”:{“aggregate”:“image_collection”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“config”}}}
{“t”:{“$date”:“2024-11-14T11:05:26.627+00:00”},“s”:“I”, “c”:“CONNPOOL”, “id”:22576, “ctx”:“ReplNetwork”,“msg”:“Connecting”,“attr”:{“hostAndPort”:“Ubuntu-2204-jammy-amd64-base:27017”}}
{“t”:{“$date”:“2024-11-14T11:05:27.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [local.oplog.rs] not found.”},“stats”:{},“cmd”:{“aggregate”:“oplog.rs”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“local”}}}
{“t”:{“$date”:“2024-11-14T11:05:27.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.transactions] not found.”},“stats”:{},“cmd”:{“aggregate”:“transactions”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“config”}}}
{“t”:{“$date”:“2024-11-14T11:05:27.000+00:00”},“s”:“W”, “c”:“QUERY”, “id”:23799, “ctx”:“ftdc”,“msg”:“Aggregate command executor error”,“attr”:{“error”:{“code”:26,“codeName”:“NamespaceNotFound”,“errmsg”:“Unable to retrieve storageStats in $collStats stage :: caused by :: Collection [config.image_collection] not found.”},“stats”:{},“cmd”:{“aggregate”:“image_collection”,“cursor”:{},“pipeline”:[{“$collStats”:{“storageStats”:{“waitForLock”:false,“numericOnly”:true}}}],“$db”:“config”}}}

It’s fixed. I just had to specify the IP address for the primary node in the config. By default, it was set to “my-ubuntu-server” which was the default hostname of the server.