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

Shared files get locked for no obvious reason #5824

Closed
enoch85 opened this issue Jul 21, 2017 · 5 comments
Closed

Shared files get locked for no obvious reason #5824

enoch85 opened this issue Jul 21, 2017 · 5 comments

Comments

@enoch85
Copy link
Member

enoch85 commented Jul 21, 2017

Using the issue template app, there are more info but it doesn't show in the output. Please edit this issue to see it.

Steps to reproduce

  1. Share a file
  2. Let many users access it
  3. Wait for the lock to happen

Expected behaviour

Files shouldn't be locked

Actual behaviour

Files get locked and can't be accessed.

I truncated oc_file_locks according to owncloud/core#20380 and checked that Redis applied the TTL of 3600 which it did. But even after truncating the oc_file_locks table I get these locks for no obvious reason.

I use cron every 15 mintues.

Server configuration

Operating system: Linux cloud.techandme.se 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64

Web server: Apache/2.4.18 (Ubuntu) (apache2handler)

Database: mysql 5.7.19

PHP version: 7.0.18-0ubuntu0.16.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imap, intl, json, ldap, exif, mcrypt, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version: 12.0.0 - 12.0.0.29

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

Signing status
[]

List of activated apps:

App list
Enabled:
 - activity: 2.5.2
 - admin_notifications: 1.0.0
 - bruteforcesettings: 1.0.2
 - calendar: 1.5.3
 - comments: 1.2.0
 - contacts: 1.5.3
 - dav: 1.3.0
 - federatedfilesharing: 1.2.0
 - federation: 1.2.0
 - files: 1.7.2
 - files_downloadactivity: 1.1.1
 - files_external: 1.3.0
 - files_pdfviewer: 1.1.1
 - files_sharing: 1.4.0
 - files_texteditor: 2.4.1
 - files_trashbin: 1.2.0
 - files_versions: 1.5.0
 - files_videoplayer: 1.1.0
 - firstrunwizard: 2.1
 - gallery: 17.0.0
 - impersonate: 1.0.1
 - issuetemplate: 0.2.1
 - logreader: 2.0.0
 - lookup_server_connector: 1.0.0
 - mail: 0.6.4
 - nextcloud_announcements: 1.1
 - notifications: 2.0.0
 - oauth2: 1.0.5
 - ocsms: 1.12.0
 - ownnote: 1.1
 - password_policy: 1.2.2
 - previewgenerator: 1.0.6
 - provisioning_api: 1.2.0
 - qownnotesapi: 17.5.0
 - richdocuments: 1.12.33
 - serverinfo: 1.2.0
 - sharebymail: 1.2.0
 - socialsharing_diaspora: 1.0.1
 - socialsharing_email: 1.0.1
 - socialsharing_facebook: 1.0.1
 - socialsharing_googleplus: 1.0.1
 - socialsharing_twitter: 1.0.1
 - spreed: 2.0.1
 - survey_client: 1.0.0
 - systemtags: 1.2.0
 - theming: 1.3.0
 - twofactor_backupcodes: 1.1.1
 - twofactor_totp: 1.3.0
 - updatenotification: 1.2.0
 - workflowengine: 1.2.0

Disabled:
 - admin_audit
 - encryption
 - external
 - files_accesscontrol
 - files_automatedtagging
 - files_retention
 - user_external
 - user_ldap
 - user_saml

The content of config/config.php:

Config report
{
    "updatechecker": false,
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "192.168.4.111",
        "cloud.techandme.se",
        "domain2.techandme.se"
    ],
    "datadirectory": "\/var\/ncdata",
    "overwrite.cli.url": "https:\/\/cloud.techandme.se\/",
    "dbtype": "mysql",
    "version": "12.0.0.29",
    "dbname": "owncloud_db",
    "dbhost": "localhost",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "Europe\/Stockholm",
    "installed": true,
    "instanceid": "oc7aii0tkiol",
    "mail_smtpmode": "smtp",
    "mail_smtpauth": 1,
    "mail_smtpport": "587",
    "mail_smtphost": "mail.citynetwork.se",
    "mail_smtpauthtype": "LOGIN",
    "mail_from_address": "no-reply",
    "mail_domain": "techandme.se",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "allowZipDownload": true,
    "session_lifetime": 1800,
    "forcessl": true,
    "logfile": "\/var\/log\/nfs-share\/nextcloud.log",
    "loglevel": 2,
    "memcache.local": "\\OC\\Memcache\\Redis",
    "filelocking.enabled": true,
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "\/var\/run\/redis\/redis.sock",
        "port": 0,
        "timeout": 0,
        "dbindex": 0
    },
    "trusted_proxies": [
        [
            "192.168.4.201"
        ]
    ],
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED",
        "HTTP_FORWARDED_FOR"
    ],
    "maintenance": false,
    "mail_smtpsecure": "tls",
    "htaccess.RewriteBase": "\/",
    "theme": "",
    "updater.release.channel": "stable",
    "mysql.utf8mb4": true,
    "trashbin_retention_obligation": "auto, 30"
}

Are you using external storage, if yes which one: Array
(
[0] => \OC\Files\Storage\Local
[1] => \OCA\Files_External\Lib\Storage\FTP
[2] => \OC\Files\Storage\DAV
[3] => \OCA\Files_External\Lib\Storage\OwnCloud
[4] => \OCA\Files_External\Lib\Storage\SFTP
[5] => \OCA\Files_External\Lib\Storage\AmazonS3
[6] => \OCA\Files_External\Lib\Storage\Dropbox
[7] => \OCA\Files_External\Lib\Storage\Google
[8] => \OCA\Files_External\Lib\Storage\Swift
[9] => \OCA\Files_External\Lib\Storage\SFTP
[10] => \OCA\Files_External\Lib\Storage\SMB
[11] => \OCA\Files_External\Lib\Storage\SMB
)

Are you using encryption: no

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

Client configuration

Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36

Operating system:

Logs

Web server error log

Web server error log ``` Nothing but normal logging ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` OCP\Lock\LockedException: "_VMs/Nextcloud VMs/Nextcloud Community VM" is locked /var/www/nextcloud/lib/private/Files/View.php - line 2011: OC\Files\View->lockPath('/_VMs/Nextcloud...', 1) /var/www/nextcloud/lib/private/Files/View.php - line 1118: OC\Files\View->lockFile('/_VMs/Nextcloud...', 1) /var/www/nextcloud/lib/private/Files/View.php - line 971: OC\Files\View->basicOperation('fopen', '/_VMs/Nextcloud...', Array, 'r') /var/www/nextcloud/lib/private/Files/Filesystem.php - line 737: OC\Files\View->fopen('/_VMs/Nextcloud...', 'r') /var/www/nextcloud/lib/private/Streamer.php - line 80: OC\Files\Filesystem fopen('/_VMs/Nextcloud...', 'r') /var/www/nextcloud/lib/private/legacy/files.php - line 169: OC\Streamer->addDirRecursive('/_VMs/Nextcloud...') /var/www/nextcloud/apps/files_sharing/lib/Controller/ShareController.php - line 535: OC_Files get('/_VMs/Nextcloud...', 'Nextcloud Commu...', Array) [internal function] OCA\Files_Sharing\Controller\ShareController->downloadShare('lTjoMr5smSYHIiM', NULL, '/', '') /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array) /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OCA\Files_Sharing\Controller\ShareController), 'downloadShare') /var/www/nextcloud/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OCA\Files_Sharing\Controller\ShareController), 'downloadShare') /var/www/nextcloud/lib/public/AppFramework/App.php - line 136: OC\AppFramework\App main('ShareController', 'downloadShare', Object(OC\AppFramework\DependencyInjection\DIContainer)) /var/www/nextcloud/core/routes.php - line 129: OCP\AppFramework\App->dispatch('ShareController', 'downloadShare') [internal function] OC\Route\Router->{closure}(Array) /var/www/nextcloud/lib/private/Route/Router.php - line 299: call_user_func(Object(Closure), Array) /var/www/nextcloud/lib/base.php - line 1000: OC\Route\Router->match('/s/lTjoMr5smSYH...') /var/www/nextcloud/index.php - line 40: OC handleRequest() {main} ```

Browser log

Browser log ``` Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
```
@rullzer
Copy link
Member

rullzer commented Jul 21, 2017

Does the file stay locked? Or does this just show up from time to time?

Because if a lot of people have access to a file. And 1 of them is writing and other try to read => 💥
Or is a lot of them are reading and 1 tries to write => 💥

That is expected and exactly why locking is in place.

@enoch85
Copy link
Member Author

enoch85 commented Jul 21, 2017

From time to time.

My own theory is that it happens when the sync client is running a new sync check and at the exact same time someone tries to download the VM.

I just wanted to get an answer on why it happens. Could that be it?

@enoch85
Copy link
Member Author

enoch85 commented Jul 21, 2017

This specifically happens with the Nextcloud VMs which I share from my own server. It gets downloaded about 100-200 times per day so it's likely that the sync client is messing things up. But, at the same time these folders are "stale" and isn't changed except when a new release is out, so no one tries to write to that folder afaik.

@rullzer
Copy link
Member

rullzer commented Jul 21, 2017

Well we do do atomic operations there... so if you are unlucky and they happen simultaneously one of them will fail.

that is the best awnser I have then. @icewind1991 any other suggestions?

@enoch85
Copy link
Member Author

enoch85 commented Jul 21, 2017

We can close this, but would be nice if @icewind1991 had any suggestions.

Thanks @rullzer

@enoch85 enoch85 closed this as completed Jul 21, 2017
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

2 participants