-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Bun throws error using the cassandra-driver #4033
Comments
bump |
double bump 👍 |
I'm seeing the error:
It's happening here:
Do I have my command misconfigured?
|
{ }, |
Same issue on mac m2. Scylla, Cassandra driver, Bun, Boum. |
@Jarred-Sumner Can you please check this issue 😅 |
@Rohit3523 can you try in the canary build of Bun? We made a tweak to DNS resolution that may fix this |
hey I've gone ahead and tried this out on canary and still seem to get the same thing Here's the logs
|
Same, issue still there with latest canary build. |
I tested it on the latest build of canary again and couldn't get it to work still, though if anyone wants a solution I've found one. The issue is right here (at least when not using ssl though probably will be the same steps below) this.netClient.connect(this.port, this.address, function connectCallback() {
self.log('verbose', `Socket connected to ${self.endpointFriendlyName}`);
self.bindSocketListeners();
self.startup(callback);
}); Changing that code to simply this (Note that code can be found here) this.netClient.connect({
host: this.address,
port: parseInt(this.port, 10)
}, function connectCallback() {
self.log('verbose', `Socket connected to ${self.endpointFriendlyName}`);
self.bindSocketListeners();
self.startup(callback);
console.log('connected')
}) gets it to connect, though I found after that I would run into an issue where the version was invalid and when it went to reconnect it failed to:
After that I just had to define the version of my cassandra / scylladb instance example code & logsimport { Client as ScyllaClient, types } from "cassandra-driver";
const scyllaClient = new ScyllaClient({
contactPoints: ['127.0.0.1'],
localDataCenter: 'datacenter1',
keyspace: 'keyspace',
credentials: {
username: 'usr',
password: 'pwd'
},
protocolOptions: {
maxVersion: types.protocolVersion.v4
}
});
try {
await scyllaClient.connect();
console.error("Connected to ScyllaDB :O");
} catch (error) {
console.error("Error connecting to ScyllaDB >>> ");
console.log(error);
} I've gone ahead and changed that stuff in |
@Jarred-Sumner Getting the following message in 1.0.4 (from website) and 1.0.5 (canary)
But same code is working in node with same file path Code:
|
@Jarred-Sumner Still facing the same issue in 1.0.20
Please have a look in this comment as they have solved it by changing library code |
For Datastax Astra Connection File, Bun is not able to verify the certificate file Code in library: https://github.com/datastax/nodejs-driver/blob/476725efc0e2712b1a001b042890f127bc1eecba/lib/datastax/cloud/index.js#L159C1-L159C1 They are using node https library Request Object
Error:
Hope both info will help you to fix this issue @Jarred-Sumner, in the mean time i am looking for file solution I guess something is wrong when converting certificate to buffer |
@Darker-Ink's solution worked for me, this clearly looks like a bug in Bun's implementation of the connect function. |
Still failing in bun 1.0.30
|
Is there any official fix for this? |
For now you can use this patch until they fix the issue: Add postinstall script to package.json: add js script "patch-cassandra-driver.js (esm)":
OR (commonjs)":
|
the temporary fix is change cassandra-driver in package.json to this: "cassandra-driver": "https://github.com/KastelApp/nodejs-driver.git", |
It solved connection issue. |
when no host is available the error thrown by bun is near identical to the node one
will have to try this again on a linux machine to test the working case |
What version of Bun is running?
0.7.3
What platform is your computer?
Linux 5.4.0-105-generic x86_64 x86_64
What steps can reproduce the bug?
Trying to connect to the cassandra database, it this case It's a ScyllaDB one.
What is the expected behavior?
The application gets connected to the database.
Using node:
What do you see instead?
A big scary error gets printed and the application can't find any hosts:
Additional information
No response
The text was updated successfully, but these errors were encountered: