Nextcloud Docker Filescan not work

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

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.7
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): 8.0.25
Docker Image: Original Image additional with imagick

The issue you are facing:

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

Steps to replicate it:

  1. Go on the VM
  2. Use Filescan with docker exec " docker exec -u www-data nextcloud-app-1 php /var/www/html/occ files:scan --path=“username/files/Pathexternal”"
  3. wait

The output of your Nextcloud log in Admin > Logging:

Nothing

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
     'host' => 'redis',
     'port' => 6379,
     'timeout' => 0.0,
     'password' => '', // Optional, if not defined no password will be used.
      ),
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),

  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
  	1 => '',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '24.0.6.1',
  'overwrite.cli.url' => '',
  'overwritecondaddr' => '',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nc',
  'dbpassword' => '',
  'installed' => true,
  'enable_previews' => true,
  '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\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'theme' => '',
  'trashbin_retention_obligation' => 'auto, 7',
  'loglevel' => 2,
  'ldapIgnoreNamingRules' => false,
  'session_keepalive' => true,
  'session_lifetime' => 86400,
  'skeletondirectory' => '',
  'default_phone_region' => 'DE',
  'default_language' => 'de',
  'default_locale' => 'de_DE',
  'onlyoffice' => 
   array (
    'verify_peer_off' => true,
    'jwt_secret' => "",
    'jwt_header' => "AuthorizationJwt"
   ),
);

If i start the Scan of the external Storage, the HDD spin up (NAS). I can see very low traffic on the nas ~20mb/s. After ~10 Minutes the HDD spindown, the Scan doesnt stop with error. It run endless without success.

How can i solve this? Before on native installation it runs with the same external storage.

Thanks

Did you try running with -vvv to see debug info?

Also are you sure the path is correct?

The Path is correct. Some Files and Folders are visible after scan, some not.

grafik

It simply stuck:

No error, nothing. I removed the file now, restart the scan, the scan stuck ~60 files later again.

I checked the files, they are working. The User for the external storage has full control rights and is owner of the files and folders.

If i use --unscanned i get an error:

Exception during scan: Undefined array key "attributes"
#0 /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Parser.php(155): OCA\Files\Command\Scan->exceptionErrorHandler(2, 'Undefined array...', '/var/www/html/a...', 155)
#1 /var/www/html/apps/files_external/3rdparty/icewind/smb/src/Wrapped/Share.php(217): Icewind\SMB\Wrapped\Parser->parseStat(Array)
#2 /var/www/html/apps/files_external/lib/Lib/Storage/SMB.php(193): Icewind\SMB\Wrapped\Share->stat('/Verfahren/2021...')
#3 /var/www/html/apps/files_external/lib/Lib/Storage/SMB.php(645): OCA\Files_External\Lib\Storage\SMB->getFileInfo('/Verfahren/2021...')
#4 /var/www/html/lib/private/Files/Storage/Common.php(115): OCA\Files_External\Lib\Storage\SMB->filetype('Verfahren/2021-...')
#5 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(114): OC\Files\Storage\Common->is_dir('Verfahren/2021-...')
#6 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(114): OC\Files\Storage\Wrapper\Wrapper->is_dir('Verfahren/2021-...')
#7 /var/www/html/lib/private/Files/Storage/Wrapper/Availability.php(131): OC\Files\Storage\Wrapper\Wrapper->is_dir('Verfahren/2021-...')
#8 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(114): OC\Files\Storage\Wrapper\Availability->is_dir('Verfahren/2021-...')
#9 /var/www/html/apps/workflowengine/lib/Check/FileMimeType.php(126): OC\Files\Storage\Wrapper\Wrapper->is_dir('Verfahren/2021-...')
#10 /var/www/html/apps/workflowengine/lib/Check/FileMimeType.php(109): OCA\WorkflowEngine\Check\FileMimeType->getActualValue()
#11 /var/www/html/apps/workflowengine/lib/Service/RuleMatcher.php(245): OCA\WorkflowEngine\Check\FileMimeType->executeCheck('is', '/image\\/.*/')
#12 /var/www/html/apps/workflowengine/lib/Service/RuleMatcher.php(180): OCA\WorkflowEngine\Service\RuleMatcher->check(Array)
#13 /var/www/html/apps/workflowengine/lib/Service/RuleMatcher.php(128): OCA\WorkflowEngine\Service\RuleMatcher->getMatchingOperations('OCA\\FilesAutoma...', false)
#14 /var/www/html/custom_apps/files_automatedtagging/lib/Operation.php(95): OCA\WorkflowEngine\Service\RuleMatcher->getFlows(false)
#15 /var/www/html/custom_apps/files_automatedtagging/lib/Listener/CacheListener.php(43): OCA\FilesAutomatedTagging\Operation->checkOperations(Object(OCA\Files_Trashbin\Storage), 2805236, 'Verfahren/2021-...')
#16 /var/www/html/lib/private/EventDispatcher/ServiceEventListener.php(87): OCA\FilesAutomatedTagging\Listener\CacheListener->handle(Object(OCP\Files\Cache\CacheEntryInsertedEvent))
#17 /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php(251): OC\EventDispatcher\ServiceEventListener->__invoke(Object(OCP\Files\Cache\CacheEntryInsertedEvent), 'OCP\\Files\\Cache...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#18 /var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'OCP\\Files\\Cache...', Object(OCP\Files\Cache\CacheEntryInsertedEvent))
#19 /var/www/html/lib/private/EventDispatcher/EventDispatcher.php(88): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(OCP\Files\Cache\CacheEntryInsertedEvent), 'OCP\\Files\\Cache...')
#20 /var/www/html/lib/private/EventDispatcher/EventDispatcher.php(100): OC\EventDispatcher\EventDispatcher->dispatch('OCP\\Files\\Cache...', Object(OCP\Files\Cache\CacheEntryInsertedEvent))
#21 /var/www/html/lib/private/Files/Cache/Cache.php(327): OC\EventDispatcher\EventDispatcher->dispatchTyped(Object(OCP\Files\Cache\CacheEntryInsertedEvent))
#22 /var/www/html/lib/private/Files/Cache/Wrapper/CacheWrapper.php(135): OC\Files\Cache\Cache->insert('Verfahren/2021-...', Array)
#23 /var/www/html/lib/private/Files/Cache/Scanner.php(296): OC\Files\Cache\Wrapper\CacheWrapper->insert('Verfahren/2021-...', Array)
#24 /var/www/html/lib/private/Files/Cache/Scanner.php(226): OC\Files\Cache\Scanner->addToCache('Verfahren/2021-...', Array, -1)
#25 /var/www/html/lib/private/Files/Cache/Scanner.php(438): OC\Files\Cache\Scanner->scanFile('Verfahren/2021-...', 3, 2801156, false, true, Array)
#26 /var/www/html/lib/private/Files/Cache/Scanner.php(390): OC\Files\Cache\Scanner->handleChildren('Verfahren/2021-...', 2, 3, 2801156, true, 0)
#27 /var/www/html/lib/private/Files/Cache/Scanner.php(342): OC\Files\Cache\Scanner->scanChildren('Verfahren/2021-...', 2, 3, 2801156, true)
#28 /var/www/html/lib/private/Files/Cache/Scanner.php(532): OC\Files\Cache\Scanner->scan('Verfahren/2021-...', 2, 3)
#29 /var/www/html/lib/private/Files/Cache/Scanner.php(544): OC\Files\Cache\Scanner->OC\Files\Cache\{closure}()
#30 /var/www/html/lib/private/Files/Cache/Scanner.php(531): OC\Files\Cache\Scanner->runBackgroundScanJob(Object(Closure), 'Verfahren/2021-...')
#31 /var/www/html/lib/private/Files/Utils/Scanner.php(182): OC\Files\Cache\Scanner->backgroundScan()
#32 /var/www/html/apps/files/lib/Command/Scan.php(142): OC\Files\Utils\Scanner->backgroundScan('/corin.corvus/f...')
#33 /var/www/html/apps/files/lib/Command/Scan.php(200): OCA\Files\Command\Scan->scanFiles('corin.corvus', '/corin.corvus/f...', Object(Symfony\Component\Console\Output\ConsoleOutput), true, true, false)
#34 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#35 /var/www/html/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#36 /var/www/html/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#37 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#38 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#39 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#40 /var/www/html/console.php(100): OC\Console\Application->run()
#41 /var/www/html/occ(11): require_once('/var/www/html/c...')
#42 {main}

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 1       | 1     | 00:00:00     |
+---------+-------+--------------+

May you have another argument like -vvv, where i can see the progress in percent or similar like that?

On Video Files it stuck or need veeery long (Last time 1 500mb video stuck with no continue over 4 hours)

Now i got an Error after Strg-C the scan: Exception during scan: mime_content_type(/tmp/oc_tmp_bKHARZ-.MP4): Failed to open stream: No such file or directory

Ok i found one reason. Sometimes the /root partition is full while scan. i extend the hdd and scan again… stuck again.

if i start the folder, who the scanner stuck i get this:

> Exception during scan: "files/8e1d407c971b88ce448d72f644ab7428"("smb::media.user@c-lab.one@10.0.0.15//Familie//::scanner::Medien/folder1/2020-02-V") is locked, existing lock on file: exclusive
> #0 /var/www/html/lib/private/Files/Storage/Common.php(758): OC\Lock\MemcacheLockingProvider->acquireLock('files/8e1d407c9...', 2, 'smb::media.user...')
> #1 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Common->acquireLock('scanner::Medien...', 2, Object(OC\Lock\MemcacheLockingProvider))
> #2 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::Medien...', 2, Object(OC\Lock\MemcacheLockingProvider))
> #3 /var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php(610): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::Medien...', 2, Object(OC\Lock\MemcacheLockingProvider))
> #4 /var/www/html/lib/private/Files/Cache/Scanner.php(335): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::Medien...', 2, Object(OC\Lock\MemcacheLockingProvider))
> #5 /var/www/html/lib/private/Files/Utils/Scanner.php(256): OC\Files\Cache\Scanner->scan('Medien/Emina/20...', true, 3)
> #6 /var/www/html/apps/files/lib/Command/Scan.php(144): OC\Files\Utils\Scanner->scan('/corin.corvus/f...', true, NULL)
> #7 /var/www/html/apps/files/lib/Command/Scan.php(200): OCA\Files\Command\Scan->scanFiles('corin.corvus', '/corin.corvus/f...', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
> #8 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #9 /var/www/html/core/Command/Base.php(168): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #10 /var/www/html/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #11 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #12 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #13 /var/www/html/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #14 /var/www/html/console.php(100): OC\Console\Application->run()
> #15 /var/www/html/occ(11): require_once('/var/www/html/c...')
> #16 {main}

so i : docker exec -it nextcloud-redis-1 redis-cli FLUSHALL

and start the scan again. it stuck on the same mp4 files in different folders. :pensive:

I don’t think so, but you can check available options with --help.