Linux Labs

Web stack / Stage 7 of 9 · step 6 of 7

App can't connect to PostgreSQL

medium ~25 min
Not running Starting usually ~20 s
Report a problem

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:

  1. appuser connects to appdb over TCP on 127.0.0.1 with its password, the same way the service does;
  2. without the right password appuser cannot connect to the database;
  3. the app service is running and holds its database connection.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 3
  • appuser connects to appdb over TCP on 127.0.0.1 with its password — not checked yet
  • appuser cannot connect with a wrong password — not checked yet
  • The app service is running and connected to the database — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…