So I have an odd problem where occasionally my relational data store will not validate and as such hosted features in my portal stop working. There are no errors in any of the stack except for the "bad login user" error in the hosting servers when it fails to validate and the "no pg_hba.confg item for <machine ip>, <username>, <database>".
Running the allowconnection.bat scrip fixes this issue temporarily. So far the issue seems to re-occur either on a specific day of the week or when trying to publish a large hosted feature service which is making portal hosting features un-usable.
I have tried the esri method of un registering, re-registering the data store and cycling the publishingtools and publishingtools.ex services to no avail. And have tried uninstalling the hosting servers and data store and building it again. Interestingly this only causes issues in my prod environment and not my non prod/dev!!
Please help I have turned myself inside out trying to fix this!!