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]: Federated Share LockedException #31554

Closed
5 of 8 tasks
ghost opened this issue Mar 11, 2022 · 5 comments · Fixed by #32852
Closed
5 of 8 tasks

[Bug]: Federated Share LockedException #31554

ghost opened this issue Mar 11, 2022 · 5 comments · Fixed by #32852
Assignees
Labels
1. to develop Accepted and waiting to be taken care of bug regression
Milestone

Comments

@ghost
Copy link

ghost commented Mar 11, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

Nextcloud Web-App says "Unable to create new file from template" when creating a file in a federated share (folder, edit permissions).

The Protocol says:

[no app in context] Fehler: "files/bf4e1ef0c25ce0029e9c64a66ee28142"("shared::8e68fbcd1d8971965f914ebbd3409894::test.md") is locked, existing lock on file: exclusive

POST /ocs/v2.php/apps/files/api/v1/templates/create
from XXX.XXX.XXX.XXX by arnold at 2022-03-11T17:18:37+00:00

The file is created anyway.

The issue does not occur when creating a file in a non federated share or in own folder.

Steps to reproduce

  1. Create a federated share for a folder on instance a for a user on instance b (Federated Cloud ID or trusted server)
  2. Open the shared folder on instance b
  3. Create a file in this shared folder
  4. See the errors

Expected behavior

No error occurs when creating a file in the federated share.

Installation method

Official Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Apache (supported)
-> Apache Docker Image and Apache Reverse Proxy

Database engine version

MariaDB

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

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": 25,
        "mail_smtpsecure": "",
        "mail_smtpauth": false,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.xyz.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "23.0.2.1",
        "overwrite.cli.url": "http:\/\/cloud.xyz.de",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "proxy": "rzproxy.xyz.de:3128",
        "overwritehost": "cloud.xyz.de",
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "DE",
        "default_language": "de",
        "default_locale": "de_DE",
        "customclient_desktop": "",
        "allow_local_remote_servers": true,
        "skeletondirectory": "",
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - admin_audit: 1.13.0
  - bruteforcesettings: 2.3.0
  - circles: 23.0.1
  - cloud_federation_api: 1.6.0
  - comments: 1.13.0
  - contactsinteraction: 1.4.0
  - dashboard: 7.3.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_antivirus: 3.2.2
  - files_automatedtagging: 1.13.0
  - files_pdfviewer: 2.4.0
  - files_retention: 1.12.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - files_videoplayer: 1.12.0
  - groupfolders: 11.1.2
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - nextcloud_announcements: 1.12.0
  - notifications: 2.11.1
  - notify_push: 0.3.0
  - oauth2: 1.11.0
  - password_policy: 1.13.0
  - previewgenerator: 4.0.0
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - recommendations: 1.2.0
  - richdocuments: 5.0.3
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - socialsharing_email: 2.4.0
  - support: 1.6.0
  - systemtags: 1.13.0
  - text: 3.4.0
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - twofactor_totp: 6.2.0
  - updatenotification: 1.13.0
  - user_status: 1.3.1
  - viewer: 1.7.0
  - welcome: 1.0.1
  - workflowengine: 2.5.0
Disabled:
  - announcementcenter: 6.1.1
  - deck: 1.6.1
  - encryption
  - files_external
  - firstrunwizard: 2.12.0
  - forms: 2.4.0
  - photos: 1.5.0
  - spreed: 13.0.3
  - survey_client: 1.11.0
  - user_ldap
  - weather_status: 1.3.0
  - workflow_pdf_converter: 1.8.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"mV5FG8CeOHr65YFJogz6","level":3,"time":"2022-03-10T11:40:18+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"arnold","app":"jsresourceloader","method":"GET","url":"/index.php/settings/admin/workflow","message":"Could not find resource core/js/oc-backbone-webdav.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.36","version":"23.0.2.1"}
{"reqId":"mV5FG8CeOHr65YFJogz6","level":3,"time":"2022-03-10T11:40:18+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"arnold","app":"jsresourceloader","method":"GET","url":"/index.php/settings/admin/workflow","message":"Could not find resource core/js/systemtags/systemtags.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.36","version":"23.0.2.1"}
{"reqId":"mV5FG8CeOHr65YFJogz6","level":3,"time":"2022-03-10T11:40:18+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"arnold","app":"jsresourceloader","method":"GET","url":"/index.php/settings/admin/workflow","message":"Could not find resource core/js/systemtags/systemtagmodel.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.36","version":"23.0.2.1"}
{"reqId":"mV5FG8CeOHr65YFJogz6","level":3,"time":"2022-03-10T11:40:18+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"arnold","app":"jsresourceloader","method":"GET","url":"/index.php/settings/admin/workflow","message":"Could not find resource core/js/systemtags/systemtagscollection.js to load","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36 Edg/99.0.1150.36","version":"23.0.2.1"}
{"reqId":"QdQnNrza5pTGzC2JGjpn","level":3,"time":"2022-03-11T17:18:37+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"arnold","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":"\"files/bf4e1ef0c25ce0029e9c64a66ee28142\"(\"shared::8e68fbcd1d8971965f914ebbd3409894::test.md\") is locked, existing lock on file: exclusive","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15","version":"23.0.2.1","exception":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files/bf4e1ef0c25ce0029e9c64a66ee28142\"(\"shared::8e68fbcd1d8971965f914ebbd3409894::test.md\") is locked, existing lock on file: exclusive","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Storage/Common.php","line":753,"function":"acquireLock","class":"OC\\Lock\\MemcacheLockingProvider","type":"->","args":["files/bf4e1ef0c25ce0029e9c64a66ee28142",1,"shared::8e68fbcd1d8971965f914ebbd3409894::test.md"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Common","type":"->","args":["test.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["test.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["test.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/Cache/Scanner.php","line":336,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["test.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/View.php","line":1587,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["test.md",false]},{"file":"/var/www/html/lib/private/Files/View.php","line":590,"function":"putFileInfo","class":"OC\\Files\\View","type":"->","args":["/arnold/files/Test/test.md",{"mtime":1647019117}]},{"file":"/var/www/html/lib/private/Files/Node/Folder.php","line":200,"function":"touch","class":"OC\\Files\\View","type":"->","args":["/arnold/files/Test/test.md"]},{"file":"/var/www/html/lib/private/Files/Template/TemplateManager.php","line":162,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->","args":["test.md"]},{"file":"/var/www/html/apps/files/lib/Controller/TemplateController.php","line":57,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->","args":["/Test/test.md","","user"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->","args":["/Test/test.md","","user"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\TemplateController"},"create"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\TemplateController"},"create"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files\\Controller\\TemplateController","create",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.files.Template.create"}]},{"file":"/var/www/html/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/files/api/v1/templates/create"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Lock/MemcacheLockingProvider.php","Line":80,"CustomMessage":"\"files/bf4e1ef0c25ce0029e9c64a66ee28142\"(\"shared::8e68fbcd1d8971965f914ebbd3409894::test.md\") is locked, existing lock on file: exclusive"}}
{"reqId":"8mUw1AV0M8tNfK8IE82B","level":3,"time":"2022-03-11T17:25:58+00:00","remoteAddr":"XXX.XXX.XXX.XXX","user":"arnold","app":"no app in context","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":"\"files/44aeca8e0e696478a452e3d54a32b4bd\"(\"shared::8e68fbcd1d8971965f914ebbd3409894::test3.md\") is locked, existing lock on file: exclusive","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Safari/605.1.15","version":"23.0.2.1","exception":{"Exception":"OCP\\Lock\\LockedException","Message":"\"files/44aeca8e0e696478a452e3d54a32b4bd\"(\"shared::8e68fbcd1d8971965f914ebbd3409894::test3.md\") is locked, existing lock on file: exclusive","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Storage/Common.php","line":753,"function":"acquireLock","class":"OC\\Lock\\MemcacheLockingProvider","type":"->","args":["files/44aeca8e0e696478a452e3d54a32b4bd",1,"shared::8e68fbcd1d8971965f914ebbd3409894::test3.md"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Common","type":"->","args":["test3.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["test3.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":610,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["test3.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/Cache/Scanner.php","line":336,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["test3.md",1,{"__class__":"OC\\Lock\\MemcacheLockingProvider"}]},{"file":"/var/www/html/lib/private/Files/View.php","line":1587,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->","args":["test3.md",false]},{"file":"/var/www/html/lib/private/Files/View.php","line":590,"function":"putFileInfo","class":"OC\\Files\\View","type":"->","args":["/arnold/files/Test/test3.md",{"mtime":1647019558}]},{"file":"/var/www/html/lib/private/Files/Node/Folder.php","line":200,"function":"touch","class":"OC\\Files\\View","type":"->","args":["/arnold/files/Test/test3.md"]},{"file":"/var/www/html/lib/private/Files/Template/TemplateManager.php","line":162,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->","args":["test3.md"]},{"file":"/var/www/html/apps/files/lib/Controller/TemplateController.php","line":57,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->","args":["/Test/test3.md","","user"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->","args":["/Test/test3.md","","user"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\TemplateController"},"create"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files\\Controller\\TemplateController"},"create"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files\\Controller\\TemplateController","create",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.files.Template.create"}]},{"file":"/var/www/html/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/files/api/v1/templates/create"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Lock/MemcacheLockingProvider.php","Line":80,"CustomMessage":"\"files/44aeca8e0e696478a452e3d54a32b4bd\"(\"shared::8e68fbcd1d8971965f914ebbd3409894::test3.md\") is locked, existing lock on file: exclusive"}}

Additional info

Browser Console Output:

[Error] Failed to load resource: the server responded with a status of 403 (Forbidden) (create, line 0): https://cloud.xyz.de/ocs/v2.php/apps/files/api/v1/templates/create

[Error] [ERROR] files: Error while creating the new file from template – {app: "files", uid: "arnold"}
	log (main.js:53:146958)
	error (main.js:53:147267)
	(anonyme Funktion) (main.js:358:7093)
	c (files_sharing_tab.js:1274:72787)
	(anonyme Funktion) (files_sharing_tab.js:1274:72537)
	$ (main.js:358:3926)
	s (main.js:358:4166)
	promiseReactionJob

[Error] Error: Request failed with status code 403 (TemplatePicker.vue)
(anonyme Funktion) — createError.js:16
(anonyme Funktion) — cookies.js:35
(anonyme Funktion) — xhr.js:62
	(anonyme Funktion) (main.js:358:7158)
	c (files_sharing_tab.js:1274:72787)
	(anonyme Funktion) (files_sharing_tab.js:1274:72537)
	$ (main.js:358:3926)
	s (main.js:358:4166)
	promiseReactionJob
@ghost ghost added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Mar 11, 2022
@cb3inco
Copy link

cb3inco commented Apr 26, 2022

Confirming we have this issue on our setup also.

@colpari
Copy link

colpari commented Jun 2, 2022

Same here. Since NC 23 we cannot create files on federated shares unless we deactivate File-Locking on the share-receiving side. This was working before.

@juliusknorr
Copy link
Member

I did a bisect and this seems to come from #30499

@juliusknorr juliusknorr added 1. to develop Accepted and waiting to be taken care of regression and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jun 4, 2022
@PVince81
Copy link
Member

PVince81 commented Jun 7, 2022

I suspect that the current issue was just hidden by the code that existed in the PR, since the PR was overriding the scanner behavior.

Perhaps the default scanner needs some additional handling to make sure it works with locks in all scenarios.

@PVince81
Copy link
Member

PVince81 commented Aug 3, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants