Problem
On a freshly enabled NethVoice instance, summary/transcription endpoints (nethcti-middleware) can return 503 satellite database schema not initialized even though the feature is correctly configured.
Root cause
The satellite Postgres schema (transcripts, transcript_chunks tables, pgvector extension) is only created lazily, inside db.py's _ensure_schema(), the first time a call is successfully persisted (persist=true on /api/get_transcription). Nothing creates it proactively when the feature is enabled, unlike e.g. MariaDB which has a dedicated create-module/50mariadb-init step.
Verified on a test instance: right after enabling the feature, psql -d satellite -c '\dt' showed zero tables. If the very first call is never successfully persisted (for any reason, e.g. related issue about the dialplan reload), the schema never gets created and stays that way indefinitely.
Test Case
- Enable call transcription/summaries on a fresh instance.
- Before any call is made, check the satellite Postgres database (
psql -U satellite -d satellite -c '\dt'): no tables exist.
- Query any summary/transcription endpoint: it returns
503 with missing_table: transcripts instead of a normal empty/not-found response.
Problem
On a freshly enabled NethVoice instance, summary/transcription endpoints (nethcti-middleware) can return
503 satellite database schema not initializedeven though the feature is correctly configured.Root cause
The satellite Postgres schema (
transcripts,transcript_chunkstables, pgvector extension) is only created lazily, insidedb.py's_ensure_schema(), the first time a call is successfully persisted (persist=trueon/api/get_transcription). Nothing creates it proactively when the feature is enabled, unlike e.g. MariaDB which has a dedicatedcreate-module/50mariadb-initstep.Verified on a test instance: right after enabling the feature,
psql -d satellite -c '\dt'showed zero tables. If the very first call is never successfully persisted (for any reason, e.g. related issue about the dialplan reload), the schema never gets created and stays that way indefinitely.Test Case
psql -U satellite -d satellite -c '\dt'): no tables exist.503withmissing_table: transcriptsinstead of a normal empty/not-found response.