After a sudden shutdown of the VM, the ArcGIS Portal is not working anymore. It's a basic ArcGIS Enterprise 10.9.1 running on Ubuntu and deployed by Chef.
That's Portal log (/opt/arcgis/portal/usr/arcgisportal/logs/gis.spatialstudieslab.org/portal):
<Msg time="2023-08-13T16:00:11,409" type="SEVERE" code="218010" source="Portal Admin" process="56639" thread="1" methodName="" machine="GIS.SPATIALSTUDIESLAB.ORG" user="" elapsed="" requestID="">The portal has been initialized and configured but is not accessible. The internal portal database does not appear to be running or accepting connections. Restart the portal machine or machines and if the problem persists, contact Esri technical support (U.S.) or your distributor (customers outside the U.S.).</Msg>
That's the portal internal database log (/opt/arcgis/portal/usr/arcgisportal/logs/database/pg_log/{postgresql}):
2023-08-13 14:00:41 PDT: [57068]: LOG: database system was shut down at 2023-08-13 13:59:36 PDT
2023-08-13 14:00:41 PDT: [57066]: LOG: database system is ready to accept connections
2023-08-13 14:00:41 PDT: [57078]: FATAL: no pg_hba.conf entry for host "[local]", user "arcgis", database "arcgis", SSL off
That's my /opt/arcgis/portal/usr/arcgisportal/db/pg_hba.conf
# "local" is for Unix domain socket connections only
local all ualas scram-sha-256
local replication ualas scram-sha-256
# IPv4 local connections:
host all ualas 127.0.0.1/32 scram-sha-256
host replication ualas 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all ualas ::1/128 scram-sha-256
host replication ualas ::1/128 scram-sha-256
I've tried adding very broad permissions entry to pg_hba.conf and it returns now:
2023-08-13 12:43:51 PDT: [30647]: LOG: database system is ready to accept connections
2023-08-13 12:43:52 PDT: [30671]: FATAL: password authentication failed for user "arcgis"
2023-08-13 12:43:52 PDT: [30671]: DETAIL: Role "arcgis" does not exist.
Connection matched pg_hba.conf line 17: "local arcgis arcgis scram-sha-256"
2023-08-13 12:43:52 PDT: [30671]: LOG: could not send data to client: Broken pipe
Is the portal using the wrong user to connect to the database? My /opt/arcgis/portal/usr/arcgisportal/db/config-store-connection.json is using the same username as my admin account in the Portal:
"username": "ualas"
arcgis is the ubuntu user that installed the software.
I also tried recovering my latest full backup, which did not fix the issue.
I appreciate any guidance.