Summary
DELETE /api/v1/esindex/{indexName} physically removes the index from the search provider (ES or OS) but does not delete the corresponding row from the indicies database table.
After deletion, the indicies table retains stale entries pointing to non-existent indices.
Observed behavior
DELETE /api/v1/esindex/working_20260414033602 → HTTP 200, index physically deleted from OS
SELECT * FROM indicies; → row working_20260414033602 still present
- On next startup: dotCMS attempts to activate a non-existent index → potential startup failure or silent inconsistency
Affected providers
Confirmed for both ES and OS providers across all phases.
Root cause
ContentletIndexAPIImpl.delete() calls the physical delete on the search provider but does not follow up with a call to IndiciesAPI.removeIndiciesByName() (or equivalent) to remove the DB record.
Fix
After successful physical index deletion in ContentletIndexAPIImpl.delete(), delete the corresponding row from the indicies table:
// After successful physical delete:
APILocator.getIndiciesAPI().removeIndiciesByName(indexName);
// or for versioned indices:
versionedIndicesAPI.removeIndicesByName(indexName);
Ensure the cleanup handles both legacyIndiciesAPI (ES, non-versioned) and versionedIndicesAPI (OS, versioned) stores.
Discovered via
QA test run — TC-06 (Phase 3) and DELETE operations across phases, dotcms/dotcms:latest with single-node-os-migration stack.
Related
Summary
DELETE /api/v1/esindex/{indexName}physically removes the index from the search provider (ES or OS) but does not delete the corresponding row from theindiciesdatabase table.After deletion, the
indiciestable retains stale entries pointing to non-existent indices.Observed behavior
DELETE /api/v1/esindex/working_20260414033602→ HTTP 200, index physically deleted from OSSELECT * FROM indicies;→ rowworking_20260414033602still presentAffected providers
Confirmed for both ES and OS providers across all phases.
Root cause
ContentletIndexAPIImpl.delete()calls the physical delete on the search provider but does not follow up with a call toIndiciesAPI.removeIndiciesByName()(or equivalent) to remove the DB record.Fix
After successful physical index deletion in
ContentletIndexAPIImpl.delete(), delete the corresponding row from theindiciestable:Ensure the cleanup handles both
legacyIndiciesAPI(ES, non-versioned) andversionedIndicesAPI(OS, versioned) stores.Discovered via
QA test run — TC-06 (Phase 3) and DELETE operations across phases,
dotcms/dotcms:latestwithsingle-node-os-migrationstack.Related