Grafana 10 docker installation, with mounted volume

Hi, This is the first time I install Grafana, I’m not a linux expert, just trying to learn making myself a home lab, so the problem is that I’ve installed Truenas, then i created a dataset which I’m mounting in the host where I run docker, I’m using the following docker compose to install Grafana latest version:

version: '3'
networks:
  spider:
    external: true
services:
  grafana_changarritos:
    container_name: grafana_changarritos
    image: grafana/grafana:latest
    restart: always
    networks:
      - spider
    ports:
      - "5300:3000"
    volumes:
      - /media/share/grafana/grafana_data:/var/lib/grafana
    user: '1000:1000'

the problem is that when I use the mounted path from the host, which as I mentioned is a samba share, I get an error that says that the database is locked. I even stop the container change grafana.db permissions on host to 640 to solve this issue “SQLite database file has broader permissions than it should”, then I start the container again, bu still the same error. can some one give me any advice?

this the docker log

Error checking server process execution privilege. error: could not get current OS user to detect process privileges

logger=settings t=2023-06-20T17:16:25.119147859Z level=info msg="Starting Grafana" version=10.0.0 commit=81d85ce802 branch=HEAD compiled=2023-06-09T16:45:53Z

logger=settings t=2023-06-20T17:16:25.11929102Z level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead."

logger=settings t=2023-06-20T17:16:25.119307205Z level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini

logger=settings t=2023-06-20T17:16:25.11931312Z level=info msg="Config loaded from" file=/etc/grafana/grafana.ini

logger=settings t=2023-06-20T17:16:25.119317942Z level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"

logger=settings t=2023-06-20T17:16:25.119322391Z level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"

logger=settings t=2023-06-20T17:16:25.119326668Z level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"

logger=settings t=2023-06-20T17:16:25.119330987Z level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"

logger=settings t=2023-06-20T17:16:25.119335964Z level=info msg="Config overridden from command line" arg="default.log.mode=console"

logger=settings t=2023-06-20T17:16:25.119340416Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_DATA=/var/lib/grafana"

logger=settings t=2023-06-20T17:16:25.119344945Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_LOGS=/var/log/grafana"

logger=settings t=2023-06-20T17:16:25.119348976Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_PLUGINS=/var/lib/grafana/plugins"

logger=settings t=2023-06-20T17:16:25.119375715Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_PROVISIONING=/etc/grafana/provisioning"

logger=settings t=2023-06-20T17:16:25.119381353Z level=info msg=Target target=[all]

logger=settings t=2023-06-20T17:16:25.119389013Z level=info msg="Path Home" path=/usr/share/grafana

logger=settings t=2023-06-20T17:16:25.119393498Z level=info msg="Path Data" path=/var/lib/grafana

logger=settings t=2023-06-20T17:16:25.119397842Z level=info msg="Path Logs" path=/var/log/grafana

logger=settings t=2023-06-20T17:16:25.11940276Z level=info msg="Path Plugins" path=/var/lib/grafana/plugins

logger=settings t=2023-06-20T17:16:25.119407278Z level=info msg="Path Provisioning" path=/etc/grafana/provisioning

logger=settings t=2023-06-20T17:16:25.119411867Z level=info msg="App mode production"

logger=sqlstore t=2023-06-20T17:16:25.12460313Z level=info msg="Connecting to DB" dbtype=sqlite3

logger=sqlstore t=2023-06-20T17:16:25.125105717Z level=info msg="Creating SQLite database file" path=/var/lib/grafana/grafana.db

logger=migrator t=2023-06-20T17:16:25.129665666Z level=info msg="Starting DB migrations"

logger=migrator t=2023-06-20T17:16:25.129780945Z level=info msg="Executing migration" id="create migration_log table"

Error: ✗ migration failed (id = create migration_log table): database is locked

Error checking server process execution privilege. error: could not get current OS user to detect process privileges

logger=settings t=2023-06-20T17:16:30.75552635Z level=info msg="Starting Grafana" version=10.0.0 commit=81d85ce802 branch=HEAD compiled=2023-06-09T16:45:53Z

logger=settings t=2023-06-20T17:16:30.755729143Z level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead."

logger=settings t=2023-06-20T17:16:30.755750531Z level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini

logger=settings t=2023-06-20T17:16:30.755760318Z level=info msg="Config loaded from" file=/etc/grafana/grafana.ini

logger=settings t=2023-06-20T17:16:30.755769277Z level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"

logger=settings t=2023-06-20T17:16:30.75577791Z level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"

logger=settings t=2023-06-20T17:16:30.755785616Z level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"

logger=settings t=2023-06-20T17:16:30.755793144Z level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"

logger=settings t=2023-06-20T17:16:30.755800668Z level=info msg="Config overridden from command line" arg="default.log.mode=console"

logger=settings t=2023-06-20T17:16:30.755812608Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_DATA=/var/lib/grafana"

logger=settings t=2023-06-20T17:16:30.755821464Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_LOGS=/var/log/grafana"

logger=settings t=2023-06-20T17:16:30.755831116Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_PLUGINS=/var/lib/grafana/plugins"

logger=settings t=2023-06-20T17:16:30.755840268Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_PROVISIONING=/etc/grafana/provisioning"

logger=settings t=2023-06-20T17:16:30.755847986Z level=info msg=Target target=[all]

logger=settings t=2023-06-20T17:16:30.755864124Z level=info msg="Path Home" path=/usr/share/grafana

logger=settings t=2023-06-20T17:16:30.755873242Z level=info msg="Path Data" path=/var/lib/grafana

logger=settings t=2023-06-20T17:16:30.755881047Z level=info msg="Path Logs" path=/var/log/grafana

logger=settings t=2023-06-20T17:16:30.755889126Z level=info msg="Path Plugins" path=/var/lib/grafana/plugins

logger=settings t=2023-06-20T17:16:30.7558967Z level=info msg="Path Provisioning" path=/etc/grafana/provisioning

logger=settings t=2023-06-20T17:16:30.755904605Z level=info msg="App mode production"

logger=sqlstore t=2023-06-20T17:16:30.756057341Z level=info msg="Connecting to DB" dbtype=sqlite3

logger=sqlstore t=2023-06-20T17:16:30.75610365Z level=warn msg="SQLite database file has broader permissions than it should" path=/var/lib/grafana/grafana.db mode=-rwxrw-r-- expected=-rw-r-----

logger=migrator t=2023-06-20T17:16:30.759528531Z level=info msg="Starting DB migrations"

logger=migrator t=2023-06-20T17:16:30.759624956Z level=info msg="Executing migration" id="create migration_log table"

Error: ✗ migration failed (id = create migration_log table): database is locked

Error checking server process execution privilege. error: could not get current OS user to detect process privileges

logger=settings t=2023-06-20T17:16:36.381874252Z level=info msg="Starting Grafana" version=10.0.0 commit=81d85ce802 branch=HEAD compiled=2023-06-09T16:45:53Z

logger=settings t=2023-06-20T17:16:36.382022892Z level=warn msg="\"sentry\" frontend logging provider is deprecated and will be removed in the next major version. Use \"grafana\" provider instead."

logger=settings t=2023-06-20T17:16:36.382039247Z level=info msg="Config loaded from" file=/usr/share/grafana/conf/defaults.ini

logger=settings t=2023-06-20T17:16:36.38204495Z level=info msg="Config loaded from" file=/etc/grafana/grafana.ini

logger=settings t=2023-06-20T17:16:36.382049431Z level=info msg="Config overridden from command line" arg="default.paths.data=/var/lib/grafana"

logger=settings t=2023-06-20T17:16:36.382054364Z level=info msg="Config overridden from command line" arg="default.paths.logs=/var/log/grafana"

logger=settings t=2023-06-20T17:16:36.382058528Z level=info msg="Config overridden from command line" arg="default.paths.plugins=/var/lib/grafana/plugins"

logger=settings t=2023-06-20T17:16:36.382062653Z level=info msg="Config overridden from command line" arg="default.paths.provisioning=/etc/grafana/provisioning"

logger=settings t=2023-06-20T17:16:36.382066835Z level=info msg="Config overridden from command line" arg="default.log.mode=console"

logger=settings t=2023-06-20T17:16:36.382071358Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_DATA=/var/lib/grafana"

logger=settings t=2023-06-20T17:16:36.382075597Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_LOGS=/var/log/grafana"

logger=settings t=2023-06-20T17:16:36.382079702Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_PLUGINS=/var/lib/grafana/plugins"

logger=settings t=2023-06-20T17:16:36.382083823Z level=info msg="Config overridden from Environment variable" var="GF_PATHS_PROVISIONING=/etc/grafana/provisioning"

logger=settings t=2023-06-20T17:16:36.382088091Z level=info msg=Target target=[all]

logger=settings t=2023-06-20T17:16:36.382096951Z level=info msg="Path Home" path=/usr/share/grafana

logger=settings t=2023-06-20T17:16:36.382101435Z level=info msg="Path Data" path=/var/lib/grafana

logger=settings t=2023-06-20T17:16:36.382105596Z level=info msg="Path Logs" path=/var/log/grafana

logger=settings t=2023-06-20T17:16:36.382109792Z level=info msg="Path Plugins" path=/var/lib/grafana/plugins

logger=settings t=2023-06-20T17:16:36.382114017Z level=info msg="Path Provisioning" path=/etc/grafana/provisioning

logger=settings t=2023-06-20T17:16:36.382118355Z level=info msg="App mode production"

logger=sqlstore t=2023-06-20T17:16:36.38225719Z level=info msg="Connecting to DB" dbtype=sqlite3

logger=sqlstore t=2023-06-20T17:16:36.38229347Z level=warn msg="SQLite database file has broader permissions than it should" path=/var/lib/grafana/grafana.db mode=-rwxrw-r-- expected=-rw-r-----

logger=migrator t=2023-06-20T17:16:36.385695867Z level=info msg="Starting DB migrations"

logger=migrator t=2023-06-20T17:16:36.385799867Z level=info msg="Executing migration" id="create migration_log table"

Error: ✗ migration failed (id = create migration_log table): database is locked

Which of the tech stack you are using is new to you?

all of them, I’m not really an expert. I just have a few basic knowledge

So tackle one stack at a time
You are trying to swallow the whole elephant.

What operating system is your laptop of lab server?

Also posting a wall of log files might not be the best idea if you want someone to help you

The other thing is docker is a docker issue you might want to post on a docker forum.

Thanks!, for your advise yosiaz, I mean I’m not an expert, but I have some knowledge. My homelab is proxmox, which contains a virtual machine that in turn runs a Ubuntu server where I’ve installed docker and there is where I’m running a grafana container.

The log that I posted is just the grafana output. And it’s only to see if someone can point me in the right direction. Not sure where is the problem. I just can’t found why database gets locked out of no where

promox
virtual machine
ubuntu
docker

Way too complicated even for advanced users. Keep it simple.

1st get familiar with grafana. So for that just install grafana on your laptop.

Thanks for the advice, it happens that I already tried what you just said, got a few days trying to figure it out. One of the tries was to run Grafana in a container removing the volume, and it runs fine, I even I´ve tried to mount it in the path of the host that has nothing to do with the one mounted from Samba shared and it runs fine, so I´m guessing that has to do something with the permissions on the mounted path, but I cant understand why. I checked the container user permissions over the mounted volume and it has full control there. I even use the volume pointed to user home over the container and then connected to the Grafana container I´ve created a directory, and a file inside it, I edit the file, remove permissions, add permissions again, and everything looks good, but the moment I point the volume to the /var/lib/grafana path, I get the message that says database is locked.

This is unrelated to grafana but more to docker. You might get better traction on a docker forum or slack or discord for that? But someone else might chime in to help in this forum also.

1 Like

Ok, thanks, I already tried some discord channels with no luck