维护后显示密码身份验证的HEROKU数据库失败
因此,我收到了Heroku的一条消息,说它需要在我的数据库上进行维护,并且只会阅读一点。但是,我去检查我的网站,并且该站点不适用于需要数据库中数据的页面,我去检查日志并查看此错误消息:
2022-05-20T09:57:55.246102+00:00 app[web.1]: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "eu-west-1.compute.amazonaws.com" (52.18.116.67), port 5432 failed: FATAL: password authentication failed for user "MYUSERNAME"
2022-05-20T09:57:55.246102+00:00 app[web.1]: connection to server at ".eu-west-1.compute.amazonaws.com" (52.18.116.67), port 5432 failed: FATAL: no pg_hba.conf entry for host "IP", user "MYUSERNAME", database "DATABASE", no encryption
我没有触摸或更改任何内容,所以不确定什么是什么问题是。
So i received a message from heroku saying it needs to carry out maintenance on my database and will be read only for a bit. However I go to check my site and the site isn't working for the pages that require data from the database, I go to check the logs and see this error message:
2022-05-20T09:57:55.246102+00:00 app[web.1]: sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "eu-west-1.compute.amazonaws.com" (52.18.116.67), port 5432 failed: FATAL: password authentication failed for user "MYUSERNAME"
2022-05-20T09:57:55.246102+00:00 app[web.1]: connection to server at ".eu-west-1.compute.amazonaws.com" (52.18.116.67), port 5432 failed: FATAL: no pg_hba.conf entry for host "IP", user "MYUSERNAME", database "DATABASE", no encryption
I haven't touched or changed anything, so not sure what the problem is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不使用Heroku管理的“动态”环境变量连接到PostgreSQL数据库,则会发生这种情况
,最好使用Database_url,因为它始终具有最新的位置,并且凭证
Heroku可以更改URL url url由于各种原因,
如果您使用的是SQLalchemy,则凭证轮换可能需要轻微 oraroard :
This happen if you are not using the "dynamic" environment variable that Heroku manage for connecting to a PostgreSQL database
If you have just one, it's better to use DATABASE_URL as it always have up-to-date location and credentials
Heroku can change the url for various reasons, ex credentials rotation
If you are using sqlalchemy you might need a slight workaround: