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

Client connection refused by default when running on Node 22 #1158

Open
n2k3 opened this issue Dec 16, 2024 · 0 comments
Open

Client connection refused by default when running on Node 22 #1158

n2k3 opened this issue Dec 16, 2024 · 0 comments

Comments

@n2k3
Copy link

n2k3 commented Dec 16, 2024

Describe the bug
After upgrading from node 20 to node v22.12.0 (LTS), running my project locally this error occurred:

A client connection error occurred; reconnecting because of "waitUntilAvailable=30000". ClientConnectionClosedError: network error: Error: connect ECONNREFUSED ::1:10705
    at <unknown> (ClientConnectionClosedError: network error: Error: connect ECONNREFUSED ::1:10705) {
  [cause]: Error: connect ECONNREFUSED ::1:10705
      at <unknown> (Error: connect ECONNREFUSED ::1:10705) {
    errno: -4078,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '::1',
    port: 10705
  }
}

This happens when trying to sign in via emailPasswordSignIn server action (using @edgedb/auth-nextjs 0.4.0-canary.20241211T200202)
But I can connect to my instance REPL, and run the command edgedb ui and browse the database, that all works.

Reproduction
How I create my client & auth:

// edgedb.ts
import createAuth from "@edgedb/auth-nextjs/app";
import { createClient } from "edgedb";

export const client = createClient({
  tlsSecurity: process.env.NODE_ENV === "development" ? "insecure" : "default",
});

export const auth = createAuth(client, {
  "https://localhost:3000",
  passwordResetPath: "/reset-password",
});

Code that produces the error:

// auth.ts (auth related server actions)
import { auth } from "@/edgedb";

const { emailPasswordSignIn } = auth.createServerActions();

export const signInAction = async (formData: FormData) => {
  const tokenData = await emailPasswordSignIn(formData);
  //                ^-- bug occurs happens here when this function is called
}

Expected behavior
I expect the client to connect properly and be able to use the auth extention.

Versions
OS: Windows 11 Pro 23H2 build 22631.4602 with WSL2 on Ubuntu 22.04.3 LTS
EdgeDB server: 5.7+a084c4f (also occurs on 5.6+51fd5fe before upgrading)
EdgeDB CLI: 6.0.2+275a1ad
edgedb-js: 0.4.0-canary.20241211T200202 (also occurs on 0.3.2)
Node: 22.12.0 (20.18.1 works)

Additional context

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

1 participant