YunoHost-Apps / grafana_ynh

Grafana package for YunoHost
https://grafana.com/
GNU General Public License v3.0
15 stars 12 forks source link

La page n’est pas redirigée correctement #105

Open farvardin opened 1 year ago

farvardin commented 1 year ago

Describe the bug

I can't connect / use grafana. The page said:

La page n’est pas redirigée correctement

Une erreur est survenue pendant une connexion à #####

La cause de ce problème peut être la désactivation ou le refus des cookies.

(of course I've also tried to navigate in private browsing, to clean cookies etc)

Context

Steps to reproduce

Logs

Jadeiin commented 1 year ago

Maybe you can try to set serve_from_sub_path to false, according to this comment. This works for me.

EulenspiegelTill commented 1 year ago

have the same error after the update to 9.5.3~ynh1 and the serve from sub path is allready to false.

JimboJoe commented 1 year ago

should be fixed by #104

EulenspiegelTill commented 1 year ago

@JimboJoe thx, updated it but still the error : NSURLErrorHTTPTooManyRedirects can i provide you some logs?

JimboJoe commented 1 year ago

Is the app installed on a domain root or a subpath? There may be interesting info in /etc/nginx/conf.d/.d/grafana.conf and /var/log/nginx/-error.log.

EulenspiegelTill commented 1 year ago

It is on a installed on a subpath: $domain/grafana nginx grafana conf:

  location /grafana/ {

  proxy_redirect off;
  proxy_set_header Host $host;

  proxy_set_header X-Forwarded-Host $host;
  proxy_set_header X-Forwarded-Server $host;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-WEBAUTH-USER $remote_user;
  proxy_http_version 1.1;
  proxy_pass_request_headers on;
  proxy_set_header Connection "keep-alive";
  proxy_store off;
  proxy_pass http://127.0.0.1:3001/;

  gzip on;
  gzip_proxied any;
  gzip_types *;

  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
}

And the error log is empty..

farvardin commented 1 year ago

should be fixed by #104

thanks for the update!

I've upgraded the installed version, I had the same error. Then I've removed everything, and with a fresh install, this time Grafana is working at last.

Now I'll look for transfering the graphs from the other instance, to the new one...

JimboJoe commented 1 year ago

@EulenspiegelTill sorry my message was uncomplete, I was referring to /var/log/nginx/yourdomain-error.log. what about /etc/grafana/grafana.ini? Is the serve_from_sub_path defined?

EulenspiegelTill commented 1 year ago

@JimboJoe this error log was indeed empty. It was: serve_from_sub_path = true switching it to false solved the problem. I was always searching in the conf /usr/share/grafana/conf/defaults.ini rather than /etc/grafana/grafana.ini.

Are you able to source origin of this missconf? i was just in the ordinary updating process, no extra confs or something special.

JimboJoe commented 1 year ago

This is only present on servers existing prior to Grafana 10; I pushed a migration fix here.

BrunoSpy commented 1 year ago

Hi,

I updated to 10.0.3-ynh1 and the bug was still here. I thought the fix was included in 10.03-ynh1 or I misunderstood ?

I manually changed serve_from_sub_path to false which fixed it.

Version installée : 10.0.3~ynh1

farvardin commented 1 year ago

while trying to upgrade the backup grafana from yunohost, I kept having onlyoffice instead of grafana, for an unknown reason.

I've made a fresh new install of grafana, and managed to transfert my grafana data with this tool: https://github.com/ysde/grafana-backup-tool

at last everything is working fine now. Thank you for this package.

MayeulC commented 1 year ago

I had the same issue (not sure how long it was present for, I am currently on version 10.1.0~ynh1). Manually changing serve_from_sub_path to false in the config solved it.

@JimboJoe : while I do not understand the sed command from #109 completely, it does not work on my config file:

The first line is included in that MR and does not work, the second line works (I removed the ; that corresponds to a commented config value, in my config file, that was already uncommented):

"/^\[server\]$/,/^\[/ s@;serve_from_sub_path = .*@serve_from_sub_path = false@"
"/^\[server\]$/,/^\[/ s@serve_from_sub_path = .*@serve_from_sub_path = false@"

So maybe make it s@;?serve etc?

JimboJoe commented 1 year ago

Hello, you're right, I should simply not have put that ;. I'll fix that in next build.