Skip to content

[Bug]: System tag assignment silently fails after tagged file is deleted #64446

Description

@vunky-himawan

⚠️ This issue respects the following points: ⚠️

  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.

Bug description

When a tag has been assigned to a file or folder, and that file/folder is subsequently deleted, attempting to assign the same system tag to a different file afterwards fails silently (no visible error in the UI). The tag assignment simply does not take effect.

The only workarounds found so far are:

  1. Restore the deleted file/folder from the trash, unassign the tag from it, and then the tag can be assigned to the new file normally, or
  2. Delete the tag entirely via the admin Tags settings and recreate a new tag with the same name.

This suggests a stale row is left behind in oc_systemtag_object_mapping referencing the deleted file's fileid/tagid pair, which blocks or conflicts with new assignments of the same tag.

Steps to reproduce

  1. Create a new tag (e.g. "Test").
  2. Assign the tag to a file or folder (File A).
  3. Delete File A (send it to trash, or permanently delete it).
  4. Try to assign the same tag ("Test") to a different file (File B).
  5. The assignment fails — the tag does not get applied to File B.

Expected behavior

Deleting a tagged file should not affect the ability to assign the same tag to other, unrelated files. The tag assignment mapping for the deleted file should either be cleaned up automatically, or at minimum not interfere with tagging other files.

Nextcloud Server version

33

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.5

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Activity

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions