Error "speicherzugriffsfehler" ooc file:scan - existin lock on file

Support intro

I have a ā€œFile is lockedā€ error after:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all

I tried already the following solutions:
File is locked - how to unlock

I got: 0 Rows affected

and I also tried it with redis:
sudo redis-cli -s /var/run/redis/redis.sock
$> flushall

and I also don

both solutions didnā€™t solve the problem:

sudo -u www-data php /var/www/nextcloud/occ files:scan --all
respondes:
Speicherzugriffsfehler

a second call:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all
respondes:
Exception during scan: ā€œfiles/c469b5f877964da68355039067f9e787ā€(ā€œhome::Eva::scanner::ā€) is locked, existing lock on file: exclusive
#0 /var/www/nextcloud/lib/private/Files/Storage/Common.php(758): OC\Lock\MemcacheLockingProvider->acquireLock()
#1 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Common->acquireLock()
#2 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Wrapper\Wrapper->acquireLock()
#3 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(335): OC\Files\Storage\Wrapper\Wrapper->acquireLock()
#4 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(256): OC\Files\Cache\Scanner->scan()
#5 /var/www/nextcloud/apps/files/lib/Command/Scan.php(144): OC\Files\Utils\Scanner->scan()
#6 /var/www/nextcloud/apps/files/lib/Command/Scan.php(200): OCA\Files\Command\Scan->scanFiles()
#7 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#8 /var/www/nextcloud/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#11 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#12 /var/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#13 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#14 /var/www/nextcloud/occ(11): require_once(ā€˜ā€¦ā€™)
#15 {main}

so I donā€™t no were else to debug.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isnā€™t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 24.0.5
Operating system and version (eg, Ubuntu 20.04): Linux 5.15.32-v8+ aarch64
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.1.10

The issue you are facing:

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

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

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

<?php
$CONFIG = array (
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.1.200',
    '' => 'nextcloudpi',
  ),
  'datadirectory' => '',
  'dbtype' => 'mysql',
  'version' => '24.0.5.1',
  'overwrite.cli.url' => 'https://nextcloudpi/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => '',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '',
  ),
  'tempdirectory' => '',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\TXT',
    6 => 'OC\\Preview\\MarkDown',
  ),
  'overwriteprotocol' => 'https',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_sendmailmode' => 'smtp',
  'maintenance' => false,
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '',
  'mail_smtpport' => '',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'default_phone_region' => 'DE',
'updater.release.channel' => 'stable',
  'htaccess.RewriteBase' => '/',
  'theme' => '',
  'data-fingerprint' => '',
  'loglevel' => '2',
  'log_type' => 'file',
  'app_install_overwrite' =>
  array (
    0 => 'dashboardcharts',
  ),
  'trusted_proxies' =>
  array (
    11 => '127.0.0.1',
    12 => '::1',
    13 => 'nextcloudpi',
    14 => '127.0.1.1',
  ),
);



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

PASTE HERE

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Sorry, was my first Topic - didnā€™t get the error description in the right order, here again:

I have a ā€œFile is lockedā€ error after:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all

I tried already the following solutions:

I got: 0 Rows affected

and I also tried it with redis:
sudo redis-cli -s /var/run/redis/redis.sock
$> flushall

and I also don

both solutions didnā€™t solve the problem:

sudo -u www-data php /var/www/nextcloud/occ files:scan --all
respondes:
Speicherzugriffsfehler

a second call:
sudo -u www-data php /var/www/nextcloud/occ files:scan --all
respondes:
Exception during scan: ā€œfiles/c469b5f877964da68355039067f9e787ā€(ā€œhome::Eva::scanner::ā€) is locked, existing lock on file: exclusive
#0 /var/www/nextcloud/lib/private/Files/Storage/Common.php(758): OC\Lock\MemcacheLockingProvider->acquireLock()
#1 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Common->acquireLock()
#2 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Wrapper\Wrapper->acquireLock()
#3 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(335): OC\Files\Storage\Wrapper\Wrapper->acquireLock()
#4 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(256): OC\Files\Cache\Scanner->scan()
#5 /var/www/nextcloud/apps/files/lib/Command/Scan.php(144): OC\Files\Utils\Scanner->scan()
#6 /var/www/nextcloud/apps/files/lib/Command/Scan.php(200): OCA\Files\Command\Scan->scanFiles()
#7 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#8 /var/www/nextcloud/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run()
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run()
#10 /var/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#11 /var/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#12 /var/www/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#13 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#14 /var/www/nextcloud/occ(11): require_once(ā€˜ā€¦ā€™)
#15 {main}

so I donā€™t no were else to debug.

This should probably be 2 => 'nextcloudpi',

That is a bit strange, are you at the limit of your RAM? If you are low on memory, perhaps stop the webserver during your scan to free some memory.

This is folder for that user? Or do you use external authentication (LDAP)?

If a link from /var/www/nextcloud/data
to the directory where the physical data is.

I donā€™t use LDAP.

Speicherfehler;
low on Memory could be the problem. I have 4GB on a PI 4, and did run Nexctcloud Office. Was no problem so far, but could have changed. I deactivated the Office and will check the next dayā€™s. I cannot check directly because im not in the internal Network right know.

The deactivation of the office App didnā€™t change the problem.
Also the stop of apache2.service didnā€™t change the problem.
select * from oc_file_locks; Results still in ā€œEmpty set (0.006 sec)ā€

Any ideas to debug this problem?

I still have this problemā€¦

Could it be a hardware problem?

I have no idea to find the track.

I tried today the following:
I added ā€˜filelocking.enabledā€™ => false, to the end of my config.php.
did a file scan for one user ā†’ looked like working correctly
did a file scan for all users ā†’ Speicherfehler.
removed the ā€˜filelocking.enabledā€™ => false ā†’ Speicherfehler
added the ā€˜filelocking.enabledā€™ => false again ā†’ Speicherfehler

It is really strange

I also get this error when:
sudo -u www-data php /var/www/nextcloud/occ trashbin:cleanup someuser

Any Idea to debug this error - Iā€™ve still no solution:

By the way:
free tells me:


                         gesamt       benutzt     frei      gemns.  Puffer/Cache verfuegbar
Speicher:    3885560     1445432     1128708       52292     1311420     2294080

It somehow disappeared, after 3 month, some updates of NextcloudPi and Nextcloud

Did you update to a newer version that could explain that it was some change in the code?