# Stardog database corruption

**URL:** <https://community.stardog.com/t/stardog-database-corruption/184>\
**Category:** Bug\
**Created:** [March 19, 2017, 10:52am UTC](https://community.stardog.com/t/stardog-database-corruption/184 "2017-03-19T10:52:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [March 19, 2017, 10:52am UTC](https://community.stardog.com/t/stardog-database-corruption/184/1 "2017-03-19T10:52:03Z")

</div>

Hi,

OOM killed Stardog on our test server while we were adding data to Stardog from Java. This caused one of the indexes in Stardog to get corrupted.

```auto
WARN 2017-03-18 07:20:28,509 [main] com.complexible.stardog.db.DatabaseFactoryImpl:read(137): Database testSesame is invalid and the repair failed: Inconsistent index size for POSC; expected=34799909, got= 34799979

```

How is the work on fixing this for v5 coming along? I know I asked about a month ago, but I keep running into this durability issue.

Cheers,  
Håvard

---

<div class="post-metadata">

**Author:** ![evren](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/evren/32/1515_2.png) [@evren](https://community.stardog.com/u/evren)\
**Post date:** [March 21, 2017, 1:01pm UTC](https://community.stardog.com/t/stardog-database-corruption/184/2 "2017-03-21T13:01:58Z")

</div>

Hi Håvard,

We fixed the corruption issue you reported earlier and the fix will be in the 5.0 version (beta release coming out very soon). Can you send us the log file for the corruption in this case so we can take a look?

One note about using Stardog in docker: it is important to wait for the Stardog server to shut down before docker container is stopped. By default docker waits for only 10 seconds for programs to stop and kills them after this timeout. This might not be enough time for Stardog to shut down properly especially if there are large databases and/or frequent transactions. You should increase this timeout to couple minutes to be on the safe side…

Best,  
Evren

---

<div class="post-metadata">

**Author:** ![hmottestad](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/hmottestad/32/19_2.png) [@hmottestad](https://community.stardog.com/u/hmottestad)\
**Post date:** [March 22, 2017, 8:51am UTC](https://community.stardog.com/t/stardog-database-corruption/184/3 "2017-03-22T08:51:01Z")

</div>

Hi Evren,

5.0 is looking better and better 🙂

Since it as our test server we just wiped it and inserted all the data again. So logs are gone unfortunately.

I’ll take a look at changing the timeout. Sounds like a good idea. Thanks.

Cheers,  
Håvard
