doitintl / bigquery-grafana

Google BigQuery Datasource Plugin for Grafana. (NO LONGER MAINTAINED)
https://www.doit-intl.com/labs/
MIT License
242 stars 76 forks source link

Invalid regular expression: invalid group specifier name #393

Closed JorritSalverda closed 2 years ago

JorritSalverda commented 2 years ago

Bug Report

On Chrome on ios - using Safari below the hood - I get the following error when loading the data source on a dashboard or navigating to the Google BigQuery data source in the data sources section of my Grafana setup:

Invalid regular expression: invalid group specifier name
Instantiating https://***/public/plugins/doitintl-bigquery-datasource/module.js
Loading plugins/doitintl-bigquery-datasource/module

This seems to be related to Safari not supporting lookbehind in regular expressions, see https://stackoverflow.com/questions/51568821/works-in-chrome-but-breaks-in-safari-invalid-regular-expression-invalid-group

Expected Behavior

On Chrome on Mac it works as expected. I'm using plugin version 2.0.3 straight from the Grafana plugins section. Using it with Grafana v8.3.3.

Actual Behavior

Returns the error document above and doesn't render any dashboard using the data source.

Steps to Reproduce the Problem

  1. Install Grafana with Helm chart version 6.20.4 and
    
    plugins:
    - doitintl-bigquery-datasource

datasources: datasources.yaml: apiVersion: 1 datasources:

Specifications

JorritSalverda commented 2 years ago

I see a negative lookbehind is used at https://github.com/doitintl/bigquery-grafana/blob/master/src/bigquery_query.ts#L389. Perhaps this can be rewritten so it no longer depends on a lookbehind and hence is supported by Safari.

This wasn't an issue before, I see this has been added in commit https://github.com/doitintl/bigquery-grafana/commit/b5f2daf315a4b01f27a307fa9ce2e4e754ae0833. @ofir5300 can you take a look and figure out how to rewrite this into a regular expression that is supported by Safari?

JorritSalverda commented 2 years ago

Just downgraded to version 2.0.2 which doesn't have the issue indeed.

ofir5300 commented 2 years ago

Hi @JorritSalverda, the issue is most likely the regex not supported by Safari like you said. Ill handle it to be supported by all browsers, tnx for the catch.

giovannirco commented 2 years ago

Is there plans to release a new version with the fix shortly? I am trying to decide if I downgrade or wait for a new version and advise coworkers to use Grafana on chrome in the meantime

ofir5300 commented 2 years ago

Well version 2.0.3 was just approved recently, so I can't in that time share time estimation for the next release..

giovannirco commented 2 years ago

Thanks for replying back!! I will downgrade the version of the plugin for now and keep an eye for the new version release. Have a good day/night

ofir5300 commented 2 years ago

We are retiring the DoiT International BigQuery DataSource plugin for Grafana. We recommend that you migrate to the official Google BigQuery data source maintained by Grafana. In August 2022, we will cease all development and archive the GitHub project.

We are sorry for any inconvenience.