influxdata/influxdb · error · CatalogError

Cannot overwrite Processing Engine Trigger

Error message

Cannot overwrite Processing Engine Trigger {} in Database {}

What it means

The catalog already contains a Processing Engine trigger with the given name in the given database, and the requested operation would overwrite it. InfluxDB 3 refuses to silently replace an existing trigger definition, so the call fails with this error.

Solutions

  1. Delete the existing trigger first (DROP TRIGGER / delete trigger API), then create it with the new definition.
  2. Use the replace/overwrite option of the trigger-creation API if one is exposed instead of plain create.
  3. Pick a new, unique trigger name if both triggers should coexist.
  4. Make deployment scripts idempotent: check whether the trigger exists and compare its definition before creating.

Example fix

// before
CREATE TRIGGER "my_trigger" ON DATABASE mydb ...;
// after (remove the stale trigger first)
DROP TRIGGER "my_trigger" ON DATABASE mydb;
CREATE TRIGGER "my_trigger" ON DATABASE mydb ...;
Defensive patterns

Strategy: validation

Validate before calling

// Check trigger existence before creating
const existing = await client.listTriggers(db);
if (existing.some(t => t.triggerName === name)) {
  await client.deleteTrigger(db, name); // or use replace semantics
}
await client.createTrigger(db, { triggerName: name, /* ... */ });

Type guard

function triggerExists(triggers, name) {
  return Array.isArray(triggers) && triggers.some(t => t?.triggerName === name);
}

Try / catch

try {
  await createTrigger(db, spec);
} catch (e) {
  if (String(e).includes('Cannot overwrite Processing Engine Trigger')) {
    await deleteTrigger(db, spec.triggerName);
    await createTrigger(db, spec);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the Processing Engine trigger creation/install API (e.g. CREATE TRIGGER or the catalog's processing-engine trigger write) with a trigger_name that already exists in database_name, without explicitly replacing/deleting it first.

Common situations: Re-running a setup script that installs triggers idempotently but lacks replace semantics; renaming plugin code but reusing an old trigger name; deploying the same trigger to a database where a prior deployment left it installed.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/f9eca25e177d7271. Report an issue: GitHub.

Appendix: source

Thrown at influxdb3_catalog/src/error.rs:213

    },

    #[error(
        "Series key mismatch on table {}. Existing table has {}",
        table_name,
        existing
    )]
    SeriesKeyMismatch {
        table_name: String,
        existing: String,
    },

    #[error("catalog subscription error: {0}")]
    Subscription(#[from] SubscriptionError),

    #[error(transparent)]
    Other(#[from] anyhow::Error),

    #[error(
        "Cannot overwrite Processing Engine Trigger {} in Database {}",
        trigger_name,
        database_name
    )]
    ProcessingEngineTriggerExists {
        database_name: String,
        trigger_name: String,
    },

    #[error(
        "Cannot delete running plugin {}. Disable it first or use --force.",
        trigger_name
    )]
    ProcessingEngineTriggerRunning { trigger_name: String },

    #[error(
        "Cannot delete plugin {} in database {} because it is used by trigger {}",
        plugin_name,

View on GitHub (pinned to 06200ef96b)