{"record":{"id":"9fd4469facd18c62","repo":"influxdata/influxdb","slug":"shouldn-t-have-table-trigger-for-scheduled-plugin","errorCode":null,"errorMessage":"shouldn't have table trigger for scheduled plugin","messagePattern":"shouldn't have table trigger for scheduled plugin","errorType":"validation","errorClass":"PluginError","httpStatus":null,"severity":"error","filePath":"influxdb3_processing_engine/src/plugins.rs","lineNumber":172,"sourceCode":"enum Schedule {\n    Cron(Box<OwnedScheduleIterator<Utc>>),\n    Every(Duration),\n}\n\nstruct ScheduleTriggerRunner {\n    schedule: Schedule,\n    next_trigger_time: Option<DateTime<Utc>>,\n}\n\nimpl ScheduleTriggerRunner {\n    fn try_new(\n        trigger_spec: &TriggerSpecificationDefinition,\n        time_provider: Arc<dyn TimeProvider>,\n    ) -> Result<Self, PluginError> {\n        match trigger_spec {\n            TriggerSpecificationDefinition::AllTablesWalWrite\n            | TriggerSpecificationDefinition::SingleTableWalWrite { .. } => {\n                Err(anyhow!(\"shouldn't have table trigger for scheduled plugin\").into())\n            }\n            TriggerSpecificationDefinition::RequestPath { .. } => {\n                Err(anyhow!(\"shouldn't have request path trigger for scheduled plugin\").into())\n            }\n            TriggerSpecificationDefinition::Schedule { schedule } => {\n                let schedule = CronSchedule::from_str(schedule.as_str())\n                    .context(\"cron schedule should be parsable\")?;\n                Ok(Self::new_cron(schedule, time_provider))\n            }\n            TriggerSpecificationDefinition::Every { duration } => {\n                // check that duration isn't longer than a year, so we avoid overflows.\n                if *duration > parse_duration(\"1 year\").unwrap() {\n                    return Err(anyhow!(\"schedule duration cannot be greater than 1 year\").into());\n                }\n                Ok(Self::new_every(\n                    Duration::from_std(*duration)\n                        .context(\"should be able to convert durations. \")?,\n                    time_provider,","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_processing_engine/src/plugins.rs#L154-L190","documentation":"Raised by ScheduleRunner::try_new when a scheduled plugin is constructed with a table-based trigger specification (AllTablesWalWrite or SingleTableWalWrite). Scheduled plugins run on cron schedules, not on WAL write events, so the library rejects the combination.","triggerScenarios":"Calling try_new (plugin trigger setup) with a plugin defined as scheduled and a trigger spec of table/WAL-write kind.","commonSituations":"Admin writes CREATE TRIGGER ... ON TABLE x (or ALL TABLES) for a plugin that only supports SCHEDULE; UI/CLI mixing trigger types.","solutions":["Use TriggerSpecificationDefinition::Schedule with a valid cron string for this plugin.","In SQL, use the SCHEDULE clause instead of table triggers: CREATE TRIGGER ... AT ... SCHEDULE '...'.","Alternatively use a WAL-trigger-compatible plugin if per-write execution is desired."],"exampleFix":"// before\nCREATE TRIGGER \"t\" ON TABLE cpu AFTER INSERT ...  // for a scheduled plugin\n// after\nCREATE TRIGGER \"t\" ... SCHEDULE '*/5 * * * *'","handlingStrategy":"validation","validationCode":"fn valid_spec_for_scheduled_plugin(spec: &TriggerSpecificationDefinition) -> bool {\n    matches!(spec, TriggerSpecificationDefinition::Schedule { .. })\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use Schedule specs with scheduled plugins.","Validate trigger spec kind against plugin kind in tooling before issuing CREATE TRIGGER.","Use WAL-table plugins when per-write triggers are needed."],"tags":["trigger","scheduling","invalid-argument"],"backgroundTag":"conflicting-config-options","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}