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

Specific plugin error message is not propagated to the client #34

Closed
grinapo opened this issue Jun 26, 2024 · 13 comments
Closed

Specific plugin error message is not propagated to the client #34

grinapo opened this issue Jun 26, 2024 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@grinapo
Copy link

grinapo commented Jun 26, 2024

While testing #22 I created some not quite valid queries it seems, which is fine (or at least I believe that at this point :-)).
However all I got was a generic "500 An error occurred within the plugin".

Checking the grafana logs I see the real message there:

logger=context userId=2 orgId=1 uname=grin t=2024-06-26T15:46:57.572889164+02:00 level=error msg="Internal server error" error="[plugin.downstreamError] client: failed to query data: Failed to query data: rpc error: code = Unknown desc = frame has different field lengths, field 0 is len 360 but field 1 is len 0" remote_addr=xyz traceID=

I am not sure that it's possible to forward the specific message to the client (most plugins do that), but if it is, it would be extremely useful.

ps: "severity:info | stats by (_time:1m) count() logs"

@dmitryk-dk
Copy link
Contributor

Hi @grinapo ! Could you please try to upgrade the plugin to the latest release and be sure that the backend part or Grafana was restarted.? Why I am asking - this issue was fixed in the newest release, and I have checked your query on my local and our prod end, and it works well; just shows me no data message. But do not return any error.

@crocchietta
Copy link

crocchietta commented Jun 26, 2024

I have version 0.2.2 (yesterday) installed.
severity:info | stats by (_time:1m) count() logs also doesn't generate an error. But if there is a result, it generates the following error:
logger=context userId=1 orgId=1 uname=admin_grafana t=2024-06-26T16:17:34.641025924+02:00 level=error msg="Internal server error" error="[plugin.downstreamError] client: failed to query data: Failed to query data: rpc error: code = Unknown desc = frame has different field lengths, field 0 is len 15 but field 1 is len 0" remote_addr=w.x.y.z traceID=

query in victorialogs vmui :
_stream:{job="fail2ban_log"} service:spb | stats by (_time:1m) count() logs

[
  {
    "_time": "2024-06-26T14:11:00Z",
    "logs": "2"
  },
  {
    "_time": "2024-06-26T14:17:00Z",
    "logs": "1"
  }
]

@dmitryk-dk dmitryk-dk self-assigned this Jun 26, 2024
@dmitryk-dk dmitryk-dk added the bug Something isn't working label Jun 26, 2024
@dmitryk-dk
Copy link
Contributor

@grinapo , @crocchietta ! Thank you for the provided information. I found the reason and prepared the fix. Need to test it a little bit

@crocchietta
Copy link

When is the next release with this fix planned?

@dmitryk-dk
Copy link
Contributor

When is the next release with this fix planned?

Maybe i will do it today

@crocchietta
Copy link

Thanks.

@crocchietta
Copy link

crocchietta commented Jun 28, 2024

I just tried the fix and there are no more errors.

On the other hand, I can't use the result of the query with time series visualization. I get a "Data is missing a number field".
Here is the result of the query:

2024-06-28 09:50:00.000	{"logs":"2"}
2024-06-28 07:32:00.000	{"logs":"1"}
2024-06-28 07:35:00.000	{"logs":"2"}
2024-06-28 08:04:00.000	{"logs":"1"}
2024-06-28 08:35:00.000	{"logs":"2"}

But maybe it's not possible to do that ?

@dmitryk-dk
Copy link
Contributor

Hi @grinapo , @crocchietta ! Here is the release. Could you check it, please? If it works correctly, can you close the issue?

@crocchietta
Copy link

It's ok for me.

@dmitryk-dk : Is it possible to use the result of a query for serial times (as with Loki) or is it only planned for later?

@grinapo
Copy link
Author

grinapo commented Jun 28, 2024

@dmitryk-dk this issue seems to have been taken over by the evil stream field id problem (which indeed have been fixed), but the original issue was more generic: the plugin shall hand over to grafana the specific error message, and not just "got unexpected response status code: 400".

(to test: foo | stats evilverb (_time:1m) count() - should tell me where and what the error was.)

@dmitryk-dk
Copy link
Contributor

Hi @grinapo , @crocchietta ! We can close this issue related to the described problem. And you can open new ones with improvements to the errors. If this works for you, I would appreciate a new issue from your side, and I'll close this one.

Thank you:)

@crocchietta
Copy link

it's ok for me.

@dmitryk-dk
Copy link
Contributor

Close as solved. Open new issue related error improvements, please. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants