Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickhouse Alert Throwing Error - request handler error: plugin unavailable #356

Closed
gsingh14 opened this issue Jul 13, 2021 · 8 comments
Closed
Assignees
Milestone

Comments

@gsingh14
Copy link

Setup
Grafana : Grafana v8.1.0-pre (unknown-dev)
Clickhouse plugin : 2.3.1

Steps

  1. Using Docker to build grafana image
  2. In Dockerfile add command to copy vertamedia-clickhouse-datasource folder to var/lib/grafana/plugins
  3. Build Docker image
  4. Start Docker Container
  5. Setup email alert config
  6. Create a sample dashboard connecting to clickhouse instance
  7. Use the following sample query in dashboard query section
SELECT
    $timeSeries as t,
    count()
FROM $table

WHERE $timeFilter

GROUP BY t

ORDER BY t
  1. Update the Alert Tab with sample values to fire an alert
    image
  2. Click on Test Rule and the following error pop up
    image

Can someone help with this issue?

@Slach
Copy link
Collaborator

Slach commented Jul 14, 2021

could you open "plugins" in UI and check clickhouse plugin is "signed"?

image
image

@gsingh14
Copy link
Author

Hi @Slach . Thanks for your reply. The plugin is signed per the following screenshot

image

@Slach
Copy link
Collaborator

Slach commented Jul 14, 2021

could you add to your Dockerfile ENV GF_LOG_LEVEL=debug
and share logs of your custom grafana container?

@gsingh14
Copy link
Author

Following is the debug log when i create an alert and click on Test Rule.

t=2021-07-14T17:06:43+0000 lvl=dbug msg="Scheduling update" logger=alerting.scheduler ruleCount=0
t=2021-07-14T17:06:44+0000 lvl=dbug msg="Querying for data source via SQL store" logger=datasources id=1 orgId=1
t=2021-07-14T17:06:44+0000 lvl=dbug msg="Applying default URL parsing for this data source type" logger=datasource type=vertamedia-clickhouse-datasource url=https://CH_URL:9443
t=2021-07-14T17:06:53+0000 lvl=dbug msg="Scheduling update" logger=alerting.scheduler ruleCount=0
t=2021-07-14T17:06:55+0000 lvl=dbug msg="Extracted alerts from dashboard" logger=alerting.extractor alertCount=1
t=2021-07-14T17:06:55+0000 lvl=eror msg="Alert Rule Result Error" logger=alerting.evalContext ruleId=0 name="Panel Title alert" error="request handler error: plugin unavailable" changing state to=alerting
t=2021-07-14T17:07:03+0000 lvl=dbug msg="Scheduling update" logger=alerting.scheduler ruleCount=0
t=2021-07-14T17:07:13+0000 lvl=dbug msg="Scheduling update" logger=alerting.scheduler ruleCount=0

Note : I have replaced my internal CH instance url with CH_URL here for security purposes.

@Slach
Copy link
Collaborator

Slach commented Jul 15, 2021

@gsingh14 thanks a lot for reporting I will try to reproduce, and tix it ASAP

@Slach Slach self-assigned this Jul 15, 2021
@zweite
Copy link

zweite commented Aug 26, 2021

This problem can be solved by using a Grafana image packaged with Dockerfile.ubuntu

@gsingh14
Copy link
Author

Thanks @zweite . I was able to get past the error but now getting @Slach

x509: certificate signed by unknown authority A <nil> []
since my Clickhouse instance is on https.

Would you know where i can install the cert to make it work. I have provided the cert file in Datasource and Grafana is able to make the connection.

Only when i trigger the alert, I'm getting the above error.

@Slach
Copy link
Collaborator

Slach commented Nov 15, 2021

Unfortunately, currently it's not easy to provide custom certificate authority in SSL certs inside grafana, both on frontend and on backend side.

@Slach Slach added this to the 2.4.0 milestone Nov 18, 2021
@Slach Slach closed this as completed in 84003bd Nov 29, 2021
Slach added a commit to Altinity/grafana-plugin-repository that referenced this issue Nov 29, 2021
# 2.4.0 (2021-11-29)

## Enhancement:
* Add support for Grafana 8.x unified alerts, fix Altinity/clickhouse-grafana#380
* Add TLS support for backend alerts part of plugin Altinity/clickhouse-grafana#356 (comment)
* Add $naturalTimeSeries macro, look details in https://github.com/Vertamedia/clickhouse-grafana/pull/89/files#diff-cd9133eda7b58ef9c9264190db4534a1be53216edbda9ac57256fbd800368c03R383-R412
* Update golang-plugin-sdk-go to latest version
* Properly format Value in Table format, look details Altinity/clickhouse-grafana#379
* Remove toDateTime64 casting for column when time column is already DateTime64 to improve performance. Change test to ensure the casting is removed from the query, fix Altinity/clickhouse-grafana#360
* implements `$timeFilter64ByColumn(column_name)` macro, fix Altinity/clickhouse-grafana#343

## Fixes:

* implements properly GET and POST support for alert queries, fix Altinity/clickhouse-grafana#353
* SQL syntax highlight now works always, fix Altinity/clickhouse-grafana#174, fix Altinity/clickhouse-grafana#381
* fix Altinity/clickhouse-grafana#376,
* fix negative behavior for $perSecondColumns Altinity/clickhouse-grafana#337
* fix Altinity/clickhouse-grafana#374, ignore `--` inside quotas as comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants