Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Invalid regular expression: invalid group specifier name #393

Closed
JorritSalverda opened this issue Jan 8, 2022 · 7 comments
Closed

Invalid regular expression: invalid group specifier name #393

JorritSalverda opened this issue Jan 8, 2022 · 7 comments

Comments

@JorritSalverda
Copy link
Contributor

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:
    - name: Google BigQuery
      type: doitintl-bigquery-datasource
      access: proxy
      isDefault: true
      jsonData:
        authenticationType: jwt
        clientEmail: ***
        defaultProject: ***
        tokenUri: https://oauth2.googleapis.com/token
        processingLocation: EU
      secureJsonData:
        privateKey: |
          -----BEGIN PRIVATE KEY-----
          ***
          -----END PRIVATE KEY-----
    version: 2
    readOnly: false
  1. Go to the Grafana instance in the browser and navigate to the Bigquery Datasource

Specifications

  • Version: 2.0.3
  • Platform: docker image grafana/grafana:8.3.3
  • Grafana Version: v8.3.3 (30bb7a93ca)
@JorritSalverda
Copy link
Contributor Author

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 b5f2daf. @ofir5300 can you take a look and figure out how to rewrite this into a regular expression that is supported by Safari?

@JorritSalverda
Copy link
Contributor Author

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

@ofir5300
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

ofir5300 commented Feb 3, 2022

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

@giovannirco
Copy link

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
Copy link
Collaborator

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants