Skip to content

Recognize results are lost when transferring files to other user #1118

Open

Description

@andreaskoelsch

Which version of recognize are you using?

6.1.1

Enabled Modes

Object recognition, Face recognition

TensorFlow mode

Normal mode

Downstream App

Files App

Which Nextcloud version do you have installed?

28.0.4

Which Operating system do you have installed?

Debian 12

Which database are you running Nextcloud on?

MariaDB 10.11.6

Which Docker container are you using to run Nextcloud? (if applicable)

No response

How much RAM does your server have?

16GB

What processor Architecture does your CPU have?

x86_64

Describe the Bug

When files are transferred from one user to another user via transfer ownership, only the classification results are transferred, face detections are lost. Also, the transferred files are not added to the face detection queue for detecting the faces again.

Expected Behavior

Either keep the face recognition and run the clustering for the new user or re-run both face recognition and clustering after moving the files.

To Reproduce

  • Upload images to one user
  • let recognize do its thing
  • transfer ownership of these images to another user
  • see that face detections are lost and files are not added to face detection queue

Debug log

No response

Activity

  1. github-actions commented on Apr 4, 2024

    @github-actions

    Hello 👋

    Thank you for taking the time to open this issue with recognize. I know it's frustrating when software
    causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at
    and if possible solved.
    I try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it.
    Until then, please be patient.
    Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation
    to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can
    collaborate to make this software better. For everyone.
    Thus, if you can, you could also look at other issues to see whether you can help other people with your knowledge
    and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and
    try to fix the odd bug yourself. Everyone will be thankful for extra helping hands!
    One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum,
    to twitter or somewhere else. But this is a technical issue tracker, so please make sure to
    focus on the tech and keep your opinions to yourself. (Also see our Code of Conduct. Really.)

    I look forward to working with you on this issue
    Cheers 💙

  2. andreaskoelsch commented on Apr 4, 2024

    @andreaskoelsch
    Author

    PS: When moving files to a Group Folder, both face detection and object classification are re-triggered. Is this intended or worth a separate issue?

  3. andreaskoelsch commented on Apr 6, 2024

    @andreaskoelsch
    Author

    It gets even more odd. I just realized, when I move separate files to Group Folders, they are triggered. If I move entire folders, on the other hand, the contained files are not triggered. Pretty sure this is not what's intended

  4. andreaskoelsch commented on Apr 16, 2024

    @andreaskoelsch
    Author

    PPS: Even though the files which are moved separately to Group Folders are reprocessed by recognize, the faces do not show up for the other users, but only for the one who moved them there.

    Current workaround: move the files/folders via the filesystem and re-scan the directories. That way, they are reprocessed and the results show up for all users in the Group Folder.

  5. marcelklehr commented on Apr 16, 2024

    @marcelklehr
    Member

    Hello @andreaskoelsch

    Thank you for this detailed analysis! File transfer to other users is a relatively new feature in nextcloud, so we haven't integrated with this feature yet. I'll also look into the other issues you found.

  6. andreaskoelsch commented on Apr 18, 2024

    @andreaskoelsch
    Author

    Great, looking forward to testing it 😊

  7. andreaskoelsch commented on May 23, 2024

    @andreaskoelsch
    Author

    I just found the time to test this today. Seems, it's still not fixed, as the face clustering is not triggered. When I move a file from my personal space to a group folder, it gets added to the classify and face recognitiion queues. However, after the predictions, the detected faces are not added to the clustering. In my own profile, the face recognition works, because it was already detected before moving the file to the group folder. However, other users of the group folder do not get a face recognition

  8. added a commit that references this issue on May 27, 2024
    8b214da
  9. marcelklehr commented on May 27, 2024

    @marcelklehr
    Member

    Mh, that may be because group folders are not technically shares, while I've been using the share manager to enumerate users with access. I'll change that to use the mount cache instead...

  10. marcelklehr commented on Jun 18, 2024

    @marcelklehr
    Member

    Hey @andreaskoelsch
    I've prepared a beta version with a potential fix. Could you try this https://github.com/nextcloud/recognize/releases/tag/v7.0.2-beta.1 and report back here?

  11. andreaskoelsch commented on Jun 18, 2024

    @andreaskoelsch
    Author

    Yes, we're almost there ;-) Thanks for the beta, I just tested it by uploading a picture of myself and moving it to a group folder. What happened after moving the file:

    • re-triggered face and imagenet classification
    • found face
    • 1 face left for clustering, planned tasks: 0

    So, what's left is that the clustering needs to trigger a new task after the face detection.

    Also, what I found not ideal: After moving the file to the group folder, the classification labels are already available for both users before the imagenet executes again. It seems, they are already transferred with the file and another imagenet execution could be avoided for energy efficiency. Also, this makes me wonder if it would maybe be possible to transfer the face detection in a similar way, so the other group users would only need to run the clustering of the newly available faces instead of having to re-run the face detection. However, face detection is cheap, so if this is hard to implement, I won't complain

  12. marcelklehr commented on Jun 19, 2024

    @marcelklehr
    Member

    No new classification should be run when moving files :/ Are you sure that another face classification is run on the file? The face detection should just be copied.

  13. 32 remaining items

  14. andreaskoelsch commented on Sep 2, 2024

    @andreaskoelsch
    Author

    Thanks for the message, it's alright for me. At least it works now by moving files instead of folders, so there is a simple workaround for the issue

  15. marcelklehr commented on Dec 2, 2025

    @marcelklehr
    Member

    This was fixed with Nextcloud 32.

  16. moved this from Bugs to Done in Recognizeon Dec 2, 2025
  17. andreaskoelsch commented on Dec 17, 2025

    @andreaskoelsch
    Author

    No new classification should be run when moving files :/ Are you sure that another face classification is run on the file? The face detection should just be copied.

    I think, this issue was re-introduced with NC 32. Did not test it with a ownership transfer, but by moving a file to a group folder. face detection and classification get retriggered.

  18. marcelklehr commented on Dec 18, 2025

    @marcelklehr
    Member

    It depends a bit on how the move is realized internally, I think. If the move is done by copying and deleting the old node, then there is nothing recognize can do, I think.

  19. andreaskoelsch commented on Dec 19, 2025

    @andreaskoelsch
    Author

    I just checked again with a few files.

    • Uploaded to my account. Face and object detection run.
    • Move to group folder
    • Face and object detection run again

    However, interestingly the object classes are already available for all the group folder users, so they are transferred over correctly. But then wrongly added to the queue.
    Also the face detections seem to be copied over to the other users, because the cluster queue is already filled before the face detection is run again.

    I'll open an issue on group folders to understand if this double detection runs can be avoided.

  20. andreaskoelsch commented on Sep 21, 2026

    @andreaskoelsch
    Author

    Just wanted to check in again on this issue. Current behavior: Both face and object detection run when I upload files. After I move the files to a group folder, they run again. However, face detections are only visible in the user account who uploaded the files, not in other accounts who are part of the shared folders.

    I remember in earlier versions, face clustering was re-running for all users with file access. now, clustering is not re-running after moving files to a shared folder.

    I just checked when this first occurred which was in January this year for me. I'm not always super fast with updates, but maybe this is a hint

  21. marcelklehr commented on Sep 23, 2026

    @marcelklehr
    Member

    Hi @andreaskoelsch
    I'm sorry we haven't made much progress here. I will try to tackle this again.

  22. marcelklehr commented on Sep 23, 2026

    @marcelklehr
    Member

    Could you try the following patch? #1569

  23. andreaskoelsch commented on Sep 23, 2026

    @andreaskoelsch
    Author

    Thanks for your response, much appreciated! I'll create a new nextcloud instance to test this as I don't want to mess with my productive one. Will take a few days to try this.

  24. marcelklehr commented on Sep 24, 2026

    @marcelklehr
    Member

    Ah, sorry. I've revised the patch a bit more. Here is the new PR: #1572

  25. andreaskoelsch commented on Oct 3, 2026

    @andreaskoelsch
    Author

    I just set up a new nextcloud instance. It's a nextcloud 35.0.1 with recognize 13.1.0. Is this patch intended for this version? I think, I messed something up because I now cannot even move files to a group folder anymore in this instance.

    Cannot use try without catch or finally at /var/www/nextcloud/apps/recognize/lib/Db/FsActionMapper.php#240

    In my productive instance, I meanwhile updated to nextcloud 35.0.1, too. There, it now seems, that other users have lost most face recognitions from the group folders :-/

  26. andreaskoelsch commented on Oct 22, 2026

    @andreaskoelsch
    Author

    I just had some time and tried it again, with success!

    • Fresh nextcloud install version 35.0.2
    • recognize patched with fix(FileListener): Queue move actions correctly and fix FsActionMapper #1568
    • Team Folders 23.0.1
    • Two users in the same group, sharing a team folder
    • Uploaded ~300 photos to user1. Recognize classified and clustered faces and objects as expected
    • Moved the photos to the teams folder
    • All files are processed by recognize again
    • both users have the face clusters and object tags

    IIRC, In some version way back the files were not reprocessed, but the classification results were copied over instead. That would be nice to save some compute power, but is not super crucial.

    Something I could not test yet, but I am wondering - maybe you could answer that. Since recently, the face recognitions of photos are only available for the person who uploaded the photos, i.e. the recognitions that were there before for all users are now deleted except for one of them. Would this patch also bring these recognitions of existing files back for all users?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions