question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting error: message: 'no such cmd: replSetGetConfig' in mongo-sidecar

See original GitHub issue

Hi all,

I have been trying to set up a mongodb replica set on k8s cluster. I am able to run all the pods, but they are not connected to each other, when I checked the logs of sidecar, I get the following error:

Addresses to add:     [ '10.1.220.17:27017', '10.1.23.157:27017', '10.1.220.18:27017' ]
Addresses to remove:  []
Error in workloop { MongoError: no such cmd: replSetGetConfig
    at Function.MongoError.create (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/error.js:31:11)
    at /opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:497:72
    at authenticateStragglers (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:443:16)
    at Connection.messageHandler (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/pool.js:477:5)
    at Socket.<anonymous> (/opt/cvallance/mongo-k8s-sidecar/node_modules/mongodb-core/lib/connection/connection.js:321:22)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at TCP.onread (net.js:561:20)
  name: 'MongoError',
  message: 'no such cmd: replSetGetConfig',
  ok: 0,
  errmsg: 'no such cmd: replSetGetConfig',
  code: 59,
  'bad cmd': { replSetGetConfig: 1 } }

Any idea what could cause this error? or How to resolve it? TIA.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Pensucommented, May 25, 2017

Ah, ok, got it, looks like I am running 2.6, let me change that to 3 and will update.

usr/bin/mongod --help for help and startup options
2017-05-25T10:16:23.550+0000 [initandlisten] MongoDB starting : pid=7 port=27017 dbpath=/data/db 64-bit host=09b982be4355
2017-05-25T10:16:23.550+0000 [initandlisten] db version v2.6.3
2017-05-25T10:16:23.550+0000 [initandlisten] git version: nogitversion
2017-05-25T10:16:23.550+0000 [initandlisten] OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
2017-05-25T10:16:23.550+0000 [initandlisten] build info: Linux fisher02 3.13.0-16-generic #36-Ubuntu SMP Tue Mar 4 23:03:28 UTC 2014 ppc64le BOOST_LIB_VERSION=1_55
2017-05-25T10:16:23.551+0000 [initandlisten] allocator: tcmalloc
2017-05-25T10:16:23.551+0000 [initandlisten] options: {}
2017-05-25T10:16:23.573+0000 [initandlisten] journal dir=/data/db/journal
2017-05-25T10:16:23.574+0000 [initandlisten] recover : no journal files present, no recovery needed
2017-05-25T10:16:24.450+0000 [initandlisten] preallocateIsFaster=true 8.92
2017-05-25T10:16:25.387+0000 [initandlisten] preallocateIsFaster=true 9.24
2017-05-25T10:16:27.273+0000 [initandlisten] preallocateIsFaster=true 9.3
2017-05-25T10:16:27.274+0000 [initandlisten] preallocateIsFaster check took 3.7 secs
0reactions
Pensucommented, Jun 5, 2017

So, restarting the whole cluster solved the issue. Probably something old that was preserving. Closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MongoDB Unauthorized: replSetGetConfig - Stack Overflow
Have tried searching around a bit but am not able to find a solution. root@mongo-db-1:~# mongo MongoDB shell version v3.4.0 connecting to ...
Read more >
replSetGetConfig — MongoDB Manual
To run, replSetGetConfig must be issued against the admin database. The command ... The command errors if run with commitmentStatus: true on a...
Read more >
[bitnami/mongodb] Error: error doing query: failed: network ...
I have a mongodb cluster setup on kubernetes using the bitnami helm chart. ... msg="Failed to get replSetGetConfig: (Unauthorized) command ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found