Using a dollar sign in a filter variable value causes "Illegal group reference" error

We have just upgraded to 0.34.3, from 0.31.2, and one of our internal users has come across an issue. They had an existing native SQL question that used a variable field and was working fine prior to the upgrade. However, post-upgrade, the question now breaks on a particular value. The value happens to include a dollar sign ($). They receive an “Illegal group reference” error.

I was able to recreate the error using just the internal metabase datasource, with a simple query:

SELECT *
FROM report_card
WHERE {{name}}

When the name variable is set to a value that contains a $ in it, the same error occurs.

  • Browser version: Chrome Version 80.0.3987.149 (occurs in other browsers such as Firefox 68.5.0esr )
  • OS: client is running Windows10; Metabase is running on RHEL 7 (7.7 (Maipo))
  • Metabase backing DB: issue first found with Oracle 12, but also recreated with MySQL 5.7.23
  • Hosting environment: Docker image running in OpenShift
  • Metabase version: 0.34.3

Steps to recreate “Illegal group reference”:

  1. Navigate to Ask a question
  2. Select Native query
  3. Select Metabase internal database
  4. Enter the following query: SELECT * FROM report_card WHERE {{name}}
  5. In the Variables tab, set the Variable type to Field Filter -> Report card -> Name
  6. Add variable filter of test$
  7. Click play button
  8. Get error

Shoot - just realized I was searching for the wrong error string, and this is a previously reported bug. Here and https://github.com/metabase/metabase/issues/10002

Sorry!

1 Like