Google Groups

Re: Mongo failing connection on 127.0.0.1/localhost


Xavier Vdb Apr 23, 2012 2:40 PM
Posted in group: mongodb-user
Hello

I think my problem with the elasticsearch river is related (2.0.4 64bits + 2.7.2 driver)

https://github.com/richardwilly98/elasticsearch-river-mongodb/issues/10

with DEBUG Mode :

[2012-04-23 19:34:29,678][ERROR][river.mongodb            ] [Human Robot] [mongodb][filesysidx] Mongo gave an exception
com.mongodb.MongoException$Network: can't call something : xxx/local
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:189)
        at com.mongodb.DBApiLayer$Result._advance(DBApiLayer.java:452)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:408)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at com.mongodb.DBApiLayer$Result.next(DBApiLayer.java:409)
        at
...
...
Caused by: java.io.EOFException
        at org.bson.io.Bits.readFully(Bits.java:37)
        at org.bson.io.Bits.readFully(Bits.java:28)
        at com.mongodb.Response.<init>(Response.java:39)
        at com.mongodb.DBPort.go(DBPort.java:128)
        at com.mongodb.DBPort.call(DBPort.java:79)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
        ... 841 more
[2012-04-23 19:34:29,708][ERROR][river.mongodb            ] [Human Robot] [mongodb][filesysidx] Mongo gave an exception
com.mongodb.MongoException$Network: can't call something : xxxx/local
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
        at com.mongodb.DBCursor._check(DBCursor.java:369)
        at com.mongodb.DBCursor._hasNext(DBCursor.java:498)
        at com.mongodb.DBCursor.hasNext(DBCursor.java:523)
        at org.elasticsearch.river.mongodb.MongoDBRiver$Slurper.run(MongoDBRiver.java:355)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.IOException: couldn't connect to [xxxx] bc:java.net.ConnectException: Connection refused
        at com.mongodb.DBPort._open(DBPort.java:228)
        at com.mongodb.DBPort.go(DBPort.java:112)
        at com.mongodb.DBPort.call(DBPort.java:79)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
        ... 6 more


and after, each call of elasticsearch :

[ERROR][river.mongodb            ] [Human Robot] [mongodb][profileidx] Mongo gave an exception
com.mongodb.MongoException$Network: can't call something : xxxx/local
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
        at com.mongodb.DBCursor._check(DBCursor.java:369)
        at com.mongodb.DBCursor._hasNext(DBCursor.java:498)
        at com.mongodb.DBCursor.hasNext(DBCursor.java:523)
        at org.elasticsearch.river.mongodb.MongoDBRiver$Slurper.run(MongoDBRiver.java:355)
        at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.IOException: couldn't connect to [xxxx] bc:java.net.ConnectException: Connection refused
        at com.mongodb.DBPort._open(DBPort.java:228)
        at com.mongodb.DBPort.go(DBPort.java:112)
        at com.mongodb.DBPort.call(DBPort.java:79)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
        ... 6 more




Le mardi 10 avril 2012 18:10:50 UTC+2, Marc a écrit :
Can you please paste the section of your Java code where you are
creating the connection to Mongo?  It should be something like:
Mongo m = new Mongo("localhost", 27017);

Do these errors occur right when the connection is being made, or do
they appear at a later point in your application?  If so, what is the
operation that generates these errors?  Can you please paste that
code?

Are you running mongo on the default port, 27017?

Thanks.