kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

List .local hostname URLs in kolibri status on PostgreSQL

Open rtibblesbot opened this issue 1 week ago • 0 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: develop

Observed behavior

  • On PostgreSQL, with the fix for #15794, kolibri status lists this server's IP URLs and omits its .local hostname URLs.
  • Device > Info on the same server lists both. On SQLite, kolibri status lists both.
  • kolibri status runs without Django set up (cli.py#L297-L324). Before set-up, the fix for #15794 reads LocalHostname rows from the networklocation SQLite file, which PostgreSQL settings do not define (base.py#L202-L233).

User-facing consequences

An admin who runs kolibri status on a PostgreSQL server does not see the kolibri.local URL to hand to learners.

Steps to reproduce

  1. Install a build with the fix for #15794, on a machine with a LAN address.
  2. Set KOLIBRI_DATABASE_ENGINE=postgres and the other KOLIBRI_DATABASE_* options for a PostgreSQL server.
  3. Run kolibri start and wait until Device > Info lists a .local URL.
  4. Run kolibri status.

Context

  • Kolibri develop with the fix for #15794, on Linux. LocalHostname is in v0.20.0-alpha0 and later, and in no stable release.
  • At develop 758605b764, step 4 raises AppRegistryNotReady on either database engine (get_local_hostnames()); #15794 fixes that.
  • #15964 (closed) reported that crash. Its fix, #15967, sets up Django in status (KolibriStatusCommand) and is on release-v0.20.x only, so develop does not have it.
  • kolibri status opens no database connection today, and its /status/ probe has a 3-second timeout (get_status()).
  • libpq waits indefinitely for a connection unless connect_timeout (https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-CONNECT-TIMEOUT) is set, and Kolibri's PostgreSQL settings do not set it.

Acceptance Criteria

  • [ ] On PostgreSQL, when Device > Info lists http://kolibri.local:<port>/, kolibri status lists it too.
  • [ ] With the PostgreSQL host unreachable and the server still answering /status/, kolibri status prints OK, running (0) and the IP URLs within 3 seconds of the probe's answer.
  • [ ] A test runs each case above in a process that has not set up Django.

AI usage

Claude Code found this while working #15794 and drafted this issue without human review.

rtibblesbot avatar Nov 25 '26 08:11 rtibblesbot