{"record":{"id":"8ae8edb40d4734ed","repo":"influxdata/influxdb","slug":"the-process-writes-function-is-not-present-in-the-plugin","errorCode":null,"errorMessage":"the process_writes function is not present in the plugin. Should be defined as: process_writes(influxdb3_local, table_batches, args=None)","messagePattern":"the process_writes function is not present in the plugin\\. Should be defined as: process_writes\\(influxdb3_local, table_batches, args=None\\)","errorType":"exception","errorClass":"ExecutePluginError","httpStatus":null,"severity":"error","filePath":"influxdb3_py_api/src/error.rs","lineNumber":5,"sourceCode":"use thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum ExecutePluginError {\n    #[error(\n        \"the process_writes function is not present in the plugin. Should be defined as: process_writes(influxdb3_local, table_batches, args=None)\"\n    )]\n    MissingProcessWritesFunction,\n\n    #[error(\n        \"the process_request function is not present in the plugin. Should be defined as: process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None) -> Tuple[str, Optional[Dict[str, str]]]\"\n    )]\n    MissingProcessRequestFunction,\n\n    #[error(\n        \"the process_scheduled_call function is not present in the plugin. Should be defined as: process_scheduled_call(influxdb3_local, call_time, args=None)\"\n    )]\n    MissingProcessScheduledCallFunction,\n\n    #[error(\"{0}\")]\n    PluginError(#[from] anyhow::Error),\n}\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_py_api/src/error.rs#L1-L23","documentation":"The Python plugin host looks up a function named process_writes on the loaded plugin module when executing a write trigger. This ExecutePluginError is raised when the module exists but does not define process_writes. Each trigger kind expects a specific entry-point function; a write trigger requires process_writes(influxdb3_local, table_batches, args=None).","triggerScenarios":"Registering/invoking a plugin file as a WAL write trigger when the Python module lacks a top-level process_writes function — e.g. the file only defines process_request or process_scheduled_call, or the function is misspelled/nested inside a class.","commonSituations":"Reusing one plugin file across different trigger types; typos like process_write or processWrites; function defined with wrong name or indented inside another scope; refactoring renamed the entry point.","solutions":["Add the required entry point to the plugin module: def process_writes(influxdb3_local, table_batches, args=None): ...","Check spelling and ensure it is a module-level function, not nested in a class or another function.","If this file is meant for HTTP triggers, create it with the correct entry point (process_request) or use separate files per trigger type.","Redeploy/reload the plugin after adding the function."],"exampleFix":"# before\ndef process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None):\n    ...\n# after\ndef process_writes(influxdb3_local, table_batches, args=None):\n    for batch in table_batches:\n        ...\n\ndef process_request(influxdb3_local, query_parameters, request_headers, request_body, args=None):\n    ...","handlingStrategy":"validation","validationCode":"import inspect\ndef has_process_writes(module) -> bool:\n    fn = getattr(module, \"process_writes\", None)\n    return callable(fn) and len(inspect.signature(fn).parameters) >= 2","typeGuard":"def has_process_writes(mod) -> bool:\n    return callable(getattr(mod, \"process_writes\", None))","tryCatchPattern":"try:\n    run_plugin(path)\nexcept ExecutePluginError as e:\n    if \"process_writes\" in str(e):\n        log.error(f\"plugin {path} missing process_writes entry point\")","preventionTips":["Use one plugin file per trigger type","Keep entry-point function names exactly: process_writes, process_request, process_scheduled_call","Define entry points at module top level, never nested in classes","Add a smoke test that imports each plugin and checks the expected entry point exists"],"tags":["python","plugin","processing-engine","missing-function"],"backgroundTag":"missing-required-argument","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"}