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

Deleting a preview folder stops writing previews to disk #3041

Closed
nickvergessen opened this issue Jan 12, 2017 · 4 comments
Closed

Deleting a preview folder stops writing previews to disk #3041

nickvergessen opened this issue Jan 12, 2017 · 4 comments

Comments

@nickvergessen
Copy link
Member

Steps to reproduce

  1. Upload an image
  2. Remove the data/appdata_*/preview/{fileid} folder
  3. Reload the page

Expected behaviour

Preview folder should exist again and have the previews saved

Actual behaviour

Previews are displayed but not written to disk

@schiessle as discussed

@rullzer I see potential to fail for administrators there.
I'd also assume that deleting the folder would simply regenerate.

@rullzer
Copy link
Member

rullzer commented Jan 12, 2017

It fails hard because we assume it is there (it is still in the DB). Did you rescan?

@nickvergessen
Copy link
Member Author

No I did not rescan. But that is exactly my point. Most users will not rescan since they see the previews in the UI. It just stops writing them to the disk and will therefor recreate them all the time in memory, fail on writing but still serve it.

@rullzer
Copy link
Member

rullzer commented Jan 12, 2017

I think your previews are just temp cached. If you force refresh they will fail. The thing is that we only know this failed the moment we try to read. Because before that we do it all in the database.

@adduxa
Copy link
Contributor

adduxa commented Mar 21, 2017

It is tricky to rescan preview storage because

occ files:scan --path /appdata_randomid/preview/

leads up to Unknown user 1 appdata_randomid error

But there is workaround:
Since whole root data dir is a regular storage, we can mount it to some user directory as local external storage and scan like

occ files:scan --path /some_user/files/nextcloud_root_mount/appdata_randomid/preview/

UPD:
Warning! DO NOT delete created external mount via web interface, because it will delete all just scanned appdata files from the DB! Instead, delete it manually from oc_mounts table.

So maybe add option to occ files:scan command to rescan just previews? Seems like after all user recognition staff and checks it simply call \OC\Files\Utils\Scanner->scan($path) function with regular string path in the argument so it shouldn't be too hard.

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

No branches or pull requests

3 participants