Add External Storage (SFTP) -> Undefined array key "mtime"

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

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:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.6
  • Operating system and version (e.g., Ubuntu 24.04):
    • Synology DS216+
  • Web server and version (e.g, Apache 2.4.25):
    • Apache 2.4.58
  • PHP version (e.g, 8.3):
    • 8.2.21
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • after configuration of external storage

Summary of the issue you are facing:

I can successfully add the external storage (green tick). But when I then try to access the files via the browser, I get the error message “This directory is not available, please check the log files or contact the administrator.”
The following error is reported in the log file

  • Error PHP
    Undefined array key “mtime” at /volume1/web/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#560

  • Error files
    Error Call to a member function getPermissions() on array

Steps to replicate it (hint: details matter!):

  1. Configure external Storage (SFTP)

Log entries

Nextcloud

Fehler	PHP	
Undefined array key "mtime" at /volume1/web/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#560
24.02.2025, 20:07:07	
Fehler	files	
Error Call to a member function getPermissions() on array
24.02.2025, 20:07:06	
Fehler	PHP	
Undefined array key "mtime" at /volume1/web/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#560
24.02.2025, 20:07:06	
Fehler	PHP	
Undefined array key "mtime" at /volume1/web/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#560
24.02.2025, 19:52:54	
Fehler	webdav	
Error Call to a member function getPermissions() on array
24.02.2025, 19:52:54	
Fehler	PHP	
Undefined array key "mtime" at /volume1/web/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#560
24.02.2025, 19:52:54	

Configuration

Nextcloud

<?php
$CONFIG = array (
  'instanceid' => '****',
  'passwordsalt' => '****',
  'secret' => '****',
  'trusted_domains' => 
  array (
    0 => '****',
    1 => '****',
    2 => '****',
  ),
  'datadirectory' => '/volume1/nextcloud/data',
  'overwrite.cli.url' => 'http://****/nextcloud',
  'dbtype' => 'mysql',
  'version' => '30.0.6.2',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1:3307',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_root',
  'dbpassword' => '',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'maintenance_window_start' => '1',
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => '',
  'mail_domain' => '',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '',
  'mail_smtpport' => '587',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => '6379',
    'timeout' => '0',
    'password' => '',
    'dbindex' => '0',
  ),
  'default_phone_region' => 'DE',
  'updater.release.channel' => 'stable',
  'trashbin_retention_obligation' => '30,60',
  'mysql.utf8mb4' => true,
  'preview_max_memory' => 128,
  'simpleSignUpLink.shown' => false,
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
    1 => 'files_texteditor',
  ),
  'forbidden_filename_basenames' => 
  array (
    0 => 'con',
    1 => 'prn',
    2 => 'aux',
    3 => 'nul',
    4 => 'com0',
    5 => 'com1',
    6 => 'com2',
    7 => 'com3',
    8 => 'com4',
    9 => 'com5',
    10 => 'com6',
    11 => 'com7',
    12 => 'com8',
    13 => 'com9',
    14 => 'com¹',
    15 => 'com²',
    16 => 'com³',
    17 => 'lpt0',
    18 => 'lpt1',
    19 => 'lpt2',
    20 => 'lpt3',
    21 => 'lpt4',
    22 => 'lpt5',
    23 => 'lpt6',
    24 => 'lpt7',
    25 => 'lpt8',
    26 => 'lpt9',
    27 => 'lpt¹',
    28 => 'lpt²',
    29 => 'lpt³',
  ),
  'forbidden_filename_characters' => 
  array (
    0 => '<',
    1 => '>',
    2 => ':',
    3 => '"',
    4 => '|',
    5 => '?',
    6 => '*',
    7 => '\\',
    8 => '/',
  ),
  'forbidden_filename_extensions' => 
  array (
    0 => ' ',
    1 => '.',
    2 => '.filepart',
    3 => '.part',
  ),
);

Is this a bug?

Can’t anyone here help me?
Can someone perhaps recreate the problem?

I don’t know if that is relevant. When I run an “occ files:scan --all”, I get these error messages for the user who is enabled for the external storage.

Blockzitat
Starting scan for user 9 out of 12 (root)
Error during scan: Undefined array key “mtime”
Error during scan: Undefined array key “mtime”
Exception during scan: Parent folder not in filecache for docker
#0 /volume1/web/nextcloud/lib/private/Files/Cache/Wrapper/CacheWrapper.php(129):OC\Files\Cache\Cache->insert(‘docker’, Array)
#1 /volume1/web/nextcloud/lib/private/Files/Cache/Scanner.php(284): OC\Files\Cache\Wrapper\CacheWrapper->insert(‘docker’, Array)
#2 /volume1/web/nextcloud/lib/private/Files/Cache/Scanner.php(217): OC\Files\Cache\Scanner->addToCache(‘docker’, Array, -1)
#3 /volume1/web/nextcloud/lib/private/Files/Cache/Scanner.php(501): OC\Files\Cache\Scanner->scanFile(‘docker’, 3, -1, false, true, Array)
#4 /volume1/web/nextcloud/lib/private/Files/Cache/Scanner.php(425): OC\Files\Cache\Scanner->handleChildren(‘’, true, 3, -1, true, 0, false)
#5 /volume1/web/nextcloud/lib/private/Files/Cache/Scanner.php(331): OC\Files\Cache\Scanner->scanChildren(‘’, true, 3, -1, true, -1)
#6 /volume1/web/nextcloud/lib/private/Files/Utils/Scanner.php(262): OC\Files\Cache\Scanner->scan(‘’, true, 3)
#7 /volume1/web/nextcloud/apps/files/lib/Command/Scan.php(153): OC\Files\Utils\Scanner->scan(‘/root’, true, NULL)
#8 /volume1/web/nextcloud/apps/files/lib/Command/Scan.php(214): OCA\Files\Command\Scan->scanFiles(‘root’, ‘/root’, NULL, Object(Symfony\Component\Console\Output \ConsoleOutput), false, true, false)
#9 /volume1/web/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /volume1/web/nextcloud/core/Command/Base.php(161): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object( Symfony\Component\Console\Output\ConsoleOutput))
#11 /volume1/web/nextcloud/3rdparty/symfony/console/Application.php(1078): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(S ymfony\Component\Console\Output\ConsoleOutput))
#12 /volume1/web/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Ob ject(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Consol e\Output\ConsoleOutput))
#13 /volume1/web/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\Ar gvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /volume1/web/nextcloud/lib/private/Console/Application.php(183): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput ), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /volume1/web/nextcloud/console.php(87): OC\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#16 /volume1/web/nextcloud/occ(11): require_once(‘/volume1/web/ne…’)
#17 {main}