com.mongodb.MongoException: not talking to master and retries used up

JIRA | Alan Williamson | 4 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    When we talk to a given Mongo server, through the JavaAPI, with a eval(), it always fails. Here is a quick and dirty Java program that demonstrates the issue. If we go onto the console of the server and run the same command [eval("db.serverStatus()")] it works as expected. {code:title=Bar.java|borderStyle=solid} import com.mongodb.DB; import com.mongodb.MongoClient; public class doNotUse { public static void main(String[] args) throws Exception { MongoClient mc = new MongoClient( "192.168.26.240", 49140 ); DB db = mc.getDB("log"); Object o = db.eval( "db.serverStatus()", (Object[])null ); System.out.println(o); } } {code} Fails with: {code:title=Bar.java|borderStyle=solid} Exception in thread "main" com.mongodb.MongoException: not talking to master and retries used up at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:314) at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:316) at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:316) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257) at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310) at com.mongodb.DB.command(DB.java:274) at com.mongodb.DB.command(DB.java:256) at com.mongodb.DB.command(DB.java:313) at com.mongodb.DB.command(DB.java:211) at com.mongodb.DB.doEval(DB.java:353) at com.mongodb.DB.eval(DB.java:370) at org.doNotUse.main(doNotUse.java:21) {code} The server we are talking to is a slave to another master.

    JIRA | 4 years ago | Alan Williamson
    com.mongodb.MongoException: not talking to master and retries used up
  2. 0

    Hello, I'm using MongoDb in a GWT(2.3) project (with Morphia 0.99). My GWT project is calling a mongoside function (stored in db.system.js) thanks to DB.eval(). One of my function's argument is a Regex. When i'm using a Regex like "\bFOO\b", it's working fine, but when my regexp become like "(?<!<[^>]*)\bFOO\b(?>![^<]*>)" then, i get this error: Erreur serveur: eval failed: { "assertion" : "assertion scripting/engine_spidermonkey.cpp:634" , "errmsg" : "db assertion failure" , "ok" : 0.0} com.mongodb.MongoException: eval failed: { "assertion" : "assertion scripting/engine_spidermonkey.cpp:634" , "errmsg" : "db assertion failure" , "ok" : 0.0} at com.mongodb.DB.eval(DB.java:223) This error occurs in my GWT project (so, in jetty, as it is on the server side of my GWT project). The regex i'm passing as an argument to my db.eval() is compiled by Java. So my java code is something like : String exec = "return serverSideFunction(args[0]);"; Pattern regex = Pattern.compile("(?<!<[^>]{0,10})foo(?>![^<]{0,10}>)"); Object result = db.eval(exec, regex); Nb : In my Pattern.compile(), I use {0,10}, as Java doesn't support * in regex's look-around. Nb2 : I made some little test without all javaDrivers and db.eval(), this looks like > db.Test.save({'key':'<mark key="value">value</mark>'}); > db.Test.find(); { "_id" : ObjectId("4e40d9c750d109bc7de98858"), "key" : "<mark key=\"value\">value</mark>" } > db.Test.find().forEach(function(x){x.key.replace(new RegExp('(?<!<[^>]*)value(?>![^<]*>)',''),'VALUE'); db.Test.save(x);}); Tue Aug 9 09:04:47 SyntaxError: invalid quantifier ?<!<[^>]*)value(?>![^<]*>) (shell):1 The error I get is not the same, but unless i'm doing it wrong, lookaround's features aren't really working in Mongo, aren't them? This is my first bug reporting ever, so please tell me if I'm doing it wrong. I stay at your disposal if you need any further information.

    JIRA | 6 years ago | POITTEVIN Raphael
    com.mongodb.MongoException: eval failed: { "assertion" : "assertion scripting/engine_spidermonkey.cpp:634" , "errmsg" : "db assertion failure" , "ok" : 0.0}
  3. 0

    Hello, I'm using MongoDb in a GWT(2.3) project (with Morphia 0.99). My GWT project is calling a mongoside function (stored in db.system.js) thanks to DB.eval(). One of my function's argument is a Regex. When i'm using a Regex like "\bFOO\b", it's working fine, but when my regexp become like "(?<!<[^>]*)\bFOO\b(?>![^<]*>)" then, i get this error: Erreur serveur: eval failed: { "assertion" : "assertion scripting/engine_spidermonkey.cpp:634" , "errmsg" : "db assertion failure" , "ok" : 0.0} com.mongodb.MongoException: eval failed: { "assertion" : "assertion scripting/engine_spidermonkey.cpp:634" , "errmsg" : "db assertion failure" , "ok" : 0.0} at com.mongodb.DB.eval(DB.java:223) This error occurs in my GWT project (so, in jetty, as it is on the server side of my GWT project). The regex i'm passing as an argument to my db.eval() is compiled by Java. So my java code is something like : String exec = "return serverSideFunction(args[0]);"; Pattern regex = Pattern.compile("(?<!<[^>]{0,10})foo(?>![^<]{0,10}>)"); Object result = db.eval(exec, regex); Nb : In my Pattern.compile(), I use {0,10}, as Java doesn't support * in regex's look-around. Nb2 : I made some little test without all javaDrivers and db.eval(), this looks like > db.Test.save({'key':'<mark key="value">value</mark>'}); > db.Test.find(); { "_id" : ObjectId("4e40d9c750d109bc7de98858"), "key" : "<mark key=\"value\">value</mark>" } > db.Test.find().forEach(function(x){x.key.replace(new RegExp('(?<!<[^>]*)value(?>![^<]*>)',''),'VALUE'); db.Test.save(x);}); Tue Aug 9 09:04:47 SyntaxError: invalid quantifier ?<!<[^>]*)value(?>![^<]*>) (shell):1 The error I get is not the same, but unless i'm doing it wrong, lookaround's features aren't really working in Mongo, aren't them? This is my first bug reporting ever, so please tell me if I'm doing it wrong. I stay at your disposal if you need any further information.

    JIRA | 6 years ago | POITTEVIN Raphael
    com.mongodb.MongoException: eval failed: { "assertion" : "assertion scripting/engine_spidermonkey.cpp:634" , "errmsg" : "db assertion failure" , "ok" : 0.0}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.mongodb.MongoException

      not talking to master and retries used up

      at com.mongodb.DBTCPConnector.innerCall()
    2. MongoDB Java Driver
      DB.eval
      1. com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:314)
      2. com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:316)
      3. com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:316)
      4. com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
      5. com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
      6. com.mongodb.DB.command(DB.java:274)
      7. com.mongodb.DB.command(DB.java:256)
      8. com.mongodb.DB.command(DB.java:313)
      9. com.mongodb.DB.command(DB.java:211)
      10. com.mongodb.DB.doEval(DB.java:353)
      11. com.mongodb.DB.eval(DB.java:370)
      11 frames
    3. org
      doNotUse.main
      1. org.doNotUse.main(doNotUse.java:21)
      1 frame