Grafana stopped working after small change "If you're seeing this Grafana has failed to load its application files"

Hello all

What Grafana version and what operating system are you using?

8.x

  • What are you trying to achieve?

I would like to modify the Login Page

  • How are you trying to achieve it?

I modified one single file: /usr/share/grafana/public/build/app.90343abf47ce928781e5.js

i added 2 Letters. After Grafana stopped working i changed it back to original content

  • What happened?

after touching the file Grafana stopped working. Now the Login page state following:

If you’re seeing this Grafana has failed to load its application files**

  1. This could be caused by your reverse proxy settings.

  • Can you copy/paste the configuration(s) that you are having problems with?

I did not change any configuration

Is there any way how I can get Grafana back without uninstall?

I appreciate your help!

Br

Thomas

Dear Thomas,

maybe the newlines in this file got mangled by e.g. editing it from a Windows machine or something like that? You could easily try to extract this file from the original package you have been installing Grafana from, right?

With kind regards,
Andreas.

i completely uninstalled and re installed Grafana to get it up and running.
I modified the file on a Windows machine. I will try it one more time and edit it on a Linux.
Will keep you updated. I didn’t thought to exchange a text & picture is that hard ….

:crazy_face:

Ups - i Did it again :slight_smile:
Conclusio: Do not change with WinSCP!
If you modefy the file with MC Grafana continue to work
Thx for hint!

Not sure if im correct in this thread, but hopefully somebody could help me?
I was tasked to add an url to our grafana server and I just can’t get it to work.
I also slightly edited the .js file for the login-page but I highly doubt that this is my problem.
Sadly I’m very new to nginx and this URL-stuff in general.

Im getting the same error-message when I open my URL, It only works by including the port.
so:
http:// mynewdomain. de:3000 << works
http:// xx.xxx.xx.xxx:3000 << (static IPv4) works
http:// mynewdomain. de << gets me the above mentioned error message
http:// xx.xxx.xx.xxx << (static IPv4) gets me the above mentioned error message

Grafana v8.2.4 (d409b0ca16) OSS running on a Linux VPS, installed via

sudo apt-get install

(following Install on Debian/Ubuntu | Grafana Labs)

My config files now look like this after followed https://grafana.com/tutorials/run-grafana-behind-a-proxy/:

nginx.conf

#user  nginx;
#worker_processes  1;

#error_log  /var/log/nginx/error.log;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /var/log/nginx/error.log  info;

#pid        /var/run/nginx.pid;

#include /etc/nginx/modules.conf.d/*.conf;

events {
    worker_connections  1024;
}



http{
# this section is from https://grafana.com/tutorials/run-grafana-behind-a-proxy/

	map $http_upgrade $connection_upgrade {
	  default upgrade;
	  '' close;
	}
	server {
	  listen 80;
	  root /usr/share/nginx/html;
	  index index.html index.htm;

	  location / {
	    proxy_set_header Host $http_host;
	    proxy_pass http://localhost:3000/;
	  }

	  # Proxy Grafana Live WebSocket connections.
	  location /api/live {
	    rewrite  ^/(.*)  /$1 break;
	    proxy_http_version 1.1;
	    proxy_set_header Upgrade $http_upgrade;
	    proxy_set_header Connection $connection_upgrade;
	    proxy_set_header Host $http_host;
	    proxy_pass http://localhost:3000/;
	  }
	}
}

and grafana.ini:

#################################### Server ####################################
[server]
# Protocol (http, https, h2, socket)
protocol = http

# The ip address to bind to, empty will bind to all interfaces
http_addr =

# The http port  o use
http_port = 3000

# The public facing domain name used to access grafana from a browser
domain = mynewdomain.de

# Redirect to correct domain if host header does not match domain
# Prevents DNS rebinding attacks
;enforce_domain = true

# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
root_url = %(protocol)s://%(domain)s:%(http_port)s/

# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
;serve_from_sub_path = false

# Log web requests
;router_logging = false

# the path relative working path
;static_root_path = public

# enable gzip
;enable_gzip = false

# https certs & key file  (SSL TODO!)
;cert_file = /etc/grafana/grafana.key
;cert_key = /etc/grafana/grafana.key

# Unix socket path
;socket =

This is what the console says about the errors, I just cant explain myself why it does that. All the .js files are reachable when I just open for example http://mynewdomain.de/public/build/runtime.e5180647aa9f27ba6de7.js