Comments (11)
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.
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.
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.
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.
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.
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.
Can you open a new issue and post your full config?
from knex.
Why a new issue?
from knex.
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.
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.
For future readers: My issue was running too many concurrent selects.
from knex.
Related Issues (20)
- Add comments to promise aware knex transaction commits
- Using Jest with Knex, I get 'Error: Unable to acquire a connection' every time HOT 1
- Parse a query string back to QueryBuilder object?
- Transaction method resolves if the provided callback rejects with `undefined`.
- insert() with typescript
- Casing issues
- connection string isn't working
- Raw query HOT 6
- directory option should take absolute paths HOT 1
- limit() is not working with delete()
- Update multiple fields. One field not updated sometimes
- Wrong TypeScript type when using .count('*')
- pglite support
- esm migrations does not work on Node 22
- Straightforward way of getting the PID of a query, ahead-of-time.
- can't extend existing method
- Error without actual reason in CLI due to TypeScript error
- Unknown pending operation error HOT 1
- Mysql forShare query compiler error
- `timestamps` method signature in schema is misleading
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knex.