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

Error when running pnpm db:push #15

Closed
luzhengyang opened this issue Sep 30, 2023 · 2 comments
Closed

Error when running pnpm db:push #15

luzhengyang opened this issue Sep 30, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@luzhengyang
Copy link

Hey,

I'd like try this framework, but I got stuck at the first step when trying to install it locally. I have a postgresql connection string set up in .env, but I got the following error when running pnpm install or pnpm db:push. What is the hostname:'Jg'?

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: getaddrinfo ENOTFOUND Jg
    at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
    at __node_internal_ (node:internal/errors:715:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'Jg'
}
@blefnk
Copy link
Owner

blefnk commented Sep 30, 2023

Hey, and thanks for your interest in the project! This is a strange error for me too. But let's try to figure it out.


Looks like the issue is related to the Node.js DNS resolution failing for the hostname Jg, resulting in the ENOTFOUND error. The hostname seems incorrect or not resolvable to an IP address, so the application is unable to connect to the PostgreSQL database.

  1. Could you provide the database provider are you working with (Neon, Vercel Storage, or something else)? Additionally, which version of Node.js you're currently using?

  2. Check your PostgreSQL connection string. Make sure it's correctly formatted and doesn't contain any typos or extraneous characters.

  3. Could you please share the format of your connection string? Of course, please redact any sensitive information. In my case, my Neon PostgreSQL connection string looks like this:

    postgres:https://username:[email protected]/your-database-name
    
  4. It's unusual for a hostname to be 'Jg', so it's the strange error for me. Usually, it should be something like localhost or an IP address, or like above (something-random-here.eu-central-1.aws.neon.tech).

  5. If you have PostgreSQL installed, you can try connecting to the PostgreSQL database manually by using the following command (if you tried this, please let me know what happens or what do you see):

    psql postgres:https://username:[email protected]/your-database-name
    

By following these steps and answering the additional questions, we should be able to narrow down the source of the error.

Also please note, in the file src/data/db/client.ts I specified this:

const connectionString = process.env.DATABASE_URL + "?sslmode=require";

So there's no need to append ?sslmode=require to your connection string manually.

@blefnk blefnk added the question Further information is requested label Sep 30, 2023
@blefnk
Copy link
Owner

blefnk commented Nov 5, 2023

Relivator v1.1.0 has been released! 🚀 It now features an even easier installation process, with options to switch technologies on-the-fly, such as PostgreSQL/MySQL and NextAuth.js/Clerk!

@blefnk blefnk closed this as completed Nov 5, 2023
@blefnk blefnk changed the title Error when running pnpm install or pnpm db:push Error when running pnpm db:push Dec 6, 2023
@blefnk blefnk self-assigned this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants