kolibri
kolibri copied to clipboard
List .local hostname URLs in kolibri status on PostgreSQL
❌ 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 statuslists this server's IP URLs and omits its.localhostname URLs. - Device > Info on the same server lists both. On SQLite,
kolibri statuslists both. kolibri statusruns without Django set up (cli.py#L297-L324). Before set-up, the fix for #15794 readsLocalHostnamerows from thenetworklocationSQLite 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
- Install a build with the fix for #15794, on a machine with a LAN address.
- Set
KOLIBRI_DATABASE_ENGINE=postgresand the otherKOLIBRI_DATABASE_*options for a PostgreSQL server. - Run
kolibri startand wait until Device > Info lists a.localURL. - Run
kolibri status.
Context
- Kolibri
developwith the fix for #15794, on Linux.LocalHostnameis inv0.20.0-alpha0and later, and in no stable release. - At
develop758605b764, step 4 raisesAppRegistryNotReadyon 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 onrelease-v0.20.xonly, sodevelopdoes not have it. kolibri statusopens 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 statuslists it too. - [ ] With the PostgreSQL host unreachable and the server still answering
/status/,kolibri statusprintsOK, 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.