New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Image won't start - Starting DB Migration #13630
Comments
Additional info - I did see a forum thread about permissions to the files. I updated the permissions to the folder and files so they are now Grafana:grafana again. Still stuck Starting DB Migration |
Looks like I have another container behaving the same. Grafana becomes unavailable. If I log into the container: service grafana-server status[FAIL] grafana is not running ... failed! If I start it, it says it starts successfully, but I have the exact same "Starting DB Migration" status it's stuck on too. |
Must be some issue with the volume, either the sqlite3 db is locked or corrupt or something is blocking access. We have no other reports like this: Check out this guide: Also try upgrading to v5.3 |
Not sure where a lock would possibly come from. The database is stored in a persistent volume, only mounted to this container. I highly doubt two different Grafana databases would go corrupt at the same time. And one of the Grafana containers is only running 5.0.0, and has never been restarted since it was brought online 8/29/18, so nothing has changed there. In both instances, everything was working fine, then it wasn't. When I investigated, the logs showed no errors at all, but the service was stopped and marked failed. |
well something is causing io timeouts for trying to read or write to DB. |
Well I can take the NFS mount that the grafana.db file is living on, which is currently mounted in the container and supposedly being used by grafana (service is started), mount the nfs volume on my Mac, open the database, read it and write to it without a problem. So nothing is locking it. |
Sqlite3 and NFS is knows for creating locking issues, see https://www.sqlite.org/faq.html#q5. |
So proving the dB is valid and not being locked by something else doesn't mean anything to you. The article you point to references not being able to lock the dB for writing which has never been an issue since there has only ever been a single process accessing the database. I can see that there is no help here. |
Did you use a different version of Grafana before v5.1.0? Was thinking of the docker changes we did for v5.1.0, see documentation. |
One one, yes, I upgraded from 5.0 and fixed the permissions issues on the persistent volume. The other hasn't changed from 5.0 from the day it was brought up. The container was never restarted, uptime is 35 days. No network, hardware or storage interruptions. It just randomly stopped after the container was up and working for a few weeks. |
Thanks. You're sure that your Grafana containers not are using the same persistent volume and basically reading/writing to the same sqlite database? Would suggest you to turn on debug logging and see if you get any more information from the Grafana server log. |
I'm 100% positive. They are in separate volumes. They serve different applications. I'll have to figure out how to get the debug logging on. There's no way to edit the file from within the container. |
Well isn't this fun. I set the environment variable GF_LOG_LEVEL=debug per documentation. The log says: lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_LOG_LEVEL=debug" I can echo the variable from the console. Yet it's still only giving Info level messages. |
Not sure it helps, but if I run Grafana-server from the console, wait for it to "hang" then terminate the process, here's the output:
|
Instead of running Grafana-server from the console can you run the grafana-cli and reset the admin password - that will also trigger the database migration and it will do it without anything else interfering. If you haven't changed admin password you can provide the default grafana-cli admin reset-admin-password <admin password> |
Hangs in exactly the same spot
|
Strange, something is locking your SQLite db file, can you download sqlite3 and try to open the db file and read from user table? |
Well I can take the NFS mount that the grafana.db file is living on, which is currently mounted in the container and supposedly being used by grafana (service is started), mount the nfs volume on my Mac, open the database, read it and write to it without a problem. |
Can you do the same from within the container? |
The container doesn't have sqlite3 in it. |
I also started a docker instance of the newest grafana 5.3. Yesterday it worked fine, today I can't reach the application anymore with the browser. The container is still running, and when using
|
That looks like it's up and running on port 3000. |
Yes, looks like it. But it is not.
…On 31 October 2018 11:37:24 Max DiOrio ***@***.***> wrote:
That looks like it's up and running on port 3000.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Did you map the port from the host into the container?
Sent from my iPhone
On Oct 31, 2018, at 7:04 AM, Matthias Dunkel <notifications@github.com<mailto:notifications@github.com>> wrote:
Yes, looks like it. But it is not.
On 31 October 2018 11:37:24 Max DiOrio ***@***.******@***.***>> wrote:
That looks like it's up and running on port 3000.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#13630 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AYqGJBgM2I-PEnVYaM8gOuYmmIa7WlmFks5uqYOmgaJpZM4XX76G>.
|
Yes, it worked yesterday, perfectly reachable. And then it suddently
stopped working. I did not change anything (I know how this sounds, but
it's true)
…On 31 October 2018 12:31:47 Max DiOrio ***@***.***> wrote:
Did you map the port from the host into the container?
Sent from my iPhone
On Oct 31, 2018, at 7:04 AM, Matthias Dunkel
***@***.******@***.***>> wrote:
Yes, looks like it. But it is not.
On 31 October 2018 11:37:24 Max DiOrio
***@***.******@***.***>> wrote:
> That looks like it's up and running on port 3000.
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on
GitHub<#13630 (comment)>,
or mute the
thread<https://github.com/notifications/unsubscribe-auth/AYqGJBgM2I-PEnVYaM8gOuYmmIa7WlmFks5uqYOmgaJpZM4XX76G>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
But the log time stamp is from the 31st, so the container must have restarted at some point today. Maybe restart the container. Either way, you should probably be posting this as a new question because it doesn't relate to my original question. |
So I found the issue with my original question. There was actually a bug we were running into with the NetApp firmware that was exhausting the locks allowed for the host. That's why it worked fine from another host. We upgraded the firmware per NetApp support and all is well again. |
Closing this since the issue have been solved |
What Grafana version are you using? 5.1.0
What OS are you running grafana on? Docker Image
Using a sqlite3 database. Everything was up and running and working fine for weeks. I went back to it today to pick up where I left off, and I couldn't access anything. Since I am using persistent storage, I reset the container, and now it's stuck "Starting DB Migration". I see that the persistent volume is still mounted to /var/lib/grafana
-rw-r--r-- 1 104 107 1.9M Sep 10 13:36 grafana.db
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Starting Grafana" logger=server version=5.1.0 commit=844bdc53a compiled=2018-04-26T15:09:23+0000
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from command line" logger=settings arg="default.log.mode=console"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_DATA=/var/lib/grafana"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_LOGS=/var/log/grafana"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PLUGINS=/var/lib/grafana/plugins"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_PATHS_PROVISIONING=/etc/grafana/provisioning"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_SECURITY_ADMIN_USER=admin"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_SECURITY_ADMIN_PASSWORD=*********"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_AUTH_ANONYMOUS_ENABLED=true"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Config overridden from Environment variable" logger=settings var="GF_AUTH_BASIC_ENABLED=true"
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Path Plugins" logger=settings path=/var/lib/grafana/plugins
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="App mode production" logger=settings
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Initializing DB" logger=sqlstore dbtype=sqlite3
10/11/2018 12:21:29 PM t=2018-10-11T16:21:29+0000 lvl=info msg="Starting DB migration" logger=migrator
The text was updated successfully, but these errors were encountered: