'Locked file' error

Hi, I’m facing a file locked issues since a while now and I was hoping someone can help me with this. Here are the details:

Nextcloud version (eg, 12.0.2): 14.0.2
Operating system and version (eg, Ubuntu 17.04): 18.0.4.1
Apache or nginx version (eg, Apache 2.4.25): 2.4.29
PHP version (eg, 7.1): 7.2.13

The issue you are facing:
These two files seem to be locked on my machine all the time. I’m using nextcloud with an external drive for storage.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

No particular steps to replicate this. It started happening all by itself a few weeks ago. Also I see this error under Administration > Overview:

Last background job execution ran 2 months ago. Something seems wrong. [Check the background job settings](https://192.168.1.109/nextcloud/index.php/settings/admin#backgroundjobs)

Not sure if this is related. When I try and run sudo -u www-data php -f /var/www/nextcloud/cron.php I don’t see anything. Just a blinking cursor. I have to Ctrl + C to exit this command.

The output of your Nextcloud log in Admin > Logging:

No Server logs. Everything is working fine.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocbfoy8nwqw6',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' => 
  array (
    0 => '192.168.1.109',
  ),
  'datadirectory' => '/cloud/exthdd',
  'overwrite.cli.url' => 'https://192.168.1.109/nextcloud',
  'dbtype' => 'mysql',
  'version' => '14.0.4.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'XXX',
  'installed' => true,
  'updater.secret' => 'XXX',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
);

The output of your Apache/nginx/system log in /var/log/____:

Access log is here: apache access log - Pastebin.com
Error log is here: apache error log - Pastebin.com

Hi,

For a few (if not many) users locking issues started with NC14. I was affected by it myself.
You can either install and use Redis, which helped me, but wasn’t solving the issue for others or upgrade to latest NC14 version or directly to NC15. There were many changes in the later versions to address this locking problem.

Regarding the cron.php, you have it running every few minutes via cron job, right?
What does the admin overview in the settings tell about the last cron execution?
This job is important and should regularly run in the background. I think that’s even the job which cleans up file locks latest after one hour.