Giter Site home page Giter Site logo

Error: getaddrinfo ENOTFOUND about knex HOT 11 CLOSED

knex avatar knex commented on July 30, 2024
Error: getaddrinfo ENOTFOUND

from knex.

Comments (11)

tgriesser avatar tgriesser commented on July 30, 2024

Is there any other information you can provide here - This doesn't look to be an issue with knex, as there's no reference to the library or anything database related here... some googling turned up this on stack overflow - have you taken a look there?

from knex.

tjwebb avatar tjwebb commented on July 30, 2024

I've looked at every SO issue on this, and I'm not able to apply any of them to this situation. The inspect output confirms that my connection parameters are correct.

This is my entire program. Not too complicated.

            var store = new Knex.Initialize({
                debug: true,    // XXX
                client: 'pg',
                connection: {
                    host: process.env.SUBROUTINE_PG_HOST.toString(),
                    user: process.env.SUBROUTINE_PG_USER,
                    password: process.env.SUBROUTINE_PG_PASS,
                    database: process.env.SUBROUTINE_PG_DB,
                    charset: 'utf8'
                }
            });
            console.log(util.inspect(store));
            store.Schema.hasTable('subroutine').then(
                function(exists) {
                    ...
                },
                function(err) {
                    util.log(color.red('[db] Could not check subroutine table: '+ err.stack));
                }
            );

It fails with Could not check subroutine table, and err.stack prints out the error I copied in the OP.

from knex.

tjwebb avatar tjwebb commented on July 30, 2024

Found out something interesting. So I'm just trying to connect to Heroku postgres, I'm just using their dev server as a test.

This does not work, and throws the error above:
export SUBROUTINE_PG_HOST="ec2-54-221-229-7.compute-1.amazonaws.com"

This does work:
export SUBROUTINE_PG_HOST="54.221.229.7"

Using the hostname fails. I obviously don't have DNS issues since I'm typing to this to you right now on github.com, and I can connect fine to that hostname via pgAdmin. Why would this only happen in knex?

from knex.

tgriesser avatar tgriesser commented on July 30, 2024

That's really odd... Knex's initialize basically just passes through to pg's pg.Client... are you able to connect with the same settings to the database layer there without issue?

from knex.

tjwebb avatar tjwebb commented on July 30, 2024

I haven't tried going directly through pg.Client. Everything is working
with the IP address so I'm going to finish this up and then I'll come up
with a test case.

-tjw

On Sat, Aug 24, 2013 at 5:22 PM, Tim Griesser [email protected]:

That's really odd... Knex's initialize basically just passes through to pghttps://github.com/brianc/node-postgres's
pg.Client... are you able to connect with the same settings to the
database layer there without issue?


Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-23216878
.

from knex.

tybenz avatar tybenz commented on July 30, 2024

Is there any more on this? I haven't been able to figure this out.

I'm trying to do something very similar to the script above (but with BookshelfJS). I think I have all of the right values from my heroku postgresql DATABASE_URL, but it's not working. I've tried both the ec2 hostname and the IP address approach mentioned. Any ideas?

from knex.

bendrucker avatar bendrucker commented on July 30, 2024

Can you open a new issue and post your full config?

from knex.

tgriesser avatar tgriesser commented on July 30, 2024

Why a new issue?

from knex.

bendrucker avatar bendrucker commented on July 30, 2024

This might be related or they might not — my preference is usually for a new issue if it's not clear that it's an identical problem. That way the new issue is open and it's clear that it needs discussion.

from knex.

timhuff avatar timhuff commented on July 30, 2024

Might be a good policy to leave a comment on old issues, linking to the new one. I'm currently wrestling with this problem and would love to read the issue that (I assume) @tgriesser created.

from knex.

timhuff avatar timhuff commented on July 30, 2024

For future readers: My issue was running too many concurrent selects.

from knex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.