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

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

Open
farvardin opened this issue Jun 28, 2023 · 14 comments
Open

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

farvardin opened this issue Jun 28, 2023 · 14 comments

Comments

@farvardin
Copy link
Member

farvardin commented Jun 28, 2023

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

  • Hardware: *VPS bought online *
  • YunoHost version: latest 11.1.21.4
  • I have access to my server: Through SSH | through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: * yes*
    • If yes, please explain: I've imported a backup from another yunohost instance
  • Using, or trying to install package version/branch:
  • If upgrading, current package version: 9.5.3~ynh1

Steps to reproduce

  • I've backup a working grafana instance from an other server
  • I've restored it through the webadmin
  • I've changed the DNS (yesterday) to match the new server. Every other app are fine. Grafana keeps complaining about a wrong redirection.
  • I've changed on the old server the DNS and changed the URL on the old server. On this one, grafana is working fine (even after the modification).
  • I've moved grafana to an other URL, to another DNS (on the same yunohost server) on the new server
  • I've uninstalled grafana, and installed it from scratch, same error
  • I've uninstalled it again, and located all the old remaining grafana conf files, and removed them as well, installed grafana again on another domaine (same server), same error

Logs

@Jadeiin
Copy link

Jadeiin commented Jul 8, 2023

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

@EulenspiegelTill
Copy link

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

@JimboJoe
Copy link
Contributor

should be fixed by #104

@EulenspiegelTill
Copy link

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

@JimboJoe
Copy link
Contributor

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
Copy link

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
Copy link
Member Author

farvardin commented Jul 24, 2023

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
Copy link
Contributor

@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
Copy link

@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
Copy link
Contributor

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

@BrunoSpy
Copy link
Contributor

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
Copy link
Member Author

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
Copy link

MayeulC commented Aug 30, 2023

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
Copy link
Contributor

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

MayeulC added a commit to MayeulC/grafana_ynh that referenced this issue Sep 2, 2023
There was a typo in the sed command, which would only apply to commented configuration files.
With this fix, the configuration option will only be updated if uncommented, consistent with the suggestion at:
YunoHost-Apps#105 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants