Skip to content

Satellite Postgres schema created lazily, causing 503s on a fresh instance #8085

Description

@tommaso-ascani

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

  1. Enable call transcription/summaries on a fresh instance.
  2. Before any call is made, check the satellite Postgres database (psql -U satellite -d satellite -c '\dt'): no tables exist.
  3. Query any summary/transcription endpoint: it returns 503 with missing_table: transcripts instead of a normal empty/not-found response.

Metadata

Metadata

Labels

nethvoiceBug or features releted to the NethVoice project

Type

Fields

No fields configured for Bug.

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions