Skip to content

Summary/transcription endpoints return 503 instead of not-found when satellite schema is missing #8086

Description

@tommaso-ascani

Problem

nethcti-middleware's summary/transcription/history endpoints (GET/HEAD/PUT /summary/:uniqueid, POST /history/statuses, GET /history/calls, GET /transcripts/:uniqueid) return a hard 503 satellite database schema not initialized whenever the satellite transcripts table doesn't exist, even when that simply means "nothing has been persisted yet" (fresh instance, or before the first successful call), not an actual outage.

This is indistinguishable, on the client, from a real database failure, and made an ordinary fresh-instance state look like a broken deployment while investigating a related issue.

Root cause

isSatelliteSchemaMissingError is checked in several handlers and always maps to a 503 response (writeSatelliteSchemaMissingResponse / inline http.StatusServiceUnavailable), even though every one of those handlers already has a well-defined "no data found" response for the exact same situation (404, 204, or an empty/not_found item), used when the table exists but simply has no matching row.

Test Case

  1. On an instance with satellite configured but where the transcripts table does not exist yet (fresh instance before any successful persisted call).
  2. Call HEAD /summary/:uniqueid, POST /history/statuses, GET /transcripts/:uniqueid, GET /summary/:uniqueid, GET /history/calls?...&artifact=summary: each returns 503 instead of the same not-found/empty response used for a genuinely absent record.

Metadata

Metadata

Labels

nethvoiceBug or features releted to the NethVoice projectnethvoice-ctiThe issue is related to NethLink (NethVoice Web client)

Type

Fields

No fields configured for Bug.

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions