# During update from 13.0.5 to 13.06 database error: SQLSTATE\[23000\]: Integrity constraint violation: 19 UNIQUE constraint failed: oc\_filecache.fileid

**URL:** <https://help.nextcloud.com/t/during-update-from-13-0-5-to-13-06-database-error-sqlstate-23000-integrity-constraint-violation-19-unique-constraint-failed-oc-filecache-fileid/36455>\
**Category:** ℹ️ Support\
**Tags:** update\_problems, nc13\
**Created:** [September 8, 2018, 2:27pm UTC](https://help.nextcloud.com/t/during-update-from-13-0-5-to-13-06-database-error-sqlstate-23000-integrity-constraint-violation-19-unique-constraint-failed-oc-filecache-fileid/36455 "2018-09-08T14:27:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![radoeka](https://help.nextcloud.com/user_avatar/help.nextcloud.com/radoeka/32/5239_2.png) [@radoeka](https://help.nextcloud.com/u/radoeka)\
**Post date:** [September 9, 2018, 6:49pm UTC](https://help.nextcloud.com/t/during-update-from-13-0-5-to-13-06-database-error-sqlstate-23000-integrity-constraint-violation-19-unique-constraint-failed-oc-filecache-fileid/36455/6 "2018-09-09T18:49:21Z")

</div>

Thanks.

For reference:

Before cleanup:

> $ echo “.headers on  
> .mode csv  
> select name, path\_hash from oc\_filecache;” | sqlite3 owncloud.db | wc -l  
> 8633

> $ occ files:cleanup  
> 15 orphaned file cache entries deleted

Files is no reduced to 8621

> $ echo “.headers on &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
> .mode csv  
> select name, path\_hash from oc\_filecache;” | sqlite3 owncloud.db | sort | uniq -c | sort -nr | grep -v " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1" | head -10  
> &nbsp;&nbsp;&nbsp;&nbsp;20 “”,d41d8cd98f00b204e9800998ecf8427e  
> &nbsp;&nbsp;&nbsp;&nbsp;17 files,45b963397aa40d4a0063e0d85e4fe7a1  
> &nbsp;&nbsp;&nbsp;&nbsp;17 cache,0fea6a13c52b4d4725368f24b045ca84  
> &nbsp;&nbsp;&nbsp;&nbsp;10 v0.6.0,f72c70196746fc6912257146fcd84fcf  
> &nbsp;&nbsp;&nbsp;&nbsp;10 lucene\_index,a0c55384eae17768d8f9fe6696efed6e

Not much changed in this respect.

Will do the upgrade later this week.

Would it be possible to completely empty the file\_cache table? It’s a cache after all, as such the entries will be created once accessed again, or is this not the case?

---

_[View the full topic](https://help.nextcloud.com/t/during-update-from-13-0-5-to-13-06-database-error-sqlstate-23000-integrity-constraint-violation-19-unique-constraint-failed-oc-filecache-fileid/36455)._
