2

Please help me to figure it out, help is much appreciated!

ERROR:

FATAL:  no pg_hba.conf entry for replication connection from host "172.18.0.4", user "repmgr", SSL on

The following is a list of my pg_hba entries:enter image description here

The following is the query output from pg_hba_file_rules:

line_number | type  |   database    | user_name  |  address   |                 netmask                 | auth_method | options | error
------------+-------+---------------+------------+------------+-----------------------------------------+-------------+---------+-------
      85 | local | {all}         | {postgres} |            |                                         | peer        |         |
      90 | local | {all}         | {all}      |            |                                         | peer        |         |
      92 | host  | {all}         | {all}      | 127.0.0.1  | 255.255.255.255                         | md5         |         |
      94 | host  | {all}         | {all}      | ::1        | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff | md5         |         |
      97 | local | {replication} | {all}      |            |                                         | peer        |         |
      98 | host  | {replication} | {all}      | 127.0.0.1  | 255.255.255.255                         | md5         |         |
      99 | host  | {replication} | {all}      | ::1        | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff | md5         |         |
     101 | host  | {all}         | {repmgr}   | 172.18.0.0 | 255.255.255.0                           | trust       |         |
     102 | host  | {replication} | {repmgr}   | 172.18.0.0 | 255.255.255.0                           | trust       |         |

As you can see, the pg_hba.conf did get loaded to the database. Where did I do wrong?

1 Answer 1

-1

Finally got it working!!!

Since the pg_hba.conf records are examined sequentially for each connection attempt, the order of the records is significant. Typically, earlier records will have tight connection match parameters and weaker authentication methods, while later records will have looser match parameters and stronger authentication methods.

2
  • But what earlier one was it matching? And if it was matching an earlier one, why would it say there was no entry found? I often see this when the first attempt was with SSL on, it failed (for example, wrong password) so automatically retires with SSL off and fails with no hba entry. Only the last failure is reported. But that doesn't really explain your situation.
    – jjanes
    Feb 12, 2019 at 18:10
  • but how did you get it working....
    – dangel
    Jul 26, 2020 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.