hoptical / grafana-kafka-datasource

A Grafana datasource plugin for Apache Kafka
Apache License 2.0
35 stars 13 forks source link

[BUG] Plugin Unavailable #45

Open daya-kulkarni opened 1 year ago

daya-kulkarni commented 1 year ago

Describe the bug I am trying to use the backend plugin on version 9.3.4 and 9.4.2. In both cases I am getting an error that says that plugin in availble when i try to create and save the new datasource. I have installed the plugin two ways one one grafana version i have installed the folder way (manually) in the plugins dir and the other version via the grafana-cli command. Both show the datasource as an option but dont let me actually use it as I see the error below (in screenshot).

To Reproduce Steps to reproduce the behavior:

  1. Go to Setting
  2. Click on datasources
  3. Click on add new datasource button
  4. Search/filter for Kafka and click on datasource
  5. Add server (broker --> localhost:9092)
  6. Click save and test
  7. See error

Expected behavior We should see the plugin be available and say datasouce added (green message)

Screenshots image Desktop Information:

Addtional Context Do I need certain permissions that the server runs at?

ustbly commented 1 year ago

I use Grafana that version is 9.4.3,the same error also appears,that sucks!

tanis2000 commented 1 year ago

This is also happening when running grafana from a docker image. Any clue about what the root cause might be?

jessechencx commented 1 year ago

Anyone have resolved the problem?

tanis2000 commented 1 year ago

I found out what the issue is. At least in my case. It looks like the Grafana docker image is built for arm64 (I am running it on an Apple Silicon chip) but the plugin is only amd64, which means that it will fail badly.

One workaround is to force the Grafana instance to run with the amd64 image. It will be slower but it will work.

My compose file looks like the following:

version: '2'
services:
  grafana:
    image: 'grafana/grafana-oss:latest'
    ports:
      - '3000:3000'
    environment:
      - GF_INSTALL_PLUGINS=hamedkarbasi93-kafka-datasource
    platform: 'linux/amd64'
0BVer commented 1 year ago

I think it cause of this

lvl=eror msg="Failed to start plugin" logger=plugins.backend pluginId=hamedkarbasi93-kafka-datasource error="fork/exec /var/lib/grafana/plugins/hamedkarbasi93-kafka-datasource/gpx_kafka-datasource_linux_arm64: no such file or directory"

but in my plugins dir it was gpx_kafka-datasource_linux_amd64

it need arm64 cause of running on apple silicon but this plugin didn`t available on arm64 just amd64 so we have to change our docker platform like @tanis2000 's saying (on my above) and it was good solutions

caolizhi commented 1 year ago

same error,any clues to fix it ?

Grafana version: Grafana v10.0.3 (eb8dd72637) OS version: WSL (Ubuntu-18.04)

image

error log:

ERROR[08-16|10:00:06] Plugin unavailable      logger=context userId=1 orgId=1 uname=admin error="plugin unavailable" remote_addr=[::1] traceID=
ERROR[08-16|10:00:06] Request Completed       logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/uid/de842521-1119-4baa-9537-743196b59b83/health status=503 remote_addr=[::1] time_ms=0 duration=611.497µs size=45 referer=http://localhost:3000/datasources/edit/de842521-1119-4baa-9537-743196b59b83 handler=/api/datasources/uid/:uid/health
sergiotravassos commented 9 months ago

I tried to force the platform as stated but the problem still persists. I also tried installing both versions OSS and Enterprise on my local machine to verify that it wasn't somenthing from docker, but always the same problem.

I found out what the issue is. At least in my case. It looks like the Grafana docker image is built for arm64 (I am running it on an Apple Silicon chip) but the plugin is only amd64, which means that it will fail badly.

One workaround is to force the Grafana instance to run with the amd64 image. It will be slower but it will work.

My compose file looks like the following:

version: '2'
services:
  grafana:
    image: 'grafana/grafana-oss:latest'
    ports:
      - '3000:3000'
    environment:
      - GF_INSTALL_PLUGINS=hamedkarbasi93-kafka-datasource
    platform: 'linux/amd64'

image

Error log

poc-grafana-grafana-1  | logger=http.server t=2023-12-13T17:41:07.995532093Z level=error msg="Failed to parse user ID" error="identifier is not initialized"
poc-grafana-grafana-1  | logger=plugin.hamedkarbasi93-kafka-datasource t=2023-12-13T17:46:01.646671212Z level=info msg="CheckHealth called" request="map[PluginContext:map[AppInstanceSettings:<nil> DataSourceInstanceSettings:map[BasicAuthEnabled:false BasicAuthUser: Database: DecryptedSecureJSONData:<nil> ID:1 JSONData:map[bootstrapServers:localhost:9094] Name:Kafka-Broker UID:dd866e42-dd74-4acd-b0d8-a7a5e2841aff URL: Updated:2023-12-13T17:46:01Z User:] OrgID:1 PluginID:hamedkarbasi93-kafka-datasource User:map[Email:admin@localhost Login:admin Name:admin Role:Admin]]]"
poc-grafana-grafana-1  | logger=context userId=1 orgId=1 uname=admin t=2023-12-13T17:46:01.85672401Z level=info msg="Request Completed" method=GET path=/api/datasources/uid/dd866e42-dd74-4acd-b0d8-a7a5e2841aff/health status=400 remote_addr=172.23.0.1 time_ms=221 duration=221.316205ms size=61 referer=http://localhost:3000/connections/datasources/edit/dd866e42-dd74-4acd-b0d8-a7a5e2841aff handler=/api/datasources/uid/:uid/health
peipei30 commented 8 months ago

I ran the arch command and gotx86_64, but I still can't use the plugins.

jpbourke commented 7 months ago

Hi

It looks like this project is not being maintaned any more. I was looking at putting some time into fixing the bugs and adding some more features. Would anyone support this by helping with testing ?

Thansk

john

gaohan0524 commented 2 months ago

[root@bigdata114 hamedkarbasi93-kafka-datasource]# ./gpx_kafka-datasource_linux_amd64 ./gpx_kafka-datasource_linux_amd64: /lib64/libm.so.6: version GLIBC_2.29' not found (required by ./gpx_kafka-datasource_linux_amd64) ./gpx_kafka-datasource_linux_amd64: /lib64/libc.so.6: versionGLIBC_2.25' not found (required by ./gpx_kafka-datasource_linux_amd64) You have mail in /var/spool/mail/root [root@bigdata114 hamedkarbasi93-kafka-datasource]# ldd --version ldd (GNU libc) 2.17

my glibc version not high enough

royborgen commented 1 week ago

[root@bigdata114 hamedkarbasi93-kafka-datasource]# ./gpx_kafka-datasource_linux_amd64 ./gpx_kafka-datasource_linux_amd64: /lib64/libm.so.6: version GLIBC_2.29' not found (required by ./gpx_kafka-datasource_linux_amd64) ./gpx_kafka-datasource_linux_amd64: /lib64/libc.so.6: versionGLIBC_2.25' not found (required by ./gpx_kafka-datasource_linux_amd64) You have mail in /var/spool/mail/root [root@bigdata114 hamedkarbasi93-kafka-datasource]# ldd --version ldd (GNU libc) 2.17

my glibc version not high enough

I see the same on RHEL 8