pg_hba.conf entry for host "103.244.174.70", user "postgres", database "patientlist", no encryption, when connecting to db from nodejs sequelize-auto

huangapple go评论50阅读模式
英文:

pg_hba.conf entry for host "103.244.174.70", user "postgres", database "patientlist", no encryption, when connecting to db from nodejs sequelize-auto

问题

ConnectionError [SequelizeConnectionError]: 无 pg_hba.conf 条目适用于主机 "103.244.174.70",用户 "postgres",数据库 "patientlist",未加密
在 Client._connectionCallback (C:\Users\hamza\nx gen\patient record system\backend\node_modules\sequelize\lib\dialects\postgres\connection-manager.js:143:24)
在 Client._handleErrorWhileConnecting (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\client.js:327:19)
在 Client._handleErrorMessage (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\client.js:347:19)
在 Connection.emit (node:events:390:28)
在 C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\connection.js:117:12
在 Parser.parse (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:40:17)
在 Socket. (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\index.js:11:42)
在 Socket.emit (node:events:390:28)
在 addChunk (node:internal/streams/readable:315:12)
在 readableAddChunk (node:internal/streams/readable:289:9) {
parent: error: 无 pg_hba.conf 条目适用于主机 "103.244.174.70",用户 "postgres",数据库 "patientlist",未加密
在 Parser.parseErrorMessage (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:287:98)
在 Parser.handlePacket (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:126:29)
在 Parser.parse (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:39:38)
在 Socket. (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\index.js:11:42)
在 Socket.emit (node:events:390:28)
在 addChunk (node:internal/streams/readable:315:12)
在 readableAddChunk (node:internal/streams/readable:289:9)
在 Socket.Readable.push (node:internal/streams/readable:228:10)
在 TCP.onStreamRead (node:internal/stream_base_commons:199:23)

英文:
ConnectionError [SequelizeConnectionError]: no pg_hba.conf entry for host "103.244.174.70", user "postgres", database "patientlist", no encryption
    at Client._connectionCallback (C:\Users\hamza\nx gen\patient record system\backend\node_modules\sequelize\lib\dialects\postgres\connection-manager.js:143:24)
    at Client._handleErrorWhileConnecting (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\client.js:327:19)
    at Client._handleErrorMessage (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\client.js:347:19)
    at Connection.emit (node:events:390:28)
    at C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg\lib\connection.js:117:12
    at Parser.parse (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:40:17)
    at Socket.<anonymous> (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\index.js:11:42)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9) {
  parent: error: no pg_hba.conf entry for host "103.244.174.70", user "postgres", database "patientlist", no encryption
      at Parser.parseErrorMessage (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:287:98)
      at Parser.handlePacket (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:126:29)
      at Parser.parse (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\parser.js:39:38)
      at Socket.<anonymous> (C:\Users\hamza\nx gen\patient record system\backend\node_modules\pg-protocol\dist\index.js:11:42)
      at Socket.emit (node:events:390:28)
      at addChunk (node:internal/streams/readable:315:12)
      at readableAddChunk (node:internal/streams/readable:289:9)
      at Socket.Readable.push (node:internal/streams/readable:228:10)
      at TCP.onStreamRead (node:internal/stream_base_commons:199:23) 

getting this error and not being able to find a solution using the solutions provided on the internet

tried almost every solution and still getting this error

答案1

得分: 2

你不需要尝试"互联网上提供的解决方案"。您需要做的是打开官方手册,然后在方便的搜索框中键入"pg_hba.conf"。

这将带您到pg_hba.conf页面,该页面解释了条目的含义以及何时重新加载文件。阅读并理解了该页面后,您可以打开正确的访问权限。

注意:我希望该IP地址位于私有网络上,因为您可能不希望将postgres用户(或者如果可能的话,其他用户)的访问权限暴露给公共互联网。

英文:

You don't need to try "solutions provided on the internet". What you need to do is go to the official manuals and type "pg_hba.conf" into the handy search-box.

That will take you to the page on pg_hba.conf which explains what the entries mean and when the file gets reloaded. Having read and understood that page you can open up the correct access.

Note: I hope that IP address is on a private network, because you probably don't want to be exposing access as the postgres user (or if possible any other) to the public internet.

huangapple
  • 本文由 发表于 2023年6月5日 17:51:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76405239.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定