Mongodb charm fails to get removed if not part of replicaset

Bug #1465285 reported by Mario Splivalo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MongoDB Charm
In Progress
Undecided
Mario Splivalo

Bug Description

When single-unit mongodb is deployed no replicaset is formed. When that unit is to be removed with "juju remove", the removal fails. Here is the excerpt from juju log:

unit-mongodb-0[2202]: 2015-06-15 13:39:57 INFO unit.mongodb/0.juju-log cmd.go:247 replica-set:0: replica_set_relation_broken-start
unit-mongodb-0[2202]: 2015-06-15 13:39:57 DEBUG unit.mongodb/0.juju-log cmd.go:247 replica-set:0: am_i_primary: OperationError: command SON([('replSetGetStatus', 1)]) failed: not running with --replSet
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 Traceback (most recent call last):
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/replica-set-relation-broken", line 1662, in <module>
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 hooks.execute(sys.argv)
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/charmhelpers/core/hookenv.py", line 544, in execute
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 self._hooks[hook_name]()
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/replica-set-relation-broken", line 1244, in replica_set_relation_broken
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 if am_i_primary():
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/replica-set-relation-broken", line 1154, in am_i_primary
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 r = run_admin_command(c, 'replSetGetStatus')
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/var/lib/juju/agents/unit-mongodb-0/charm/hooks/replica-set-relation-broken", line 499, in run_admin_command
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 return client.admin.command(cmdstr)
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/usr/lib/python2.7/dist-packages/pymongo/database.py", line 396, in command
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 msg, allowable_errors)
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 File "/usr/lib/python2.7/dist-packages/pymongo/helpers.py", line 147, in _check_command_response
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 raise OperationFailure(msg % errmsg, code)
unit-mongodb-0[2202]: 2015-06-15 13:39:58 INFO unit.mongodb/0.replica-set-relation-broken logger.go:40 pymongo.errors.OperationFailure: command SON([('replSetGetStatus', 1)]) failed: not running with --replSet
unit-mongodb-0[2202]: 2015-06-15 13:39:58 ERROR juju.worker.uniter.operation runhook.go:89 hook "replica-set-relation-broken" failed: exit status 1

Revision history for this message
Mario Splivalo (mariosplivalo) wrote :

To workaround this 'juju reloved mongodb/0' should be used.

Changed in mongodb (Juju Charms Collection):
assignee: nobody → Mario Splivalo (mariosplivalo)
Changed in mongodb (Juju Charms Collection):
status: New → In Progress
affects: mongodb (Juju Charms Collection) → mongodb-charm
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.