Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection reset by peer. #10

Open
uwejan opened this issue Feb 15, 2021 · 6 comments
Open

Connection reset by peer. #10

uwejan opened this issue Feb 15, 2021 · 6 comments

Comments

@uwejan
Copy link

uwejan commented Feb 15, 2021

Hi, am playing with the driver, i first have fresh setup of 3 nodes cluster locally. Then i try the driver;

   final db = await Cluster.connect(
    ['192.168.1.7:9042'],
    authenticator: PasswordAuthenticator('cassandra', 'cassandra'),
  );

  print('Connected to our database');

  await Future.delayed(Duration(seconds: 5));
  await db.close();

i immediately get the following error.

Connected to our database
Unhandled exception:
SocketException: OS Error: Connection reset by peer, errno = 54, address = 192.168.1.7, port = 51986

using python driver with the same fresh setup after this error, it does not produce with python.

Any idea,
Thanks.

@isoos
Copy link
Owner

isoos commented Feb 16, 2021

Maybe SSL?

@uwejan
Copy link
Author

uwejan commented Feb 16, 2021

@isoos am not using SSL, its disabled. its on my local dev machine.

@isoos
Copy link
Owner

isoos commented Feb 16, 2021

Not sure. I had once an issue with a dockerized cassandra instance, but don't recall which distribution it was.
What's the full stacktrace? Can you debug the state around this code? (either in debug mode or printing some strings)

final socket = await Socket.connect(host, port);

@uwejan
Copy link
Author

uwejan commented Feb 17, 2021

The func did not through any error. But i noticed;
removing;
await Future.delayed(Duration(seconds: 5));
And stopping client does not through the error, not sure What is going on. Could it be the delay fucn, is freezing the connection, but does not make a sense.

@isoos
Copy link
Owner

isoos commented Feb 17, 2021

I'm not sure. Did you try to execute a query or something else? We'll need more debug information (incl. versions used) or stacktraces...

@shyaml
Copy link

shyaml commented Sep 19, 2023

I gave a try and had the same connectivity issue .I replaced localhost with 127.0.0.1 and the db connect was successful . However I had another issue with the database query in the code I simply removed the code block and used a tool to connect and browse the db . The driver was able to create table tbl and data looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants