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

Backend error: frame has different field lengths #45

Closed
clrxbl opened this issue Jul 10, 2024 · 12 comments
Closed

Backend error: frame has different field lengths #45

clrxbl opened this issue Jul 10, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@clrxbl
Copy link

clrxbl commented Jul 10, 2024

Slack convo: https://victoriametrics.slack.com/archives/CGZF1H6L9/p1720523316896539?thread_ts=1720475100.442039&cid=CGZF1H6L9

I'm trying to visualize a query using a timeseries panel. The following query works to get me the following output:
image

kubernetes_labels.app.kubernetes.io/name:matchmaker AND kubernetes_namespace_name:$namespace AND "Match found" | stats count() AS count

But to visualize it in Grafana I need a query value that is just a number so I add | format '<count>' to the query. This breaks things however and returns the following error

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 2 but field 2 is len 1"
@hagen1778 hagen1778 added the bug Something isn't working label Jul 11, 2024
@hagen1778 hagen1778 changed the title Internal server error Backend error: frame has different field lengths Jul 11, 2024
@dmitryk-dk dmitryk-dk self-assigned this Jul 11, 2024
@dmitryk-dk
Copy link
Contributor

Hi @clrxbl ! Can you share the response from the VictoriaLogs if you execute this query via API?

@clrxbl
Copy link
Author

clrxbl commented Jul 11, 2024

Hi @clrxbl ! Can you share the response from the VictoriaLogs if you execute this query via API?

{"count":"507","_msg":"507"}

vmui displays it properly aswell. Grafana however, with the exact same query

CleanShot 2024-07-11 at 15 24 53@2x

@dmitryk-dk
Copy link
Contributor

{"count":"507","_msg":"507"}

Yeah, I found the reason I added tests and will create a PR for that fix.
Thank you for your information. Need to test my solution

@dmitryk-dk
Copy link
Contributor

@clrxbl ! I have created the request. Here is the response from the explorer.
Would it work for you?
Screenshot 2024-07-11 at 15 40 27

@dmitryk-dk
Copy link
Contributor

@clrxbl i have created a PR you can build it from the my latest commit and check

@clrxbl
Copy link
Author

clrxbl commented Jul 11, 2024

@clrxbl i have created a PR you can build it from the my latest commit and check

Does VictoriaLogs publish docker images for PRs? I run VictoriaLogs in Kubernetes, may have to publish my own image if not.

@dmitryk-dk
Copy link
Contributor

@clrxbl i have created a PR you can build it from the my latest commit and check

Does VictoriaLogs publish docker images for PRs? I run VictoriaLogs in Kubernetes, may have to publish my own image if not.

You can use VictoriaLogs with the same version. This data source doesn't provide docker images.
But i think you can provide the commit in the init container as defined in our documentation. But we are using releases

extraInitContainers:
  - name: "load-vm-ds-plugin"
    image: "curlimages/curl:7.85.0"
    command: [ "/bin/sh" ]
    workingDir: "/var/lib/grafana"
    securityContext:
      runAsUser: 472
      runAsNonRoot: true
      runAsGroup: 472
    args:
     - "-c"
     - |
       set -ex
       mkdir -p /var/lib/grafana/plugins/
       ver=$(curl -s https://api.github.com/repos/VictoriaMetrics/victorialogs-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
       curl -L https://github.com/VictoriaMetrics/victorialogs-datasource/releases/download/$ver/victorialogs-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vl-plugin.tar.gz
       tar -xf /var/lib/grafana/plugins/vl-plugin.tar.gz -C /var/lib/grafana/plugins/
       rm /var/lib/grafana/plugins/vl-plugin.tar.gz
    volumeMounts:
      # For grafana-operator users, change `name: storage` to `name: grafana-data`
      - name: storage
        mountPath: /var/lib/grafana

@clrxbl
Copy link
Author

clrxbl commented Jul 11, 2024

@clrxbl i have created a PR you can build it from the my latest commit and check

Does VictoriaLogs publish docker images for PRs? I run VictoriaLogs in Kubernetes, may have to publish my own image if not.

You can use VictoriaLogs with the same version. This data source doesn't provide docker images. But i think you can provide the commit in the init container as defined in our documentation. But we are using releases

extraInitContainers:
  - name: "load-vm-ds-plugin"
    image: "curlimages/curl:7.85.0"
    command: [ "/bin/sh" ]
    workingDir: "/var/lib/grafana"
    securityContext:
      runAsUser: 472
      runAsNonRoot: true
      runAsGroup: 472
    args:
     - "-c"
     - |
       set -ex
       mkdir -p /var/lib/grafana/plugins/
       ver=$(curl -s https://api.github.com/repos/VictoriaMetrics/victorialogs-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
       curl -L https://github.com/VictoriaMetrics/victorialogs-datasource/releases/download/$ver/victorialogs-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vl-plugin.tar.gz
       tar -xf /var/lib/grafana/plugins/vl-plugin.tar.gz -C /var/lib/grafana/plugins/
       rm /var/lib/grafana/plugins/vl-plugin.tar.gz
    volumeMounts:
      # For grafana-operator users, change `name: storage` to `name: grafana-data`
      - name: storage
        mountPath: /var/lib/grafana

Oh sorry, I got mixed up and thought this was the VictoriaLogs repo and not the datasource. Will test in a bit!

@dmitryk-dk
Copy link
Contributor

@clrxbl i have created a PR you can build it from the my latest commit and check

Does VictoriaLogs publish docker images for PRs? I run VictoriaLogs in Kubernetes, may have to publish my own image if not.

You can use VictoriaLogs with the same version. This data source doesn't provide docker images. But i think you can provide the commit in the init container as defined in our documentation. But we are using releases

extraInitContainers:
  - name: "load-vm-ds-plugin"
    image: "curlimages/curl:7.85.0"
    command: [ "/bin/sh" ]
    workingDir: "/var/lib/grafana"
    securityContext:
      runAsUser: 472
      runAsNonRoot: true
      runAsGroup: 472
    args:
     - "-c"
     - |
       set -ex
       mkdir -p /var/lib/grafana/plugins/
       ver=$(curl -s https://api.github.com/repos/VictoriaMetrics/victorialogs-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
       curl -L https://github.com/VictoriaMetrics/victorialogs-datasource/releases/download/$ver/victorialogs-datasource-$ver.tar.gz -o /var/lib/grafana/plugins/vl-plugin.tar.gz
       tar -xf /var/lib/grafana/plugins/vl-plugin.tar.gz -C /var/lib/grafana/plugins/
       rm /var/lib/grafana/plugins/vl-plugin.tar.gz
    volumeMounts:
      # For grafana-operator users, change `name: storage` to `name: grafana-data`
      - name: storage
        mountPath: /var/lib/grafana

Oh sorry, I got mixed up and thought this was the VictoriaLogs repo and not the datasource. Will test in a bit!

No VictoriaLogs returns the correct response; the data source had a problem before my fix. There was doubled line fields what was incorrect

@clrxbl
Copy link
Author

clrxbl commented Jul 11, 2024

Tested and all seems to work now

@dmitryk-dk
Copy link
Contributor

Tested and all seems to work now

Thank you! When my PR is merged, we will create a release, and you will be able to update the data source to the latest release

@dmitryk-dk
Copy link
Contributor

Hi @clrxbl ! You can use the new release where fixes were included. Feel free to reopen the issue if you find something wrong.

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