florinpatrascu / bolt_sips

Neo4j driver for Elixir
Apache License 2.0
256 stars 49 forks source link

Connection loses after a while: ** (Bolt.Sips.Exception) Port {:sslsocket, {:gen_tcp, #Port<0.25>, :tls_connection, :undefined}, [#PID<0.2789.0>, #PID<0.2786.0>]} is closed #105

Closed Papillon6814 closed 2 years ago

Papillon6814 commented 2 years ago

Precheck

Environment

Current behavior

The error occurs in a production environment. When we just deployed the container, the production server can access to AuraDB. But after a while (some minutes or hours later), the server cannot access to it with this error:

** (Bolt.Sips.Exception) Port {:sslsocket, {:gen_tcp, #Port<0.25>, :tls_connection, :undefined}, [#PID<0.2789.0>, #PID<0.2786.0>]} is closed

Do you know some hints to resolve the problem?

Expected behavior

The server can access to AuraDB properly.

Papillon6814 commented 2 years ago

The config is like this:

config :bolt_sips, Bolt,
url: "bolt://neo4j-********.neo4j.io:7687",
basic_auth: [username: "neo4j", password: "*************"],
ssl: true,
pool_size: 10,
ssl: true,
max_overflow: 2,
queue_interval: 500,
queue_target: 1500,
prefix: :default,
retry_linear_backoff: [delay: 150, factor: 2, tries: 3]

I tried to add retry_linear_backoff. But it did not work.

florinpatrascu commented 2 years ago

Hi there,

retry_linear_backoff can be used but not w/o much help, w/o understanding the real cause.

A little more detail would help. For example if you connect to a neo4j cluster, and if so what type of connection do you use when you discover the timeout; read/write, routing and so on.

An error stack with more details than you provided may give a better idea of the error.

I'm curious if other members of this community have encountered similar errors with AuraDB?!

Unfortunately I am not familiar with this neo4j host nor have I invested in testing it further, sorry.

Papillon6814 commented 2 years ago

Thank you for your the reply. The error log in App Engine is this:

** (MatchError) no match of right hand side value: %Bolt.Sips.Internals.Error{code: nil, connection_id: nil, function: :goodbye, message: "goodbye: Unknown failure: \"Can't close port\"\n", type: :protocol_error}

I continue researching the factor of the issue, if i find a solution, I write it here. Thank you.

florinpatrascu commented 2 years ago

_maybe related to: https://github.com/florinpatrascu/bolt_sips/issues/106#issuecomment-1165551286_ ??

Papillon6814 commented 2 years ago

Hmm I'm not sure, sorry. I close this issue. If I found any solutions for it, I put the information here.