influxdata/influxdb · error · anyhow::Error

unexpectedly found scheduled trigger specification cron

Error message

unexpectedly found scheduled trigger specification cron:{schedule} for WAL plugin {trigger_name}

What it means

`make_wal_table_filter` builds the table filter for WAL-triggered plugins and only accepts WAL-compatible trigger specifications. A `Schedule { cron }` specification on a WAL plugin is an internal invariant violation — cron triggers don't run per WAL flush — so this error flags a misconfigured trigger.

Solutions

  1. Recreate the trigger with a matching specification: use `SINGLE TABLE WAL WRITE` style spec for WAL plugins, cron for scheduled plugins.
  2. Check the trigger's specification with `SHOW TRIGGERS` and align it with the plugin type.
  3. Verify how the trigger was created — the CREATE TRIGGER statement should not combine `AT cron` with a WAL plugin.

Example fix

// before
CREATE TRIGGER "wal_trig" ON db PROCESSING ENGINE PLUGIN wal_plugin AT cron '* * * * *'
// after
CREATE TRIGGER "wal_trig" ON db PROCESSING ENGINE PLUGIN wal_plugin FOREACH ROW
Defensive patterns

Strategy: validation

Validate before calling

// Validate spec/plugin pairing before CREATE TRIGGER
if matches!(spec, TriggerSpecificationDefinition::Schedule{..} | TriggerSpecificationDefinition::Every{..})
    && plugin_type.requires_wal_trigger() {
    return Err(anyhow!("WAL plugins require a WAL trigger specification"));
}

Prevention

When it happens

Trigger: Executing a WAL-type trigger (`execute_wal_once`) whose trigger specification was created as `Schedule { schedule }` — e.g. a trigger created with `AT cron '...'` but bound to a WAL plugin type.

Common situations: Creating a trigger with the wrong trigger specification: cron schedule paired with a single-table-WAL plugin; catalog corrupted by manual edits or a bug allowing incompatible spec/plugin combinations.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

Thrown at influxdb3_processing_engine/src/worker/local.rs:567

    }

    /// Get the table filter for WAL flush triggers.
    ///
    /// Returns `Ok(None)` for all-tables triggers, `Ok(Some(table_id))` for single-table triggers,
    /// or an error if the trigger specification is not valid for WAL flush (e.g., scheduled triggers).
    fn make_wal_table_filter(
        &self,
        schema: &influxdb3_catalog::catalog::DatabaseSchema,
    ) -> Result<Option<influxdb3_id::TableId>, PluginError> {
        match &self.trigger_definition.trigger {
            TriggerSpecificationDefinition::AllTablesWalWrite => Ok(None),
            TriggerSpecificationDefinition::SingleTableWalWrite { table_name } => {
                let table_id = schema
                    .table_name_to_id(table_name)
                    .context("table not found")?;
                Ok(Some(table_id))
            }
            TriggerSpecificationDefinition::Schedule { schedule } => Err(anyhow!(
                "unexpectedly found scheduled trigger specification cron:{} for WAL plugin {}",
                schedule,
                self.trigger_definition.trigger_name
            )
            .into()),
            TriggerSpecificationDefinition::Every { duration } => Err(anyhow!(
                "unexpectedly found every trigger specification every:{} for WAL plugin {}",
                format_duration(*duration),
                self.trigger_definition.trigger_name
            )
            .into()),
            TriggerSpecificationDefinition::RequestPath { path } => Err(anyhow!(
                "unexpectedly found request path trigger specification {} for WAL plugin {}",
                path,
                self.trigger_definition.trigger_name
            )
            .into()),
        }

View on GitHub (pinned to 06200ef96b)