Skip to content

Deleting a preview folder stops writing previews to disk #3041

Description

@nickvergessen

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.

Activity

  1. added this to the Nextcloud 12.0 milestone on Jan 12, 2017
  2. rullzer commented on Jan 12, 2017

    @rullzer
    Member

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

  3. nickvergessen commented on Jan 12, 2017

    @nickvergessen
    MemberAuthor

    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.

  4. rullzer commented on Jan 12, 2017

    @rullzer
    Member

    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.

  5. adduxa commented on Mar 21, 2017

    @adduxa
    Contributor

    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.

  6. added a commit that references this issue on Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions