Skip to content

watchfs: PROPFIND still returns old filename after file renamed on filesystem #1810

Open

Description

@v-scharf

Describe the bug

#1809
run test OC_WRAPPER_URL=http://opencloud-server:5200 TEST_SERVER_URL=https://opencloud-server:9200 make test-acceptance-api BEHAT_FEATURE=tests/acceptance/features/collaborativePosix/collaborativePosixFS.feature:81

Steps to reproduce

  1. user creates file new.txt
  2. admin renames file to renamed.txt on filesystem
  3. user request propfind

Expected behavior

file is renamed, user can open file

Actual behavior

user sees old file new.txt on web (in propfind response body). user cannot open file because file is not exist
see comment #1806 (comment)

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

Details

OC_XXX=somevalue
OC_YYY=somevalue
PROXY_XXX=somevalue

Additional context

Add any other context about the problem here.

Activity

  1. moved this from Qualification to Prio 2 in OpenCloud Team Boardon Nov 10, 2025
  2. rhafer commented on Nov 10, 2025

    @rhafer
    Member

    I guess this is at least somewhat related to #1763. So I'll assign this to myself for now as I am working on the other issue already.

  3. self-assigned this
    on Nov 10, 2025
  4. moved this from Prio 2 to In Progress in OpenCloud Team Boardon Nov 10, 2025
  5. changed the title [-]PROPFIND still returns old filename after file renamed on filesystem[/-] [+]watchfs: PROPFIND still returns old filename after file renamed on filesystem[/+] on Nov 18, 2025
  6. rhafer commented on Nov 26, 2025

    @rhafer
    Member

    I can still reproduce this one. Even with that latest reva changes. 😢

    using this "simple" command:

    curl -kv -u admin:admin 'https://localhost:9200/remote.php/dav/files/admin/test.txt'  -X PUT --data '12345678'; mv test.txt test.md ; curl -k -u admin:admin 'https://localhost:9200/remote.php/dav/files/admin/'  -X PROPFIND | xmllint --format -
    

    The propfind output still contains the old name. The file on disk is named test.md but the name property in the xattrs is test.txt

  7. v-scharf commented on Nov 26, 2025

    @v-scharf
    ContributorAuthor

    I can still reproduce this one. Even with that latest reva changes. 😢

    https://ci.opencloud.eu/repos/3/pipeline/755/82
    I see that test is green.

    Scenario: check propfind after rename file                                                                           # /woodpecker/src/github.com/opencloud-eu/opencloud/tests/acceptance/features/collaborativePosix/collaborativePosixFS.feature:81
        Given user "Alice" has uploaded file with content "content" to "test.txt"                                          # FeatureContext::userHasUploadedAFileWithContentTo()
        When the administrator renames the file "test.txt" to "new-name.txt" for user "Alice" on the POSIX filesystem      # CliContext::theAdministratorRenamesFile()
        Then the command should be successful                                                                              # CliContext::theCommandShouldBeSuccessful()
        When user "Alice" sends PROPFIND request to space "Personal" using the WebDAV API                                  # SpacesContext::userSendsPropfindRequestToSpaceUsingTheWebdavApi()
        Then the HTTP status code should be "207"                                                                          # FeatureContext::thenTheHTTPStatusCodeShouldBe()
        And as user "Alice" the PROPFIND response should contain a resource "new-name.txt" with these key and value pairs: # SpacesContext::asUsertheXMLResponseShouldContainMountpointWithTheseKeyAndValuePair()
          | key            | value                     |
          | oc:fileid      | %file_id_pattern%         |
          | oc:name        | new-name.txt              |
          | oc:permissions | RDNVWZP                   |
          | oc:privatelink | %base_url%/f/[0-9a-z-$%]+ |
          | oc:size        | 7                         |
    

    maybe we need wait 2-3 sec before request PROPFIND?

  8. rhafer commented on Nov 27, 2025

    @rhafer
    Member

    I can still reproduce this one. Even with that latest reva changes. 😢

    https://ci.opencloud.eu/repos/3/pipeline/755/82 I see that test is green.

    Yes and no. The test that failed in the last run (collaborativePosix/collaborativePosixFS.feature:159) is similar in some regards, so there is definitely a problem with renaming.

    Scenario: check propfind after rename file                                                                           # /woodpecker/src/github.com/[..]
    

    maybe we need wait 2-3 sec before request PROPFIND?

    Yes, adding some sleeps helps. But without that we end up with a corrupted node. It stays broken and the file cannot be downloaded anymore (even after a restart). That should actually never happen.

  9. added
    Priority:p3-medium
    and removed
    Priority:p2-high
    on Nov 27, 2025
  10. rhafer commented on Nov 27, 2025

    @rhafer
    Member

    Moving this to Prio3 as we agreed that this is not release-critical.

  11. removed their assignment
    on Mar 25, 2026
  12. moved this from In Progress to Prio <= 3 in OpenCloud Team Boardon Mar 25, 2026
  13. NickWalters commented on Oct 14, 2026

    @NickWalters
    Contributor

    opencloud-eu/reva#808 (still open) helps with one part of this. It makes the scan at startup re-assimilate an item when its name or parent on disk differs from its metadata. So a file renamed on disk gets its new name after a restart, provided the id cache still has the old path.

    It doesn't cover every case. If the id cache already points at the new path but the name xattr still has the old one, the scan leaves the old name. I tested both cases. It also doesn't fix the race between the watcher and a PROPFIND that comes right after the rename.

  14. NickWalters commented on Oct 14, 2026

    @NickWalters
    Contributor

    Correction to my last comment: opencloud-eu/reva#808 now covers the other case too. With ed2114edd, a scan also fixes a file whose name xattr is still the old one when the id cache already points at the new path. The race between the watcher and a PROPFIND right after the rename is still not fixed.

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