Ubable to connect to Grafana server

Hi,

I am unable to connect to grafana server by using the commands
systemctl daemon-reload
systemctl start grafana-server
systemctl status grafana-server. Below is the error. Please help me resolve this issue.

grafana-server.service - Grafana instance
Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Wed 2019-07-31 08:24:39 EDT; 6s ago
Docs: http://docs.grafana.org
Process: 6841 ExecStart=/usr/sbin/grafana-server --config={CONF_FILE} --pidfile={PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default.paths.logs=${L
Main PID: 6841 (code=exited, status=1/FAILURE)
Jul 31 08:24:39 sravanthi systemd[1]: grafana-server.service: Main process exited, code=exited, status=1/FAILURE

Jul 31 08:24:39 sravanthi systemd[1]: grafana-server.service: Unit entered failed state.

Jul 31 08:24:39 sravanthi systemd[1]: grafana-server.service: Failed with result ‘exit-code’.

Jul 31 08:24:39 sravanthi systemd[1]: grafana-server.service: Service hold-off time over, scheduling restart.
Jul 31 08:24:39 sravanthi systemd[1]: Stopped Grafana instance.
Jul 31 08:24:39 sravanthi systemd[1]: grafana-server.service: Start request repeated too quickly.
Jul 31 08:24:39 sravanthi systemd[1]: Failed to start Grafana instance.

Please help me resolve the issue.


Thanks & Regards,
Sravanthi.

What do you see in the grafana log?
You have titled this “Unable to connect to Grafana server” whereas the error you describe is a failure to start the server, not connect to it.

Thank you for responding. Yes. I think the error is datasource provisioning error. The logs are below.
I am using Grafana for the first time, and since I could not generate a dashboard even after following all the steps in the various tutorials I watched. I landed up modifying the.ini file and sample.yaml file in datasource directory.

Also want to bring to your notice that., Grafana UI does not run on 127.0.0.1/localhost. And I modified the grafana.ini file to 10.0.2.16 on port 3000 and I could login into Grafana UI. And since I was trying to use Graphite, I suppose, I would have landed up changing some configuration which lead me to this issue.

Please help me resolve the issue.

t=2019-08-01T00:45:16-0400 lvl=info msg=“Starting Grafana” logger=server version=6.3.0-beta2 commit=c8740d9 branch=HEAD compiled=2019-07-26T09:56:18-0400

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning

t=2019-08-01T00:45:16-0400 lvl=info msg=“App mode production” logger=settings

t=2019-08-01T00:45:16-0400 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=6821

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing SqlStore” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3

t=2019-08-01T00:45:16-0400 lvl=info msg=“Starting DB migration” logger=migrator

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing HTTPServer” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing InternalMetricsService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing RemoteCache” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing QuotaService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing PluginManager” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Starting plugin search” logger=plugins

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing RenderingService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing AlertEngine” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing DatasourceCacheService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing HooksService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing LoginService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing SearchService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing ServerLockService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing TracingService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing UsageStatsService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing UserAuthTokenService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing CleanUpService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing NotificationService” logger=server

t=2019-08-01T00:45:16-0400 lvl=info msg=“Initializing provisioningServiceImpl” logger=server

t=2019-08-01T00:45:16-0400 lvl=eror msg=“Server shutdown” logger=server reason=“Service init failed: Datasource provisioning error: yaml: line 12: did not find expected key”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Starting Grafana” logger=server version=6.3.0-beta2 commit=c8740d9 branch=HEAD compiled=2019-07-26T09:56:18-0400

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins

t=2019-08-01T00:45:16-0400 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning

t=2019-08-01T00:45:16-0400 lvl=info msg=“App mode production” logger=settings

t=2019-08-01T00:45:17-0400 lvl=info msg=“Writing PID file” logger=server path=/var/run/grafana/grafana-server.pid pid=6830

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing SqlStore” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3

t=2019-08-01T00:45:17-0400 lvl=info msg=“Starting DB migration” logger=migrator

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing HTTPServer” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing InternalMetricsService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing RemoteCache” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing QuotaService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing PluginManager” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Starting plugin search” logger=plugins

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing RenderingService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing AlertEngine” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing DatasourceCacheService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing HooksService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing LoginService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing SearchService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing ServerLockService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing TracingService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing UsageStatsService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing UserAuthTokenService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing CleanUpService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing NotificationService” logger=server

t=2019-08-01T00:45:17-0400 lvl=info msg=“Initializing provisioningServiceImpl” logger=server

t=2019-08-01T00:45:17-0400 lvl=eror msg=“Server shutdown” logger=server reason=“Service init failed: Datasource provisioning error: yaml: line 12: did not find expected key”

Looks like there is an error in that file.

Hi,

The link(https://grafana.com/docs/administration/provisioning/) has section ’ Example Datasource Config File’ and attached is my sample.yaml file. Both are very same.
The attached sample.yaml file is exactly the same as it was during installation. And it is this same file on which I could login into Grafana UI. The following day when I tried starting grafana server. It failed.

Since it anyways failed., I tried all the permutations & combinations of IP addresses & port# at the “URL:” section. Yet could not login.

  1. Is there any section that I should try un-commenting and start the grafana-server?

  2. Also, the log file in the last statement says- t=2019-08-01T00:45:17-0400 lvl=eror msg=“Server shutdown” logger=server reason=“Service init failed: Datasource provisioning error: yaml: line 12: did not find expected key”
    What is the key which Grafana is looking for(at line 12) because of which the server start failed?

Please help me resolve the issue. Looking forward to hearing from you. Thanks.

A significant difference I see it that you have commented out the line
datasources:

Didn’t notice it. Can login now. Thanks much.

As I said before it was not logging in that you had a problem with, but starting the server.

My apologies. I meant login to the UI.
Thanks again.

It wasn’t logging in that you had a problem with, it was starting the server.
It is as if you said you could not open the door on your car, but the real problem was that the car was not there.