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

Deno Fresh ConnectionRefused #94

Open
zigomir opened this issue Jul 31, 2022 · 4 comments
Open

Deno Fresh ConnectionRefused #94

zigomir opened this issue Jul 31, 2022 · 4 comments

Comments

@zigomir
Copy link

zigomir commented Jul 31, 2022

Hi,

after doing edgedb project init I can run edgedb ui and see Count object and all, but when I run deno task start and open http://localhost:8000/ I get this error:

A client connection error occurred; reconnecting because of "waitUntilAvailable=30000". ClientConnectionClosedError: network error: ConnectionRefused: Connection refused (os error 61)
    at RawConnection._onError (https://deno.land/x/[email protected]/_src/rawConn.ts:110:20)
    at TLSSocket.emit (https://deno.land/[email protected]/node/events.ts:167:20)
    at https://deno.land/x/[email protected]/_src/adapter.deno.ts:281:16

Instance is supposed to be running

edgedb instance list
┌───────┬────────────┬───────┬─────────────┬──────────┐
│ Kind  │ Name       │ Port  │ Version     │ Status   │
├───────┼────────────┼───────┼─────────────┼──────────┤
│ local │ deno_fresh │ 10701 │ 2.0+88c1706 │ running  │

I have no idea where to look next 😊

[edit] Actually I see same thing for Remix when running npx edgeql-js.

@tailhook
Copy link

tailhook commented Aug 1, 2022

Do you run deno task start and npx edgeql-js from the same directory where your edgedb project init was run?

@jaclarke
Copy link
Member

jaclarke commented Aug 1, 2022

On some platforms Deno resolves localhost to the ipv6 address ::1, and edgedb by default listens on 127.0.0.1, so you may need to configure edgedb to listen on ::1 as well. (eg: edgedb configure set listen_addresses 127.0.0.1 ::1)

@zigomir
Copy link
Author

zigomir commented Aug 3, 2022

Yes, edgedb configure set listen_addresses 127.0.0.1 ::1 fixed my problem for the deno-fresh example.
But running npx edgeql-js from remix directory still gets me:

npx edgeql-js
Detected tsconfig.json, generating TypeScript files.
   To override this, use the --target flag.
   Run `npx edgeql-js --help` for details.
Generating query builder into ./dbschema/edgeql-js
Connecting to EdgeDB instance...
Introspecting database schema...
A client connection error occurred; reconnecting because of "waitUntilAvailable=30000". ClientConnectionClosedError: network error: Error: connect ECONNREFUSED ::1:10702
    at RawConnection._onError (/Users/ziga/development/edgedb-examples/remix/node_modules/edgedb/dist/rawConn.js:115:24)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  source: Error: connect ECONNREFUSED ::1:10702
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1247:16) {
    errno: -61,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '::1',
    port: 10702
  }
}

Do you run deno task start and npx edgeql-js from the same directory where your edgedb project init was run?

Yep.

@melkir
Copy link

melkir commented Aug 5, 2022

Here's the output I got on my side

~/Projects/edgedb-fresh main*
❯ edgedb configure set listen_addresses 127.0.0.1 ::1
OK: CONFIGURE INSTANCE

~/Projects/edgedb-fresh main*
❯ npx edgeql-js
Detected package.json. Generating .js files with CommonJS module syntax.
   To override this, use the --target flag.
   Run `npx edgeql-js --help` for details.
Generating query builder into ./dbschema/edgeql-js
Connecting to EdgeDB instance...
Introspecting database schema...
Generation successful!
Checking the generated query builder into version control
is NOT RECOMMENDED. Would you like to create a .gitignore file to ignore
the query builder directory? [y/n] (leave blank for "y")
> y

However nothing is being created on ./dbschema/edgeql-js 🤔

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

4 participants