MySQL cannot locate the named JSON filter when creating, altering, or dropping an audit log filter policy.
ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS appears when MySQL cannot find the JSON filter referenced in an audit log policy. Verify the filter exists in mysql.audit_log_filter or recreate it, then retry the statement.
ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS
MySQL raises error 3222 with condition name ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS when a statement refers to a JSON filter that is not present in the mysql.audit_log_filter table.
The error was introduced in MySQL 5.7.22 with the JSON - based audit log filtering framework. It stops CREATE, ALTER, or DROP audit log filter commands that reference a non existent filter name, preventing silent misconfiguration of the audit trail.
The filter name in your SQL statement may be misspelled or use the wrong letter case, so MySQL fails the lookup.
An earlier DROP FILTER command or schema refresh might have removed the filter before this statement executed.
Filters are connection specific in some workflows; running the policy creation in a different session can expose a missing temporary filter.
First query the mysql.audit_log_filter table to confirm the filter record is absent. If missing, recreate it with CREATE AUDIT filter syntax, then rerun your policy statement.
If the filter exists but the name does not match exactly, correct the spelling or quote the identifier.
During deployment automation, scripts sometimes execute DROP IF EXISTS on filters in the wrong order. Ensure the CREATE filter step precedes every policy reference.
When cloning databases, audit_log_filter rows may not be exported. Run mysqldump with --system or manually copy the rows before applying policies.
Version control audit_log_filter definitions alongside schema migrations so filters are always present before policies run.
Use IF NOT EXISTS logic when creating filters, and include automated tests that query mysql.audit_log_filter after migrations.
Error 3219 ER_AUDIT_LOG_FILTER_DOES_NOT_EXIST occurs when the classic XML filter engine cannot locate a filter. The fix is similar: create or rename the filter.
Syntax error 1149 might appear if the JSON definition body is malformed, so validate all JSON with JSON_VALID() before executing CREATE AUDIT.
The named filter never existed or was dropped in an earlier migration.
Case sensitive or misspelled filter names prevent MySQL from matching existing records.
Automation scripts create policies before filters, triggering the lookup failure.
Raised when the XML audit filter engine cannot find a named filter.
Appears if the JSON defining users in a filter policy is not valid.
Thrown when the FILTER clause contains malformed JSON.
You can, but it removes critical security logging. Recreating the filter is safer.
Yes, the name column in mysql.audit_log_filter is case sensitive on most systems.
New filters take effect immediately for new connections; existing sessions keep prior settings.
Galaxy lets you version and share CREATE AUDIT scripts, ensuring filters are created before policies during deployments.