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 displaying authentication box after login #39

Closed
christianhau opened this issue Jun 7, 2019 · 18 comments
Closed

Grafana displaying authentication box after login #39

christianhau opened this issue Jun 7, 2019 · 18 comments

Comments

@christianhau
Copy link

Problem/Motivation

I have installed grafana and connected it to influxdb as you described in @frenck livestream. Worked magic! I have tried both with and without changing the admin password but the same thing happens. When I open the grafana UI from hassio it gets me to the login screen. Here i can log in and all is good, but when the dashboard is open an authentication box pops up requesting username and password. This does not go away when entering the same username and password used to log into grafana. Note that this did not happen when I first logged in after installing it, only after logging out once and attempting to log in again. See screenshot for what it looks like. Am I missing something really basic?

grafana

My config:
{ "ssl": true, "certfile": "fullchain.pem", "keyfile": "privkey.pem", "plugins": [], "env_vars": [] }

Expected behavior

being able to authenticate and log into Grafana

Actual behavior

I go past the login screen but cannot authenticate against the pop up that comes up over the dashboard.

@Mace404
Copy link

Mace404 commented Jun 9, 2019

Seems like the datasource password is not getting saved properly between restarts.
Go to your data source, hit the reset button at the password field and enter the password again.
That solves the login box for me... until the next restart.

@christianhau
Copy link
Author

Thanks! Annoying, but worked, would love a fix that enables the password to be properly stored :)

@FreeBSDGeek
Copy link

I am having the same issue. Has there been any solution to this issue yet?

@entropie
Copy link

Same issue.

I just reset everything and started all over, because I got it working before and broke it while changing everything to SSL. Not sure how i got it working before.

@barrystaes
Copy link

barrystaes commented Jun 19, 2019

Same problem here, same workaround helps.

Had a brand new HassOS and (InfluxDB and) Grafana install, logs sensors OK, but Grafana went broken just like this after first reboot after hass update.

Setting the datasource password in Grafana again does fix the problem until next restart. I also had to make datasource the default (again? Not sure..) otherwise all data was a "random walk" data query.

@jonathanadams
Copy link

Setting the data source password again following restart does not work for me. I keep getting a red notification box stating 'e is un defined' along with a green box saying 'datasource updated'. My fix requires me to delete the whole data sorce and add it again.

Is there a perminant fix been worked on?

@rradar
Copy link

rradar commented Jul 1, 2019

I have the same problem. I also have the browser dialog after the login in grafana.

It' written:

hassio:3000 your connection is not private

My setup is still missing ssl. Despite what's been input the dialog always (and only) closes after the second attempt (despite credentials are right or wrong I guess).

If I go to my influxdb connection setup in grafana and reset the password it works again.

Hope this get's fixed soon as all alarms in grafana get lost if this error is present

@Hedgehog57
Copy link

Same here. Reseting password in grafana datasource interface after reboot fix a problem until next reboot...

@arretx
Copy link

arretx commented Jul 9, 2019

Same problem. Just started happening with no clear reason why.

@39domotica
Copy link

Same problem. Re-installed the addon and only works until reboot ...

@Hedgehog57
Copy link

Hedgehog57 commented Jul 11, 2019

I think i've found a reason and a solution.

reason:
On each restart "secret_key" is regenerated if not added in Grafana configuration. This parameter is used for encoding datasource passwords. As it's changed Grafana cannot authenticate in database. We cannot edit Grafana config directly but we can set an environment variable.

solution:
Add this in Grafana addon configuration:
"env_vars": [
{
"name": "GF_SECURITY_SECRET_KEY",
"value": "<generate_something_here>"
}
],
This will set secret_key persistent.

@39domotica
Copy link

I tried to add your solution but it doesn't work the same.
My conf is follow it:
{
"ssl": true,
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"plugins": [],
"env_vars": [
{
"name": "GF_DEFAULT_INSTANCE_NAME",
"value": "Hassio"
},
{
"name": "GF_USERS_ALLOW_SIGN_UP",
"value": "true"
},
{
"name": "GF_SECURITY_SECRET_KEY",
"value": "Hassio"
}
],
"log_level": "info"
}

I still have the same authentication request problem

@Hedgehog57
Copy link

Hedgehog57 commented Jul 12, 2019

I still have the same authentication request problem

There are two type of auth requests.

  1. when iframe opened Grafana ask You to authenticate.
  2. after You authenticate in Grafana there can be a basic authenticate request. Like on the screenshot of topic starter.

First can be disabled by enabling anonymous auth ion grafana

"name:" "GF_AUTH_ANONYMOUS"
"value": "true"

A core of second one is changed security_key. This can be fixed by

"name": "GF_SECURITY_SECRET_KEY",
"value": "Hassio"

Of cource You need to login in grafana after enabling this setting and re-enter password on datasource.

And one more comment. Yo need to rename ORG in Grafana. Or setup which ORG must be used.

links to see:

https://grafana.com/docs/installation/configuration/#secret-key
https://grafana.com/docs/auth/overview/#anonymous-authentication

Grafana Labs Blog
Configuration Docs
Grafana Labs Blog
Overview for auth

@christianhau
Copy link
Author

@Hedgehog57 solution did the trick, worked after adding the configuration, resetting the database sources and then restarting.

@frenck
Copy link
Member

frenck commented Jul 26, 2019

This is not how it should have been solved.
Releasing a more permanent fix today, please remove those from your configuration.

@frenck
Copy link
Member

frenck commented Jul 26, 2019

v2.2.2 released

@koenvanderlinden
Copy link

Updated Grafana to v2.2.2. Updated the credentials for all Data Sources.
Problem solved.

@addons-assistant
Copy link

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@addons-assistant addons-assistant bot locked as resolved and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests