Skip to content
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

oc_filecache table with inconsistent entries (size = -1) #500

Open
canchanchara opened this issue Aug 1, 2024 · 3 comments
Open

oc_filecache table with inconsistent entries (size = -1) #500

canchanchara opened this issue Aug 1, 2024 · 3 comments

Comments

@canchanchara
Copy link

From nextcloud/server#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?

@st3iny
Copy link
Member

st3iny commented Aug 1, 2024

No, those are folders and should be kept in the database.

@canchanchara
Copy link
Author

@st3iny I removed the preview directory in appdata_*, as described in https://github.com/nextcloud/previewgenerator?tab=readme-ov-file#i-want-to-resetregenerate-all-previews

I expected, that occ files:scan-app-data will remove all the database entries.

But they still exists.

@Forza-tng
Copy link

Forza-tng commented Aug 5, 2024

I do no think occ files:scan/scan-app-data removes entries from the database when the corresponding file is missing. It means that the Nextcloud db will grow perpetually since there is no official way to prune stale records.

@canchanchara There is another open issue about unscanned (files/dirs with -1 size). It seems rather difficult to find the root cause. Perhaps you are having the same issue? nextcloud/server#43557 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants