On Thu, 27 Aug 2020 09:04:25 -0700, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote: > > In postgresql log, it says: > > Aug 27 02:10:02 db1 postgres[62464]: [7-1] > > 10.10.10.43(41816):[unknown]@[unknown]: LOG: connection received: > > host=10.10.10.43 port=4181 Aug 27 02:10:02 db1 postgres[62464]: > > [8-1] 10.10.10.43(41816):api@api: LOG: connection authorized: > > user=api database=api Aug 27 02:10:02 db1 postgres[62464]: [9-1] > > 10.10.10.43(41816):api@api: LOG: could not send data to client: > > Permission denied > > I would think it is the above. > > Are you using some sort of authentication for the API? Sorry I'm not sure what you mean? Between the clients and the python code I use some "basic auth" (and IP restrictions on the reverse proxy). But I can't see how it would cause the problem. Between the python code and postgresql, the relevant pg_hba.conf line is host api api 10.10.10.43/32 scram-sha-256 Since except these two times it always works, why would it fail then? Cheers, Daniel