Grafan with Azure File Share

Hi All,
Have anyone tried using Azure File share as grafana storage? When I configure grafana to use Azure File share as the sqlite3 database storage which is mounted on a linux host where grafana is installed, I get following error while accessing grafana home page.
“chtimes /mnt/grafstorage/data/sessions/e/d/edc304c295505d2e: operation not permitted”"

A log snippet is pasted below. (Azure support didn’t notice any issues on their side for this)
t=2018-09-17T08:06:32+0000 lvl=info msg=“HTTP Server Listen” logger=http.server address=0.0.0.0:3010 protocol=http subUrl= socket=
t=2018-09-17T08:06:54+0000 lvl=eror msg=“Failed to start session” logger=context error=“chtimes /mnt/grafstorage/data/sessions/e/d/edc304c295505d2e: operation not permitted”
t=2018-09-17T08:06:54+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=198.134.56.85 time_ms=244 size=29 referer=
t=2018-09-17T08:06:55+0000 lvl=eror msg=“Failed to start session” logger=context error=“chtimes /mnt/grafstorage/data/sessions/e/7/e7839f8ae4c54a9b: operation not permitted”
t=2018-09-17T08:06:55+0000 lvl=info msg=“Request Completed” logger=context userId=0 orgId=0 uname= method=GET path=/login status=302 remote_addr=198.134.56.85 time_ms=382 size=24 referer=
t=2018-09-17T08:06:55+0000 lvl=eror msg=“Failed to start session” logger=context error=“chtimes /mnt/grafstorage/data/sessions/2/8/2839edbc0309da1c: operation not permitted”

Any help will be appreciated.

seems to have errors creating the session store files.

Hi Torkel, I reached out to Azure team and they didn’t notice any errors creating files. Can it be something to do with chtimes operation?

Hello, I have a similar (but not entirely the same) issue. I basically followed the steps outlined on

When trying to start the container, it fails. Logs show the following :
t=2018-10-09T14:20:30+0000 lvl=info msg=“Starting Grafana” logger=server version=5.2.4 commit=0bbac5c compiled=2018-09-07T14:35:16+0000
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config loaded from” logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config loaded from” logger=settings file=/etc/grafana/grafana.ini
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.data=/var/lib/grafana”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.logs=/var/log/grafana”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.plugins=/var/lib/grafana/plugins”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.paths.provisioning=/etc/grafana/provisioning”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from command line” logger=settings arg=“default.log.mode=console”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from Environment variable” logger=settings var=“GF_PATHS_DATA=/var/lib/grafana”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from Environment variable” logger=settings var=“GF_PATHS_LOGS=/var/log/grafana”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from Environment variable” logger=settings var=“GF_PATHS_PLUGINS=/var/lib/grafana/plugins”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Config overridden from Environment variable” logger=settings var=“GF_PATHS_PROVISIONING=/etc/grafana/provisioning”
t=2018-10-09T14:20:30+0000 lvl=info msg=“Path Home” logger=settings path=/usr/share/grafana
t=2018-10-09T14:20:30+0000 lvl=info msg=“Path Data” logger=settings path=/var/lib/grafana
t=2018-10-09T14:20:30+0000 lvl=info msg=“Path Logs” logger=settings path=/var/log/grafana
t=2018-10-09T14:20:30+0000 lvl=info msg=“Path Plugins” logger=settings path=/var/lib/grafana/plugins
t=2018-10-09T14:20:30+0000 lvl=info msg=“Path Provisioning” logger=settings path=/etc/grafana/provisioning
t=2018-10-09T14:20:30+0000 lvl=info msg=“App mode production” logger=settings
t=2018-10-09T14:20:30+0000 lvl=info msg=“Initializing SqlStore” logger=server
t=2018-10-09T14:20:30+0000 lvl=info msg=“Connecting to DB” logger=sqlstore dbtype=sqlite3
t=2018-10-09T14:20:30+0000 lvl=info msg=“Starting DB migration” logger=migrator
t=2018-10-09T14:20:30+0000 lvl=info msg=“Executing migration” logger=migrator id=“create migration_log table”
t=2018-10-09T14:20:36+0000 lvl=eror msg=“Server shutdown” logger=server reason=“Service init failed: Migration failed err: database is locked”

Looking on the file share, I see some files have been created. (a plugins folder and grafana.db) So it seems grafana can create the database, but not update it for some reason ?

Using Azure container instances, loading grafana/grafana

Hi, did anyone find an answer to this? I am having the same issues using grafana in an Azure Container Group…

Using version 5.0.4 (ie pre-user ID change etc documented at http://docs.grafana.org/installation/docker/ ) I am able to change to the Azure Files mount point in the grafana container without issue. Container is running using user ID 0.

Using version 5.2.3 (ie post-user ID changes) I can see that the Grafana container is using user ID 472 and as that user I am unable to change to the Azure Files mount point - I get a permission denied…

Unfortunately it seems that none of the suggested ways of overcoming the user ID change (either running as a different user or changing permissions) are feasible within Azure - I can’t specify the user that the container should run as, nor does the Azure equivalent of the “docker run -ti” command (ie “az container exec”) support the ability to specify a user to update the permissions. I also note that from https://hub.docker.com/r/grafana/grafana/, with 5.1.0 the “chown” utility has been moved from the container, so even if I was able to update the permissions, I would not be able to change the owner.

Any input greatly appreciated!

Same here, I ended up using MySQL instead of Sqlite to workaround the issue.

I stopped looking into it and also moved to mysql, however i think it has something to do with Go chtime function doesn’t work with symlink. Not sure as don’t have much exposure with Go.

Thanks for the update, that’s what I have also been looking at - however not having much luck running MySQL in a container in ACI…

Which MySQL version/image did you use and did you get this to use Azure files as a persistent data store?

Hi,
I am not using mysql in a container but using Azure Database for Mysql.

I am also running into the same issue how did you configure a MY SQL backend.

Hi Lennay,
Sorry for late reply. I hope you have figured it out by now but if not, you can follow steps provided in : http://docs.grafana.org/v3.1/installation/configuration/#database

(I am using Azure Mysql Service as mysql database)
Following parameters need to be changed.
type = mysql
host = .mysql.database.azure.com:3306
name = grafana (or the database name u are using)
user =
password =

Hi,

Not sure if anyone is still experiencing this problem but by using the bitnami MySQL container, and incorporating that in to the same container group as the Grafana container, I have got Grafana 6.0.0-beta2 running as a container in Azure with persisted data volumes.

If you need any more info let me know…