For some reason, i couldnt start grafana server after the installation


logger=plugin.loader t=2022-12-08T15:13:36.20693136-05:00 level=info msg="Plugin registered" pluginID=agenty-flowcharting-panel
logger=plugin.loader t=2022-12-08T15:13:36.206939838-05:00 level=info msg="Plugin registered" pluginID=grafana-splunk-datasource
logger=plugin.grafana-splunk-datasource t=2022-12-08T15:13:36.213812747-05:00 level=info msg=Profiler enabled=false
logger=plugin.grafana-splunk-datasource t=2022-12-08T15:13:36.213852618-05:00 level=info msg="Running Splunk backend datasource..."
logger=plugin.loader t=2022-12-08T15:13:36.214426819-05:00 level=error msg="Could not start plugin" pluginId=grafana-image-renderer err="plugin grafana-image-renderer is already registered"
logger=plugin.loader t=2022-12-08T15:13:36.214451541-05:00 level=info msg="Plugin registered" pluginID=grafana-map-panel
logger=secrets t=2022-12-08T15:13:36.214745867-05:00 level=info msg="Envelope encryption state" enabled=true currentprovider=secretKey.v1
logger=query_data t=2022-12-08T15:13:36.216614331-05:00 level=info msg="Query Service initialization"
logger=live.push_http t=2022-12-08T15:13:36.220617518-05:00 level=info msg="Live Push Gateway initialization"
logger=infra.usagestats.collector t=2022-12-08T15:13:36.3300047-05:00 level=info msg="registering usage stat providers" usageStatsProvidersLen=2
logger=server t=2022-12-08T15:13:36.330134773-05:00 level=info msg="Writing PID file" path=/var/run/grafana/grafana-server.pid pid=2535153
logger=settings t=2022-12-08T15:13:36.720626775-05:00 level=info msg="Starting Grafana" version=9.2.3.1 commit=046dbf9789 branch=HEAD compil

I see the server keep trying starting, it stopped at PID file…

Not sure what the reason why, i think it could be some permission issue so i login as grafana:

sudo su - grafana -s /bin/bash

Then i run this command:
/usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=rpm cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins cfg:default.paths.provisioning=/etc/grafana/provisioning

This is the error:

INFO [12-08|16:14:38] registering usage stat providers         logger=infra.usagestats.collector usageStatsProvidersLen=2
INFO [12-08|16:14:38] Writing PID file                         logger=server path=/var/run/grafana/grafana-server.pid pid=2570381
Failed to start grafana. error: attempt to write a readonly database
attempt to write a readonly database


I checked the permission , everything looks good. After a while ,i decided to check the database.  i try to do this
sqlite3 /Data/grafana.db
.tables
(No tables showing up) , that means my db has been corrupted , i pulled my from the backed up and it's working fine.

It's frustrated since grafana didn't show the right message.