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

request failed, status: 401 Unauthorized #1327

Closed
rodrigorega opened this issue Oct 6, 2021 · 6 comments
Closed

request failed, status: 401 Unauthorized #1327

rodrigorega opened this issue Oct 6, 2021 · 6 comments
Labels
Milestone

Comments

@rodrigorega
Copy link

rodrigorega commented Oct 6, 2021

Describe the bug
I updated to Grafana 8.1.6 + grafana-zabbix 4.2.4. After that I am getting the message "request failed, status: 401 Unauthorized" both in the dashboard and in datasource settings.

Expected behavior
Instedad of error "request failed, status: 401 Unauthorized" I expect to get Zabbix alerts in my dashboard and no error in datasource settings when I do "Save & Test".

Screenshots

image

image

Log data
grafana.log:

t=2021-10-06T16:39:58 lvl=eror msg="Error querying Zabbix version" logger=plugins.backend pluginId=alexanderzobnin-zabbix-datasource error="request failed, status: 401 Unauthorized"
t=2021-10-06T16:39:58 lvl=eror msg="Zabbix API request error" logger=plugins.backend pluginId=alexanderzobnin-zabbix-datasource error="request failed, status: 401 Unauthorized"
t=2021-10-06T16:39:58 lvl=eror msg="Request Completed" logger=context userId=3 orgId=1 uname=<REDACTED> method=POST path=/api/datasources/26/resources/zabbix-api status=500 remote_addr=<REDACTED> time_ms=142 size=86 referer=https://<REDACTED>:<REDACTED>/datasources/edit/000000026/

Software versions

Grafana Zabbix Grafana-Zabbix Plugin
8.1.6 4.0.34 4.2.4
@rodrigorega
Copy link
Author

rodrigorega commented Dec 10, 2021

I updated to grafana-8.0.7 and the issue is still present with alexanderzobnin-zabbix-app-4.2.4.

grafana-8.0.7 + alexanderzobnin-zabbix-app-4.1.5 is working correctly.

I am using basic http auth in Zabbix server, could this be related?

@dbuconn
Copy link

dbuconn commented Feb 3, 2022

I think this is basic auth related. I'm also using basic auth. I upgraded to 4.2.4 today and started getting the same error as you. I restored my VM (I hadn't kept track of what version I was on) and 4.1.5 is working again.

So something must have gone awry with basic auth and 4.2.0 onward..

@soymgomez
Copy link

Hi @alexanderzobnin , can you take a look at this issue? It takes a long time in the new versions.

@kuPyxa
Copy link

kuPyxa commented Mar 31, 2022

+1

@kuPyxa
Copy link

kuPyxa commented Apr 1, 2022

I generated the Authorization header by myself and added it to the Custom HTTP Headers in the Datasource. But it's kind of a crutch.

@alexanderzobnin
Copy link
Collaborator

Looks like it was bug in SDK and when http client created, basic auth settings was ignored. This PR solves the issue, so I just updated dependency and checked out that basic auth should be enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants