Step 6 of 7 · lab · 25 min
App can't connect to PostgreSQL
A service fails on start with a database connection error, although PostgreSQL is running. Give it password access back.
Situation
The app service works with the PostgreSQL database appdb as the database user appuser
and connects to it over TCP at 127.0.0.1:5432. Since this morning the service will not come
up: it fails on start, and systemd restarts it every few seconds. PostgreSQL itself is
running.
Run administrative commands with sudo. There is no internet on the machine.
Task
Make it so that:
appuserconnects toappdbover TCP on127.0.0.1with its password, the same way the service does;- without the right password
appusercannot connect to the database; - the
appservice is running and holds its database connection.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 3-
appuser connects to appdb over TCP on 127.0.0.1 with its password — not done yet
-
appuser cannot connect with a wrong password — not done yet
-
The app service is running and connected to the database — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04
The machine is starting
Hints
0 of 3Lab goals
0 of 3-
appuser connects to appdb over TCP on 127.0.0.1 with its password — not done yet
-
appuser cannot connect with a wrong password — not done yet
-
The app service is running and connected to the database — not done yet
Goals are checked on the machine after every command.