PostgreSQL error out of nowhere: "no pg_hba.conf entry for host "fe80:: ..."
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    23

    Question PostgreSQL error out of nowhere: "no pg_hba.conf entry for host "fe80:: ..."

    Last week my HUD was working fine.
    I haven't changed anything since. It's possible Windows 10 has installed some updates.

    I have the PSQL database on my laptop, and HEM2 + my poker clients running on my desktop. Normally this works fine.

    On start-up, HEM2 now produces this error:
    Code:
    Connect to PostgreSQL Database
    
    Server mylaptop
    Port 5432
    User postgres
    Password ************
    
    ERROR: FATAL: 28000: no pg_hba.conf entry for host "fe80::94e2:blah:blah:blah%4", user "postgres", database "postgres", SSL off
    Any thoughts on why I should be getting this error out of the blue?
    The host address looks weird. Is that an IPv6 address? Could this be related to the problem?

    * I have checked that pinging mylaptop still works.
    * I haven't changed any of the database settings.
    * HEM2 works fine if I run it on the laptop itself. It's only remote access that seems to have broken.
    * Both client and server are running Windows 10, and have been for some time now.
    * A while back, I updated PostgreSQL on my laptop to version 9.6, and rebuilt my database. This was working fine until today.
    * I've checked that postgresql.conf still contains the uncommented line listen_addresses = '*'
    * The local IP address of the client (my desktop PC) is 192.168.0.132
    * The host address in the error message (fe80::94e2:....) does not correspond to any of the addresses listed when I run ipconfig, either on the client (desktop PC) or the server (laptop).
    * pg_hba.conf contains the following lines:

    Code:
    # TYPE  DATABASE   USER    ADDRESS                 METHOD
    
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            md5
    # IPv6 local connections:
    host    all             all             ::1/128                     md5
    host    all             all             192.168.0.0/24         md5
    Sorry for the Windows 10 query (I do understand it's not officially supported) - I'm just hoping there's a really glaring explanation for this...

  2. #2
    PostgreSQL Whisperer
    Join Date
    May 2011
    Posts
    890

    Default

    Just disable ip v6 and remove anything about it from configs including hosts file and this string in SQL config:

    host all all ::1/128 md5

    Also I see you put IPv4 address into IPv6 section: host all all 192.168.0.0/24 md5

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    23

    Question

    Thank you for the reply.
    Any chance you can hold my hand a *little* more please?

    Quote Originally Posted by Ishikawa View Post
    Just disable ip v6 and remove anything about it from configs including hosts file and this string in SQL config
    1. Unclear whether you mean "disable IPv6 [at the Windows level]" or "disable IPv6 in PSQL's configuration files"?
    If you'd written "Just disable ip v6, [comma] and..." then I'd lean towards thinking you meant the former...
    Sorry if I'm being thick...

    2. If you mean "at the Windows level"... isn't that bad?

    Also I see you put IPv4 address into IPv6 section: host all all 192.168.0.0/24 md5
    3. I didn't do anything, I swear!! One day it worked, the next day it didn't.

    4. Are there really "sections" per se? I assumed the # bits were just comments.

    5. Again sorry if I'm being stupid, but please could you provide a link / 'HOWTO' to point me in the right direction with this? You really think disabling IPv6 (whatever that means in real terms) will be the solution to my problem?

    Thanks.

  4. #4
    PostgreSQL Whisperer
    Join Date
    May 2011
    Posts
    890

    Default

    1) I meant both Windows level and SQL level. In SQL just remove the string: host all all ::1/128 md5
    2) Seems so. Just try all files from disable section. BTW thx for link.

    3) Then just remove this last string from SQL config too or move up it.

    4) Right the # bits are just comments but they show how all connection string should be ordered in the file. 1st all IPv4 string and only after that all IPv6 Strings.
    5) Yes because IPv6 isn`t so popular IP format. So some routers, ISPs, network cards still don`t support it.
    I`d try to use "Prefer IPv4 over IPv6 in prefix policies" from that MSFT article before other steps and if it doesn`t work then you should disable IPv6 completely.

  5. #5
    Junior Member
    Join Date
    Oct 2011
    Posts
    23

    Thumbs up

    It does indeed appear to have been a problem with IPv6, on the *client* side.

    Instead of registry-tinkering, I went to
    Open Network and Sharing Centre -> Change adaptor settings -> Ethernet

    and unchecked
    [ ] Internet Protocol Version 6 (TCP/IPv6)

    Now HEM2 can connect to the remote database on my laptop again.

    I've no idea why this suddenly stopped working a few days ago.
    1. Do you think a recent Windows 10 update may have altered the way IP works?
    2. Is it presently likely to be impossible to get HEM2 to get along with IPv6? (It would seem preferable to change the ethernet adaptor setting back, if possible.)

Similar Threads

  1. pg_hba.conf not saving changes?
    By brainfry35 in forum Manager General
    Replies: 3
    Last Post: 12-19-2010, 11:37 PM
  2. Postgre service doesn't start after editing pg_hba.conf
    By hypertyper in forum Manager General
    Replies: 4
    Last Post: 08-31-2010, 08:49 AM
  3. Connection Error Fata no pg_hba.conf entry for host
    By hypertyper in forum Manager General
    Replies: 2
    Last Post: 08-30-2010, 05:32 AM
  4. "missing or erroneous pg_hba.conf file"
    By scratch28 in forum Manager General
    Replies: 9
    Last Post: 04-01-2010, 10:31 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •