# Database fault tolerance / Docker

**URL:** <https://forum.gitea.com/t/database-fault-tolerance-docker/225>\
**Category:** Install/Maintain/Configure\
**Created:** [March 6, 2018, 10:45am UTC](https://forum.gitea.com/t/database-fault-tolerance-docker/225 "2018-03-06T10:45:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ttk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/ttk/32/4730_2.png) [@ttk](https://forum.gitea.com/u/ttk)\
**Post date:** [March 6, 2018, 10:45am UTC](https://forum.gitea.com/t/database-fault-tolerance-docker/225/1 "2018-03-06T10:45:05Z")

</div>

I have noticed that gitea with a configured MySQL database isn’t very fault tolerant when the database server isn’t available, it fails to start without any error message. While one can talk about the error verbosity, this is generally an acceptable behaviour.

But currently i am migrating my setup to docker. Docker containers have a restart policy, which does not check for dependencies. So my question is, if i deploy gitea via the `gitea/gitea` docker image, and try to start it while the configured MariaDB container hasn’t spun up yet, what is giteas behaviour then? I am assuming a gitea container restart loop until gitea manages to establish a MySQL connection, since gitea as the container’s main executable crashes without the connection, so docker is automatically restarting the container. Is my assumption correct, or will gitea inside the container just crash, while the container lives on, and i have to figure out how to orchestrate the containers accordingly to their dependency?

---

<div class="post-metadata">

**Author:** ![daviian](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/daviian/32/4735_2.png) [@daviian](https://forum.gitea.com/u/daviian)\
**Post date:** [May 3, 2018, 10:33am UTC](https://forum.gitea.com/t/database-fault-tolerance-docker/225/2 "2018-05-03T10:33:09Z")

</div>

I run gitea in a docker swarm. From my experience docker tries to restart the gitea container until the database connection can be established.  
Haven’t implemented any extras. Just the basic gitea and db containers.

Best regards

---

<div class="post-metadata">

**Author:** ![cweickhmann](https://avatars.discourse-cdn.com/v4/letter/c/bc79bd/32.png) [@cweickhmann](https://forum.gitea.com/u/cweickhmann)\
**Post date:** [June 15, 2018, 12:36pm UTC](https://forum.gitea.com/t/database-fault-tolerance-docker/225/3 "2018-06-15T12:36:09Z")

</div>

True, but some sort of error message would be really helpful.  
In my case, the container with the old gitea version runs fine. At some point gitea must have broken backwards compatibility with the database (and it’s not documented _grrrr_) and the only way you find out is because the web frontend isn’t started and the container restarts a gazillion times.  
That’s not exactly maintainer friendly.
