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

Grafana - Cannot read properties of undefined (reading 'digest') #282

Closed
skycannavod opened this issue Oct 12, 2023 · 11 comments
Closed

Grafana - Cannot read properties of undefined (reading 'digest') #282

skycannavod opened this issue Oct 12, 2023 · 11 comments
Labels
datasource/OpenSearch type/bug Something isn't working

Comments

@skycannavod
Copy link

ezgif-4-b007e6297a

What happened: hi, we are trying to view the metrics of the opensearch version on grafana using the opensearch datasource, but the following error is returned once the dashboard is created: Cannot read properties of undefined (reading 'digest')

What you expected to happen: we expect the data to appear

How to reproduce it (as minimally and precisely as possible): have grafana version 10.1.2, opensearch version 2.9 (Service software version: OpenSearch_2_9_R20230926), OpenSearch plugin version 2.13.0 and try to make a dashboard with opensearch datasource

Anything else we need to know?:

Environment:

  • Grafana version: 10.1.2
  • OpenSearch version: 2.9
  • Plugin version: 2.13.0
@iwysiu
Copy link
Contributor

iwysiu commented Oct 17, 2023

Hi @skycannavod ! I haven’t been able to reproduce the issue yet, but I have a few questions:

  • What response are you getting from Opensearch for the query? (Please redact any sensitive information, but is it returning an error, what’s the structure of the response, and what headers is it getting?)
  • What auth options are you using for your OpenSearch datasource?

@iwysiu iwysiu moved this from Incoming to Waiting in AWS Datasources Oct 17, 2023
@skycannavod
Copy link
Author

grafana gives me the error: "Cannot read properties of undefined (reading 'digest')", if I try to execute the query on "Query Inspector" it remains in a loop

as regards the auth we use the SigV4 auth AWS SDK Default, once the auth and the index pattern have been set, it takes everything correctly, but when I try to view the data on the dashboard it gives me the error explained above

@iwysiu iwysiu moved this from Waiting to Incoming in AWS Datasources Oct 19, 2023
@iwysiu
Copy link
Contributor

iwysiu commented Oct 20, 2023

Hi @skycannavod ! I took another look at this, and the crypto interface that we're using to generate the SigV4 signatures requires that it's run in a secure context. Are you running Grafana in a secure context?

@iwysiu iwysiu moved this from Incoming to Waiting in AWS Datasources Oct 20, 2023
@skycannavod
Copy link
Author

skycannavod commented Oct 23, 2023

our grafana is on http, opensearch in https
ps. with the elasticsearch datasource it work but it give us the following message: "Support for Elasticsearch versions after their end-of-life (currently versions < 7.16) was removed. Using unsupported version of Elasticsearch may lead to unexpected and incorrect results."

with opensearch plugin, the version is:
image

(I don't know if it can be useful)

@iwysiu iwysiu moved this from Waiting to Incoming in AWS Datasources Oct 23, 2023
@fridgepoet
Copy link
Member

Hi @skycannavod I have set up the following locally according to your notes:

  • grafana version 10.1.2
  • opensearch version 2.9 (Service software version: OpenSearch_2_9_R20230926)
  • OpenSearch plugin version 2.13.0
  • SigV4 auth AWS SDK Default
  • our grafana is on http, opensearch in https (I am building and running grafana on localhost, opensearch hosted on AWS)

Finally, the fact that you have this "wrong" ElasticSearch 7.10.2 version sounds like this issue so maybe you have compatibility mode on. I also created a datasource with compatibility enabled which gives me a similar version in the OpenSearch plugin. I went to the Dashboard as in your gif and was unable to reproduce your issue.

Here's what I have set up, can you let me know if it's the same as your setup? Also let me know if any of the above differs from your setup.

Screenshot 2023-10-26 at 18 14 31

@fridgepoet fridgepoet moved this from Incoming to Waiting in AWS Datasources Oct 26, 2023
@skycannavod
Copy link
Author

Hi, yes the configuration is the same, with compatibility mode on

@fridgepoet fridgepoet moved this from Waiting to Incoming in AWS Datasources Oct 27, 2023
@fridgepoet
Copy link
Member

Thanks for the info.

I spoke to @sarahzinger about this, and looping back to our grafana is on http, opensearch in https, this may be an issue as @iwysiu mentioned above. In my case using localhost is considered secure, but if you are elsewhere this may not be sufficient. You might need to either run Grafana locally or run it somewhere with https.

It may be that our refactor which is still in progress will resolve this issue for you because it will no longer depend on your browser's context security. This work is done for some queries and not for others. As a test, would you be able to run a "Raw Data" query and tell us if you still observe the error?
Screenshot 2023-10-27 at 14 41 47

@fridgepoet fridgepoet moved this from Incoming to Waiting in AWS Datasources Oct 27, 2023
@skycannavod
Copy link
Author

with Raw Data i see the data!

@fridgepoet
Copy link
Member

fridgepoet commented Oct 30, 2023

Thanks for checking that!

Once this refactor is done, you should be able to see data with your current setup.

Right now you need to either run Grafana locally or run it somewhere with https.

@idastambuk
Copy link
Contributor

Hi @skycannavod can you confirm that this is fixed in the latest version of the plugin? Thanks!

@skycannavod
Copy link
Author

Hi @idastambuk, i confirm that it works
Thanks!

@idastambuk idastambuk moved this from Waiting to Done in AWS Datasources Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/OpenSearch type/bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants