MongoDB Reader :

Hello,

I am using MongoDB Reader. I have to extract 15000 rows from mongodb.

I have this error :

Execute failed: Exception opening the socket

and this error :

Execute failed: Timed out after 10000 ms while waiting to connect. Client view of cluster state is {type=Unknown, servers=[{address=localhost:27017, type=Unknown, state=Connecting, exception={com.mongodb.MongoException$Network: Exception opening the socket}, caused by {java.net.SocketException: No buffer space available (maximum connections reached?): connect}}]

I understand the trouble, but how can I resolve this exception with Knime ?

The second problem is that my web browser don't response to an url too. I have to stop mongoDB to get a web page from browser. The socket block my firefox.

Thanks for help.

Thierry

 

Sounds like open connections to your DB are never closed.

Have you checked your MongoDB log? It should give you a clue when a connection is opened. Something like:

2016-12-01T15:20:44.902+0100 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:61372 #14 (9 connections now open)

Are you accessing the DB only via KNIME or also through different applications when you're encountering the error?

(this is just some advice for localizing your issue. I haven't used KNIME's MongoDB nodes on my own yet).

Hello,

Thanks for your reply.

No, I access to mongodb with "actualy" Knime and "later" with Apache2. But the problem occurs only with Knime,

That's right, the connection is never closed.
But how to close the connection in Knime "Mongodb Reader Node"

I read with 15000 request and no connections are closed. How to close connection ?

Thanks for your help,

I thought, maybe, I can use a java snippet to connect and close connection, but, I have to install Maven, ....

Thierry

Thierry,

I just took the opportunity to perform some sample queries through KNIME (version 3.2.1) and can confirm, that the MongoDB reader node obviously never closes its connections after run, so new connections just "pile up" with every additional exection (and it doesn't re-use or pool existing connections).

To me, this feels like a bug/resource leak which should probably be investigated by KNIME.

Best,
Philipp

Hello Philipp,

Thank you.
Here, I see that it is maybe an "OS Kernel" problem (I was on windows)
http://stackoverflow.com/questions/21376862/java-net-socketexception-no-buffer-space-available-maximum-connections-reached

I will try on Ubuntu and i give feedback.

Best,

Thierry

Hello,

I try, but I am not sur that is the same error. I suppose that is the same error,...

But in Ubuntu, my firefox is running without problem like in Windows.

On Ubuntu, I installed KNIME 3.3.

On Window, I installed KNIME 3.2

Here is the Ubuntu mongodb Knime error :

ERROR MongoDB Reader       2:5        Execute failed: unable to create new native thread

So, I hope that the KNIME Team see this message to investigate.

Thanks Philipp,

Thierry

Hi All, i seem to have a similar issue in Knime 3.7.2.

could you let me know if the above issue (on open connections) is resolved and in which version i can get a fix ?

thx

Herman

just to document my solution here.

my work-around was to use apache-drill and connect to it via the drill-jdbc connector to query the json via SQL language

if you trigger the processing via command line, make sure to

  • export your preferences containing the jdbc database driver config
  • use the -preferences=<path/to/file.eps> to pick up the jdbc database driver config in the workflow

cheers,

H

2 Likes