Grafana dashboard not showing

Hello,

I have installed and configured Grafana, but the dashboard is not showing when I go to 127.0.0.1:3000. I get the following

The problem here is that the JavaScript and CSS files have not loaded.

Can you provide some more information:

  • How did you install Grafana (debian, docker, windows, from source etc.)
  • What do the Grafana server logs say?
  • What is the error in the Chrome Dev Tools console?
  • Are you using a proxy?

That mostly happens when you are using a proxy.

Configure it properly in the Grafana.ini file and also in the Web-server conf file.

It is running on Win10 x64 NGINX with reverse proxy set to port 3000 in nginx.conf and grafana config.

t=2017-05-13T00:29:52+1000 lvl=info msg=“Shutdown started” logger=server code=0 reason=“system signal: interrupt”
t=2017-05-13T00:30:33+1000 lvl=info msg=“Starting Grafana” logger=main version=4.2.0 commit=349f3eb93 compiled=2017-03-22T21:06:41+1100
t=2017-05-13T00:30:33+1000 lvl=info msg=“Config loaded from” logger=settings file=D:\nginx\html\grafana/conf/defaults.ini
t=2017-05-13T00:30:33+1000 lvl=info msg=“Config loaded from” logger=settings file=D:\nginx\html\grafana\conf\custom.ini
t=2017-05-13T00:30:33+1000 lvl=info msg=“Path Home” logger=settings path=D:\nginx\html\grafana
t=2017-05-13T00:30:33+1000 lvl=info msg=“Path Data” logger=settings path=D:\nginx\html\grafana\data
t=2017-05-13T00:30:33+1000 lvl=info msg=“Path Logs” logger=settings path=D:\nginx\html\grafana\data\log
t=2017-05-13T00:30:33+1000 lvl=info msg=“Path Plugins” logger=settings path=D:\nginx\html\grafana\data\plugins
t=2017-05-13T00:30:33+1000 lvl=info msg=“Initializing DB” logger=sqlstore dbtype=sqlite3
t=2017-05-13T00:30:33+1000 lvl=info msg=“Starting DB migration” logger=migrator
t=2017-05-13T00:30:34+1000 lvl=info msg=“Executing migration” logger=migrator id=“copy data account to org”
t=2017-05-13T00:30:34+1000 lvl=info msg=“Skipping migration condition not fulfilled” logger=migrator id=“copy data account to org”
t=2017-05-13T00:30:34+1000 lvl=info msg=“Executing migration” logger=migrator id=“copy data account_user to org_user”
t=2017-05-13T00:30:34+1000 lvl=info msg=“Skipping migration condition not fulfilled” logger=migrator id=“copy data account_user to org_user”
t=2017-05-13T00:30:34+1000 lvl=info msg=“Creating json dashboard index for path: [D:\nginx\html\grafana\data]”
t=2017-05-13T00:30:36+1000 lvl=info msg=“Starting plugin search” logger=plugins
t=2017-05-13T00:30:37+1000 lvl=info msg=“Registering plugin” logger=plugins name=Clock
t=2017-05-13T00:30:38+1000 lvl=info msg=“Initializing CleanUpService” logger=cleanup
t=2017-05-13T00:30:38+1000 lvl=info msg=“Initializing Alerting” logger=alerting.engine
t=2017-05-13T00:30:38+1000 lvl=info msg=“Initializing Stream Manager”
t=2017-05-13T00:30:38+1000 lvl=info msg=“Initializing HTTP Server” logger=http.server address=0.0.0.0:3000 protocol=http subUrl=/grafana
t=2017-05-13T00:55:47+1000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/grafana/ status=404 remote_addr=192.168.20.1 time_ms=152ns size=8635
t=2017-05-13T00:55:47+1000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/grafana/public/css/fonts.min.css status=404 remote_addr=192.168.20.1 time_ms=35ns size=8635
t=2017-05-13T00:55:47+1000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/grafana/public/app/boot.js status=404 remote_addr=192.168.20.1 time_ms=33ns size=8635
t=2017-05-13T00:55:47+1000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/grafana/public/css/grafana.dark.min.css status=404 remote_addr=192.168.20.1 time_ms=75ns size=8635
t=2017-05-13T00:55:48+1000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/grafana/public/css/grafana.dark.min.css status=404 remote_addr=192.168.20.1 time_ms=53ns size=8635
t=2017-05-13T00:55:48+1000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/grafana/public/app/boot.js status=404 remote_addr=192.168.20.1 time_ms=28ns size=8635

I ran into the same issue. Sounds like it may be related to https://github.com/grafana/grafana/issues/8089. May be fixed in 4.3.0 Beta1.

Appears to still be broken in 4.3.0-beta1.

Added comment to https://github.com/grafana/grafana/issues/8089

@schmitty what does the auth.proxy section in your config look like? And what is the value of the server.domain config value and the server.root_url value? See docs for more details.

Replied to the issue. I don’t think it is a bug.

Grafana custom.ini

[server]

Protocol (http or https)

protocol = http

The ip address to bind to, empty will bind to all interfaces

;http_addr =

The http port to use

http_port = 3000

The public facing domain name used to access grafana from a browser

domain = localhost

Redirect to correct domain if host header does not match domain

Prevents DNS rebinding attacks

;enforce_domain = false

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 = http://localhost/grafana

Log web requests

;router_logging = false

the path relative working path

;static_root_path = public

enable gzip

;enable_gzip = false

https certs & key file

;cert_file =
;cert_key =

NGINX nginx.conf

# Grafana HTTP server

server {
    listen       80;
    server_name  grafana.dizzle.me;
	if ($scheme = http) { return 301 https://$server_name$request_uri; }

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

	location ~ /.well-known {
            allow all;
    }
}


	# setup proxy and sub URL for Grafana
	#
	location /grafana {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_read_timeout 300;
	}

# Grafana HTTPS server

server {
    listen       443 ssl;
    server_name  grafana.dizzle.me;

    ssl_certificate      d:/nginx/ssl/dizzle.me-crt.pem;
    ssl_certificate_key  d:/nginx/ssl/dizzle.me-key.pem;
	ssl_trusted_certificate	d:/nginx/ssl/dizzle.me-chain.pem;

    ssl_session_cache    shared:SSL:10m;
    ssl_session_timeout  10m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;


	location / {
		proxy_set_header        Host $host;
		proxy_set_header        X-Real-IP $remote_addr;
		proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header        X-Forwarded-Proto $scheme;
		proxy_pass              http://127.0.0.1:3000;
		proxy_read_timeout      90;
		proxy_redirect          http://127.0.0.1:3000 http://grafana.dizzle.me;
    }
}

I had the same problem. Tried to install grafana on a kubernetes cluster via https://github.com/kayrus/prometheus-kubernetes/blob/master/grafana-deployment.yaml
(tried it with the 3.1.1, 4.2.0 and 5.1.0)

When accessing grafana directly (via NodePort) it worked.
As soon as I tried to use an ingress (reverse proxy) and add GF_SERVER_ROOT_URL I got the result you mentioned above.
When I had a look into the *.css and *.js resources which are getting loaded they do NOT contain CSS or JS code but the same HTML code from the initial HTML call.

That’s what I found in the logs (kubectl logs ):
Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/grafana/public/build/grafana.dark.css status=404 remote_addr=10.244.0.0 time_ms=250 size=12154 referer="http://kube-test.<replaced>.com:31928/?orgId=1

Lastly it was a misconfiguration of the ingress. Using traefik as ingress controller / reverseproxy I had to add
traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip

to the ingress annotations. Previously I tried it with
traefik.ingress.kubernetes.io/rewrite-target: /

and that lead to the effect that the HTML was written in every other file.

Have fun
Greets
CCarpo

Hi
I have the same problem.
grafana_6.2.5_amd64.deb
nginx server with reverse proxy.
This is not loading the static file(css and js). The authentication is ok.

Example of ajax result:

How can i change the GF_SERVER_ROOT_URL in debian system?

Hi,
I am having the same issue, deployed grafana in kubernetes. Any help?
Thank You!