我正在尝试运行包含knex和pg的测试套件,但由于以下错误而失败:
Knex:warning - Pool2 - Error: Pool was destroyed
Knex:Error Pool2 - error: password authentication failed for user <username>
Unhandled rejection Error: Pool was destroyed
我的knexfile看起来像这样:(/knexfile.js)
// Update with your config settings.
module.exports = {
testing: {
client: 'postgresql',
connection: {
database: 'learnco_blog_test'
},
pool: {
min:0,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
},
development: {
client: 'postgresql',
connection: {
database: 'learnco_blog',
},
pool: {
min: 0,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
},
};
我将pg_hba.conf文件更改为“信任” IPV4和IPV6上的所有连接,我认为这可以解决该问题,但是一直存在。任何想法还有什么可能导致这种情况?可能在knexfile中吗?我正在使用psql 10.4,Ubuntu 16.04,knex 0.10.0和pg 4.5.5。谢谢!
另外,如果我运行psql -h localhost -U并输入正确的sudo密码,则会收到一条错误消息,提示用户的密码身份验证失败。