nextcloud / nextcloud/previewgenerator
oc_filecache table with inconsistent entries (size = -1)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 520
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
From https://github.com/nextcloud/server/issues/31283 I executed the query
`SELECT DISTINCT f.path, f.size, f.parent FROM oc_filecache AS f INNER JOIN oc_mounts AS m ON m.storage_id = f.storage WHERE size <
0 AND parent > 1 LIMIT 20;
+--------------------------------------------+------+---------+
| path | size | parent |
+--------------------------------------------+------+---------+
| appdata_ocx89t9we96j/preview/0 | -1 | 1057528 |
| appdata_ocx89t9we96j/preview/0/0 | -1 | 1057632 |
| appdata_ocx89t9we96j/preview/0/0/1 | -1 | 1059331 |
| appdata_ocx89t9we96j/preview/0/0/1/6 | -1 | 1065977 |
| appdata_ocx89t9we96j/preview/0/0/1/6/d | -1 | 1065978 |
| appdata_ocx89t9we96j/preview/0/0/1/6/d/1 | -1 | 1065979 |
| appdata_ocx89t9we96j/preview/0/0/1/6/d/1/5 | -1 | 1065980 |
| appdata_ocx89t9we96j/preview/0/0/4 | -1 | 1059331 |
| appdata_ocx89t9we96j/preview/0/0/4/b | -1 | 1080928 |
| appdata_ocx89t9we96j/preview/0/0/4/b/2 | -1 | 1080929 |
| appdata_ocx89t9we96j/preview/0/0/4/b/9 | -1 | 1080929 |
| appdata_ocx89t9we96j/preview/0/0/5 | -1 | 1059331 |
| appdata_ocx89t9we96j/preview/0/0/7 | -1 | 1059331 |
| appdata_ocx89t9we96j/preview/0/0/7/d | -1 | 1063945 |
| appdata_ocx89t9we96j/preview/0/0/7/d/c | -1 | 1063946 |
| appdata_ocx89t9we96j/preview/0/0/7/d/c/c | -1 | 1063947 |
| appdata_ocx89t9we96j/preview/0/0/7/d/c/c/8 | -1 | 1063948 |
| appdata_ocx89t9we96j/preview/0/0/8 | -1 | 1059331 |
| appdata_ocx89t9we96j/preview/0/0/8/1 | -1 | 1074694 |
| appdata_ocx89t9we96j/preview/0/0/8/1/2 | -1 | 1079351 |
+--------------------------------------------+------+---------+
`
Is it true, that all entries with path appdata_/preview/ and size -1 is an inconsistent entry and should be deleted?
If it is true, can you create a function in the previewgenerator which cleans it up automatically or manual with an occ command?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the previewgenerator code and the reported oc_filecache query, then trace any existing occ command entry points. Determine whether the appdata_/preview/ rows with size -1 are invalid and define a safe cleanup path. Done means the behavior is confirmed and an automatic or manual cleanup option is clearly specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, sql
- Domain
- backend, cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100