Comment 15 for bug 1671428

Revision history for this message
John A Meinel (jameinel) wrote : Re: deploying with default binding in bundle prevents upgrade

I did find a mongodb query to fix the transaction queue if you run into this. You can run something like "dialmgo":

And then from that shell you supposedly could run something like:

db.txns.find({"s": 4, "o.c": "endpointbindings"}
).forEach(function(t) {
  t.o.forEach(function(op) {
    if (op.c == "endpointbindings") {
        printjson(op.u);
        delete op.u;
    }
  } );
  printjson(db.txns.update({_id: t._id}, {$set: {o: t.o}}));
  printjson(t._id);
  // printjson(t.o);
})

This walks the txns queue for updates that affect 'endpointbindings' and remove the 'update' field so that they aren't trying to: "$unset": "bindings."

It does delete the attribute that we want to delete, but the final 'db.txns.update' doesn't succeed because of:

{
        "nMatched" : 0,
        "nUpserted" : 0,
        "nModified" : 0,
        "writeError" : {
                "code" : 52,
                "errmsg" : "The dollar ($) prefixed field '$ne' in 'o.0.a.life.$ne' is not valid for storage."
        }
}

So for whatever reason, via golang Juju is able to insert records that have keys that start with "$blah", but I haven't figured out how to modify those same documents via the mongo shell.