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

OCA\DAV\Connector\Sabre\Exception\FileLocked: "Myfile" is locked #11220

Closed
Railsimulatornet opened this issue Sep 14, 2018 · 7 comments
Closed

Comments

@Railsimulatornet
Copy link

Railsimulatornet commented Sep 14, 2018

Steps to reproduce

Install Virtual Machine from www.techandme.se
Upload files using the Windows Desktop Client

Expected behaviour

Upload the files

Actual behaviour

Error messages in the Nextcloud server and on the client
OCA\DAV\Connector\Sabre\Exception\FileLocked: "Apps" is locked
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096:

OCA\DAV\Connector\Sabre\Directory->createFile("license.txt", null)

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 529:

Sabre\DAV\Server->createFile("files/rogls ... t", null, null)

Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105:

call_user_func_array([ Sabre\DAV\ ... "], [ Sabre\HTTP ... }])

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479:

Sabre\Event\EventEmitter->emit("method:PUT", [ Sabre\HTTP ... }])

/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254:

Sabre\DAV\Server->invokeMethod(Sabre\HTTP\R ... "}, Sabre\HTTP\Response {})

/var/www/nextcloud/apps/dav/lib/Server.php - line 293:

Sabre\DAV\Server->exec()

/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/var/www/nextcloud/remote.php - line 163:

require_once("/var/www/ne ... p")

Server configuration

Operating system: Ubuntu 18.04 OVA

Web server: Apache 2.4

Database: PostgreSQL 10.3

PHP version: PHP-FPM 7.2

Nextcloud version: 14.00

Updated from an older Nextcloud/ownCloud or fresh install: VM from techandme.se

Where did you install Nextcloud from: VM from techandme.se

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.
No errors have been found.
</details>

**List of activated apps:**
<details>
<summary>App list</summary>
Accessibility 
Activity 
Calendar 
Can I update? 
Collaborative tags 
Comments 
Contacts 
Deleted files 
Federation 
File sharing 
First run wizard 
Gallery 
Issue Template 
Log Reader 
Monitoring 
Nextcloud announcements 
Notifications 
Password policy 
PDF viewer 
Share by mail 
Support 
Text editor 
Theming 
Update notification 
Usage survey 
Versions 
Video player 

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Enabled:

  • accessibility: 1.0.1
  • activity: 2.7.0
  • calendar: 1.6.2
  • caniupdate: 0.2.0
  • cloud_federation_api: 0.0.1
  • comments: 1.4.0
  • contacts: 2.1.6
  • dav: 1.6.0
  • federatedfilesharing: 1.4.0
  • federation: 1.4.0
  • files: 1.9.0
  • files_pdfviewer: 1.3.2
  • files_sharing: 1.6.2
  • files_texteditor: 2.6.0
  • files_trashbin: 1.4.1
  • files_versions: 1.7.1
  • files_videoplayer: 1.3.0
  • firstrunwizard: 2.3.0
  • gallery: 18.1.0
  • issuetemplate: 0.4.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.2.0
  • nextcloud_announcements: 1.3.0
  • notifications: 2.2.1
  • oauth2: 1.2.1
  • password_policy: 1.4.0
  • provisioning_api: 1.4.0
  • serverinfo: 1.4.0
  • sharebymail: 1.4.0
  • support: 1.0.0
  • survey_client: 1.2.0
  • systemtags: 1.4.0
  • theming: 1.5.0
  • twofactor_backupcodes: 1.3.1
  • updatenotification: 1.4.1
  • workflowengine: 1.4.0
    Disabled:
  • admin_audit
  • encryption
  • files_external
  • user_external
  • user_ldap

Nextcloud configuration:

{
"system": {
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"localhost",
"XXXXXX",
"XXXXXX",
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "pgsql",
"version": "14.0.0.19",
"overwrite.cli.url": "https://XXX.de/",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"instanceid": "REMOVED SENSITIVE VALUE",
"mail_smtpmode": "smtp",
"log_rotate_size": "10485760",
"memcache.local": "\OC\Memcache\Redis",
"filelocking.enabled": true,
"memcache.distributed": "\OC\Memcache\Redis",
"memcache.locking": "\OC\Memcache\Redis",
"redis": {
"host": "REMOVED SENSITIVE VALUE",
"port": 0,
"timeout": 0,
"dbindex": 0,
"password": "REMOVED SENSITIVE VALUE"
},
"htaccess.RewriteBase": "/",
"loglevel": "2",
"log_type": "file",
"logfile": "/mnt/ncdata/nextcloud.log",
"logtimezone": "Europe/Berlin",
"maintenance": false,
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtpauth": 1,
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "25",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE"
}
}

Are you using external storage, if yes which one: local/smb/sftp/... --> no

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... --> no

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here
``
[error.log](https://github.com/nextcloud/server/files/2383729/error.log)
`
</details>

#### Nextcloud log (data/nextcloud.log)
<details>
<summary>Nextcloud log</summary>

nextcloud2.log
``

`

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #6429 (Locked file), #9001 (OCA\DAV\Connector\Sabre\Exception\FileLocked - Redis race condition), #8239 (OCA\DAV\Connector\Sabre\Exception\FileLocked - DB race condition), #3053 (LOCK: error 500), and #9922 (server replied: Locked).

@patschi
Copy link
Member

patschi commented Sep 15, 2018

I'm not sure about the root case what causes this error, but you might want to clear the redis database to solve this error. Redis holds the file locking status in your case. Execute following command on your server:

# redis-cli flushdb

@Railsimulatornet
Copy link
Author

Railsimulatornet commented Sep 16, 2018

Thanks but the error comes again :/

And scan with sudo -u www-data php occ files:scan no results.

(Danke Patrick, aber der Fehler kommt immer wieder, egal wie oft ich die DB leere. Sobald ein neuer Upload gestartet wird kommt der Fehler immer wieder.)

@MorrisJobke
Copy link
Member

I'm not sure about the root case what causes this error, but you might want to clear the redis database to solve this error. Redis holds the file locking status in your case.

Also clearing this could lead to race conditions during that time.

We are investigating what this could cause - see #9001 and #8239 that the bot linked.

@Railsimulatornet
Copy link
Author

no fix? only closed..

@MorrisJobke
Copy link
Member

As a duplicate of the linked tickets ...

@ak1n
Copy link

ak1n commented Oct 23, 2018

I can unfortunately reliably replicate lock errors with new nextcloud installs on both antergos using docker as well as on freenas - both using recommending caching (apcu local & redis locking). Unless I'm missing something big this code is not production ready.

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

No branches or pull requests

5 participants