Skip to content

Conversation

@rotdrop
Copy link
Contributor

@rotdrop rotdrop commented Nov 25, 2025

The FileSystemListener background job tries to delete events from the queue if the home-dir of the user cannot be found (e.g. because the user account has been removed):

$this->fsEventMapper->delete($fsEvent);

However, this call to FsEventMapper::delete() cannot succeed if the entity id is missing, as is currently the case because ATM FsEventMapper::getFromQueue() omits the id in its result "entities" (which are in fact then only partial entities).

Another way to fix this would be to use FsEventMapper::deleteByContent() instead.

I stumbled over this cause of errors in the NC log like

 NoUserException Backends provided no user object /var/www/orgacloud/nextcloud/lib/private/Files/Node/Root.php:340
Backends provided no user object for [USER_ID]

with stack trace back to

/var/www/orgacloud/nextcloud/apps/context_chat/lib/BackgroundJobs/FileSystemListenerJob.phpZeile 87
OC\Files\Node\LazyRoot->getUserFolder()

As such this is just ok and the effect of trying to access the home-directory of a no-longer existing user, but those messages do not go away, they appear over and over again because that delete attempt from

$this->fsEventMapper->delete($fsEvent);

fails as the data returned by FsEventMapper::getFromQueue() does not include the entity id.

The FileSystemListener background job tries to delete events from the queue if the home-dir of the user cannot be found (e.g. because the user account has been removed):

https://github.com/rotdrop/nextcloud-app-context-chat/blob/f8566e58d3a384d67615163ef0ac4cf13f276746/lib/BackgroundJobs/FileSystemListenerJob.php#L104

However, this call to `FsEventMapper::delete()` cannot succeed if the entity id is missing, as is currently the case because ATM `FsEventMapper::getFromQueue()` omits the id in its result "entities" (which are in fact then only partial entities).

Another way to fix this would be to use `FsEventMapper::deleteByContent()` instead.


Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
@marcelklehr
Copy link
Member

Wow, really nice catch! Thank you for debugging this and providing a fix!

@kyteinsky
Copy link
Contributor

thanks a lot!
The failing CI is being fixed in a different PR.

@kyteinsky kyteinsky merged commit ae7e680 into nextcloud:main Nov 25, 2025
16 of 29 checks passed
@kyteinsky kyteinsky mentioned this pull request Dec 5, 2025
@kyteinsky
Copy link
Contributor

hi @rotdrop
would you be interested in joining the community developer chat room in our instance? The community members and Nextcloud's engineers both share the room, clear their doubts, have discussions, etc.
I can send you a link over email or any other way you prefer.

@github-actions
Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@rotdrop rotdrop deleted the bugfix/events-for-non-existing-users-not-deleted branch December 10, 2025 23:21
@rotdrop
Copy link
Contributor Author

rotdrop commented Dec 10, 2025

hi @rotdrop would you be interested in joining the community developer chat room in our instance? The community members and Nextcloud's engineers both share the room, clear their doubts, have discussions, etc. I can send you a link over email or any other way you prefer.

Yes please, himself@claus-justus-heine.de. Kind thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants