rancher: If you're seeing this Grafana has failed to load its application files
What kind of request is this (question/bug/enhancement/feature request): Question/Feature Request
Steps to reproduce (least amount of steps as possible):
- Setup a Rancher docker container using the default setup
- Setup nginx with a standard config to point to your Rancher container
- Onboard your cluster (create/import, etc)
- Enable cluster monitoring within Rancher UI
- Try going to Grafana via the Rancher dashboard
Result: Cluster monitoring enables successfully and metrics can be seen on the Rancher homepage along with icons to access Grafana:
Upon clicking the Grafana icons and attempting to access Grafana, you get the error If you're seeing this Grafana has failed to load its application files
:
I did not see a proper Rancher config covered in the setup docs. I’ve also tried some old nginx configs I found in past issues (circa-2017), but I still see the same error.
What is the correct nginx config for setting up Rancher with Grafana support?
Other details that may be helpful:
Environment information
- Rancher version: v2.3.3
- Installation option (single install/HA): Single install
Cluster information
- Cluster type: Imported k3s v1.16.3-k3s.2
- Machine type (cloud/VM/metal) and specifications (CPU/memory): Ubuntu VM
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 15
Hi,
It appears to be related to the unconditional
proxy_set_header Connection "upgrade";
Seems Grafana does not expect it?!You can make the Connection header reflects the client one, in your nginx config, add in http scope:
Then replace the
proxy_set_header Connection "upgrade"
withproxy_set_header $connection_upgrade
.Hope this helps.
Regards,
Ben.
In my case, I just faced this error after upgrading rancher to 2.4.5 version. Since I’ve installed rancher on a single node docker environment with no proxy, I cannot apply @rutgerFH’s comments.
Fortunately, I found the new experimental proxy feature was enabled in Global Settings. Just after I deactivating the proxy feature, Grafana works again without error.
FYI, the experimental proxy feature prevents Rancher’s tools like monitoring, logging, Istio, etc. See, https://rancher.com/docs/rancher/v2.x/en/installation/options/feature-flags/
And you can turn it off with ease. See, https://rancher.com/docs/rancher/v2.x/en/installation/options/feature-flags/#disabling-features-with-the-rancher-ui
good luck
It is supposed to be: proxy_set_header Connection $connection_upgrade
You forgot the Connection in between
ie: `map $http_upgrade $connection_upgrade { default Upgrade; ‘’ close; }
server { # SSL configuration listen 443 ssl http2;
server { listen 80;
} `
I solved this problem. October 19, 2023
I installed grafana 10.1.2 on AWS EC2 and used it well for two weeks. In the 3rd week, tuning was done to modify the favicon and welcome message. The task was to change js files in the public folder. In the 4th week, when accessing the gafana page, an error page with proxy information etc. suddenly appeared and I could not access it.
I searched a lot on Google, but there was a lot of proxy information. I disconnected the domain record from route53 and connected with the IP address, but the error message was the same.
Therefore, I thought it was not a proxy problem.
I installed grafana on a new ec2 and copied and overwritten the configuration files.
/usr/share/grafana/public/ tar -cvfz public_origin public
And then grafana-server was restarted. And I was connected to the grafana domain as before.
If you modified the js file, it may be helpful to restore the settings like this.
Good luck.
It appears that grafana is unaware that its’ operating under a subdomain. Despite hacking a things into place to make at least the URL for a single cluster pass correctly, I was unable to make it work, and thus will give up on it. https://github.com/rancher/rancher/issues/25035 may be related.