Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: deleting file fails with 423: Locked #42306

Closed
5 of 8 tasks
Tracked by #3888
max-nextcloud opened this issue Dec 15, 2023 · 13 comments
Closed
5 of 8 tasks
Tracked by #3888

[Bug]: deleting file fails with 423: Locked #42306

max-nextcloud opened this issue Dec 15, 2023 · 13 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug

Comments

@max-nextcloud
Copy link
Contributor

⚠️ This issue respects the following points: ⚠️

Bug description

An attachment test is failing in the text app CI for a while now. Similar failures happen in the groupfolders CI.

When trying to delete a file that was created by the same test the server responds with:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>OCA\DAV\Connector\Sabre\Exception\FileLocked</s:exception>
  <s:message>"deleteMe.md" is locked</s:message>
</d:error>

Steps to reproduce

	before(() => {
		cy.createUser(user)
	})

	it('deletes file just fine', () => {
		cy.login(user)
		const fileName = 'deleteMe.md'
		cy.createFile(fileName, '# Hello world!', 'text/markdown')
		cy.visit('/apps/files')
		cy.getFile(fileName)
			.should('exist')
		cy.deleteFile(fileName)  // this fails as reported above.
		cy.reloadFileList()
	})

deleteFile triggers a DELETE on http://localhost:8081/remote.php/webdav/deleteMe.md.

Expected behavior

Delete works fine.

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

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

Configuration report

No response

List of activated Apps

Enabled:
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - lookup_server_connector: 1.16.0
  - oauth2: 1.16.3
  - provisioning_api: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - admin_audit: 1.18.0
  - encryption: 2.16.0
  - files_external: 1.20.0
  - testing: 1.18.0
  - user_ldap: 1.19.0

Nextcloud Signing status

No response

Nextcloud Logs

{
  "reqId": "NAIfRhXUWkENynwMPe92",
  "level": 3,
  "time": "2023-12-13T21:56:50+00:00",
  "remoteAddr": "127.0.0.1",
  "user": "nkdpiq",
  "app": "webdav",
  "method": "DELETE",
  "url": "/remote.php/webdav/deleteSource.md",
  "message": "\"deleteSource.md\" is locked",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/13.6.1 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36",
  "version": "29.0.0.2",
  "exception": {
    "Exception": "OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked",
    "Message": "\"deleteSource.md\" is locked",
    "Code": 0,
    "Trace": [
      {
        "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 185,
        "function": "delete",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 281,
        "function": "delete",
        "class": "Sabre\\DAV\\Tree",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpDelete",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php",
        "line": 88,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/home/runner/work/text/text/remote.php",
        "line": 172,
        "args": [
          "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/home/runner/work/text/text/apps/dav/lib/Connector/Sabre/File.php",
    "Line": 552,
    "Previous": {
      "Exception": "OCP\\Lock\\LockedException",
      "Message": "\"deleteSource.md\" is locked",
      "Code": 0,
      "Trace": [
        {
          "file": "/home/runner/work/text/text/lib/private/Files/View.php",
          "line": 1150,
          "function": "changeLock",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/lib/private/Files/View.php",
          "line": 702,
          "function": "basicOperation",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/apps/dav/lib/Connector/Sabre/File.php",
          "line": 543,
          "function": "unlink",
          "class": "OC\\Files\\View",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Tree.php",
          "line": 185,
          "function": "delete",
          "class": "OCA\\DAV\\Connector\\Sabre\\File",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
          "line": 281,
          "function": "delete",
          "class": "Sabre\\DAV\\Tree",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
          "line": 89,
          "function": "httpDelete",
          "class": "Sabre\\DAV\\CorePlugin",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 472,
          "function": "emit",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 253,
          "function": "invokeMethod",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 321,
          "function": "start",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php",
          "line": 88,
          "function": "exec",
          "class": "Sabre\\DAV\\Server",
          "type": "->"
        },
        {
          "file": "/home/runner/work/text/text/remote.php",
          "line": 172,
          "args": [
            "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/home/runner/work/text/text/lib/private/Files/View.php",
      "Line": 1984,
      "Previous": {
        "Exception": "OCP\\Lock\\LockedException",
        "Message": "\"files/0e2cb9c4e844fb3a76adacb4fea9b781\"(\"files/deleteSource.md\") is locked",
        "Code": 0,
        "Trace": [
          {
            "file": "/home/runner/work/text/text/lib/private/Files/Storage/Wrapper/Wrapper.php",
            "line": 629,
            "function": "changeLock",
            "class": "OC\\Files\\Storage\\Common",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/lib/private/Files/Storage/Wrapper/Wrapper.php",
            "line": 629,
            "function": "changeLock",
            "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/lib/private/Files/View.php",
            "line": 1978,
            "function": "changeLock",
            "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/lib/private/Files/View.php",
            "line": 1150,
            "function": "changeLock",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/lib/private/Files/View.php",
            "line": 702,
            "function": "basicOperation",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/apps/dav/lib/Connector/Sabre/File.php",
            "line": 543,
            "function": "unlink",
            "class": "OC\\Files\\View",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Tree.php",
            "line": 185,
            "function": "delete",
            "class": "OCA\\DAV\\Connector\\Sabre\\File",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
            "line": 281,
            "function": "delete",
            "class": "Sabre\\DAV\\Tree",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
            "line": 89,
            "function": "httpDelete",
            "class": "Sabre\\DAV\\CorePlugin",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 472,
            "function": "emit",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 253,
            "function": "invokeMethod",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 321,
            "function": "start",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php",
            "line": 88,
            "function": "exec",
            "class": "Sabre\\DAV\\Server",
            "type": "->"
          },
          {
            "file": "/home/runner/work/text/text/remote.php",
            "line": 172,
            "args": [
              "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/home/runner/work/text/text/lib/private/Files/Storage/Common.php",
        "Line": 833,
        "Previous": {
          "Exception": "OCP\\Lock\\LockedException",
          "Message": "\"files/0e2cb9c4e844fb3a76adacb4fea9b781\" is locked",
          "Code": 0,
          "Trace": [
            {
              "file": "/home/runner/work/text/text/lib/private/Files/Storage/Common.php",
              "line": 831,
              "function": "changeLock",
              "class": "OC\\Lock\\DBLockingProvider",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/lib/private/Files/Storage/Wrapper/Wrapper.php",
              "line": 629,
              "function": "changeLock",
              "class": "OC\\Files\\Storage\\Common",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/lib/private/Files/Storage/Wrapper/Wrapper.php",
              "line": 629,
              "function": "changeLock",
              "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/lib/private/Files/View.php",
              "line": 1978,
              "function": "changeLock",
              "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/lib/private/Files/View.php",
              "line": 1150,
              "function": "changeLock",
              "class": "OC\\Files\\View",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/lib/private/Files/View.php",
              "line": 702,
              "function": "basicOperation",
              "class": "OC\\Files\\View",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/apps/dav/lib/Connector/Sabre/File.php",
              "line": 543,
              "function": "unlink",
              "class": "OC\\Files\\View",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Tree.php",
              "line": 185,
              "function": "delete",
              "class": "OCA\\DAV\\Connector\\Sabre\\File",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
              "line": 281,
              "function": "delete",
              "class": "Sabre\\DAV\\Tree",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
              "line": 89,
              "function": "httpDelete",
              "class": "Sabre\\DAV\\CorePlugin",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
              "line": 472,
              "function": "emit",
              "class": "Sabre\\DAV\\Server",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
              "line": 253,
              "function": "invokeMethod",
              "class": "Sabre\\DAV\\Server",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/3rdparty/sabre/dav/lib/DAV/Server.php",
              "line": 321,
              "function": "start",
              "class": "Sabre\\DAV\\Server",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php",
              "line": 88,
              "function": "exec",
              "class": "Sabre\\DAV\\Server",
              "type": "->"
            },
            {
              "file": "/home/runner/work/text/text/remote.php",
              "line": 172,
              "args": [
                "/home/runner/work/text/text/apps/dav/appinfo/v1/webdav.php"
              ],
              "function": "require_once"
            }
          ],
          "File": "/home/runner/work/text/text/lib/private/Lock/DBLockingProvider.php",
          "Line": 214
        }
      }
    },
    "message": "\"deleteSource.md\" is locked",
    "exception": {},
    "CustomMessage": "\"deleteSource.md\" is locked"
  }
}

Additional info

The logs were optained by making the FileLocked error fatal:
https://github.com/nextcloud/server/pull/42253/files

@max-nextcloud max-nextcloud added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Dec 15, 2023
@max-nextcloud
Copy link
Contributor Author

I find it interesting that the innermost exception complains about the entire storage being locked:

          "Message": "\"files/0e2cb9c4e844fb3a76adacb4fea9b781\" is locked",

@max-nextcloud
Copy link
Contributor Author

Bisecting the issue pointed me to #41010 - which is odd as it only contains frontend changes.

Never the less 0/12 runs fail when using 1d568a8
while 7/12 fail for 069eb07

max-nextcloud added a commit to nextcloud/text that referenced this issue Dec 17, 2023
nextcloud/server#42306
causes the DELETE request to fail with 423 Locked.

Signed-off-by: Max <max@nextcloud.com>
@max-nextcloud
Copy link
Contributor Author

@come-nc you observed the same in groupfolders, right?

juliusknorr pushed a commit to nextcloud/text that referenced this issue Dec 18, 2023
nextcloud/server#42306
causes the DELETE request to fail with 423 Locked.

Signed-off-by: Max <max@nextcloud.com>
backportbot-nextcloud bot pushed a commit to nextcloud/text that referenced this issue Dec 18, 2023
nextcloud/server#42306
causes the DELETE request to fail with 423 Locked.

Signed-off-by: Max <max@nextcloud.com>
@max-nextcloud
Copy link
Contributor Author

cypress-1.log(1).zip
Very verbose log including lock debug output for the failed test run.

@come-nc
Copy link
Contributor

come-nc commented Dec 21, 2023

Think CI on both nextcloud/groupfolders#2694 and nextcloud/groupfolders#2644 is failing because of this bug.

max-nextcloud added a commit to nextcloud/text that referenced this issue Dec 21, 2023
nextcloud/server#42306
causes the DELETE request to fail with 423 Locked.

Signed-off-by: Max <max@nextcloud.com>
juliusknorr pushed a commit to nextcloud/text that referenced this issue Dec 21, 2023
nextcloud/server#42306
causes the DELETE request to fail with 423 Locked.

Signed-off-by: Max <max@nextcloud.com>
juliusknorr pushed a commit to nextcloud/text that referenced this issue Dec 21, 2023
nextcloud/server#42306
causes the DELETE request to fail with 423 Locked.

Signed-off-by: Max <max@nextcloud.com>
@come-nc
Copy link
Contributor

come-nc commented Jan 2, 2024

For the tests in groupfolders, this was somehow fix by making sure the action menu showed up before clicking on the delete button. Maybe only because it slows a bit down requests?

[EDIT] Actually not fixed, it still happens often

@come-nc
Copy link
Contributor

come-nc commented Feb 5, 2024

Stack trace:

#0 /var/www/html/lib/private/Lock/DBLockingProvider.php(214): OCP\Lock\LockedException->__construct('...')
#1 /var/www/html/lib/private/Files/Storage/Common.php(831): OC\Lock\DBLockingProvider->changeLock('...', 2)
#2 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Common->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#3 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#4 /var/www/html/lib/private/Files/Storage/Wrapper/Jail.php(466): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#5 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Jail->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#6 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#7 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#8 /var/www/html/lib/private/Files/View.php(1980): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#9 /var/www/html/lib/private/Files/View.php(1150): OC\Files\View->changeLock('...', 2)
#10 /var/www/html/lib/private/Files/View.php(702): OC\Files\View->basicOperation('...', '...', Array)
#11 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(543): OC\Files\View->unlink('...')
#12 /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php(185): OCA\DAV\Connector\Sabre\File->delete()
#13 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(281): Sabre\DAV\Tree->delete('...')
#14 /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#15 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit('...', Array)
#16 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#17 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(321): Sabre\DAV\Server->start()
#18 /var/www/html/apps/dav/lib/Server.php(370): Sabre\DAV\Server->exec()
#19 /var/www/html/apps/dav/appinfo/v2/remote.php(35): OCA\DAV\Server->exec()
#20 /var/www/html/remote.php(172): require_once('...')
#0 /var/www/html/lib/private/Files/Storage/Common.php(833): OCP\Lock\LockedException->__construct('...', Object(OCP\Lock\LockedException), NULL, '...')
#1 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Common->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#2 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#3 /var/www/html/lib/private/Files/Storage/Wrapper/Jail.php(466): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#4 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Jail->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#5 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#6 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(629): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#7 /var/www/html/lib/private/Files/View.php(1980): OC\Files\Storage\Wrapper\Wrapper->changeLock('...', 2, Object(OC\Lock\DBLockingProvider))
#8 /var/www/html/lib/private/Files/View.php(1150): OC\Files\View->changeLock('...', 2)
#9 /var/www/html/lib/private/Files/View.php(702): OC\Files\View->basicOperation('...', '...', Array)
#10 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(543): OC\Files\View->unlink('...')
#11 /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php(185): OCA\DAV\Connector\Sabre\File->delete()
#12 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(281): Sabre\DAV\Tree->delete('...')
#13 /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#14 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit('...', Array)
#15 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#16 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(321): Sabre\DAV\Server->start()
#17 /var/www/html/apps/dav/lib/Server.php(370): Sabre\DAV\Server->exec()
#18 /var/www/html/apps/dav/appinfo/v2/remote.php(35): OCA\DAV\Server->exec()
#19 /var/www/html/remote.php(172): require_once('...')
#0 /var/www/html/lib/private/Files/View.php(1989): OCP\Lock\LockedException->__construct('...', Object(OCP\Lock\LockedException), NULL)
#1 /var/www/html/lib/private/Files/View.php(1150): OC\Files\View->changeLock('...', 2)
#2 /var/www/html/lib/private/Files/View.php(702): OC\Files\View->basicOperation('...', '...', Array)
#3 /var/www/html/apps/dav/lib/Connector/Sabre/File.php(543): OC\Files\View->unlink('...')
#4 /var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php(185): OCA\DAV\Connector\Sabre\File->delete()
#5 /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(281): Sabre\DAV\Tree->delete('...')
#6 /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php(89): Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#7 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(472): Sabre\DAV\Server->emit('...', Array)
#8 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(253): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#9 /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php(321): Sabre\DAV\Server->start()
#10 /var/www/html/apps/dav/lib/Server.php(370): Sabre\DAV\Server->exec()
#11 /var/www/html/apps/dav/appinfo/v2/remote.php(35): OCA\DAV\Server->exec()
#12 /var/www/html/remote.php(172): require_once('...')

@come-nc
Copy link
Contributor

come-nc commented Feb 5, 2024

Array
(
    [0] => Array
        (
            [id] => 3271
            [lock] => 2
            [key] => files/02ea19023cf44d868d8fdb6850886606
            [ttl] => 1707143732
        )
)

This entry is found where it expected lock to be 1 to be able to lock it exclusively. That would suggest something else is locking the file. What I do not get is why the path looks like that?

@come-nc
Copy link
Contributor

come-nc commented Feb 5, 2024

This entry is found where it expected lock to be 1 to be able to lock it exclusively. That would suggest something else is locking the file. What I do not get is why the path looks like that?

It looks expected, it’s built in lib/private/Files/Storage/Common.php:833

@come-nc
Copy link
Contributor

come-nc commented Feb 5, 2024

Current theory: the loading of the preview locks the file and conflicts with the deletion. I’m gonna try waiting for preview to be loaded before attempting to delete files.

@come-nc
Copy link
Contributor

come-nc commented Feb 5, 2024

@max-nextcloud nextcloud/groupfolders#2806 Waiting for preview to load seems to work, can you try?

@max-nextcloud
Copy link
Contributor Author

Looks like the tests are green again now. No idea why. Either way the server behavior is consistent with expectations for locking. So I will close this and in case we run into the failing tests again i will either disable the files_locking or wait for previews. Thanks for the pointer @come-nc

@max-nextcloud
Copy link
Contributor Author

Tests went back to flaky - but waiting for preview did the trick! Thanks Come! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug
Projects
None yet
Development

No branches or pull requests

3 participants