Files:scan does not find all files uploaded via ftp

My installation:

Nextcloud version
Operating system and version: webhostet, I don’t have full root access.
Apache or nginx version: apache unknown version
PHP version: 7.2.28


The output of your Nextcloud log in Admin > Logging:

nextclou.log bei dropbox

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

$CONFIG = array (
  'instanceid' => '...',
  'passwordsalt' => '...',
  'secret' => '...',
  'trusted_domains' => 
  array (
    0 => 'domain.tld',
  'datadirectory' => '/var/www/vhosts/',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://domain.tld',
  'dbname' => '',
  'dbhost' => '',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'admin',
  'dbpassword' => '....',
  'installed' => true,
  'mail_domain' => 'domain.tld',
  'mail_from_address' => 'mail',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'mail@domain.tld',
  'mail_smtppassword' => '....',
  'maintenance' => false,
  '' => 'stable',
  'theme' => '',
  'loglevel' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'occweb',

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

error_log bei dropbox

As my Nextcloud instance cannot handle big files sizes in upload because of my webhosted server. So I upload bigger files via ftp and then scan them with occ app command files:scan --all. But it is not finding all files.
The strange thing about it is, that it finds some files, but not all.
I tried adding an external storage (ftp) which points to my webspace. In a seperate folder than nextcloud is running but it is still the same problem.

Is this the first time you’ve seen this error? (Y/N): No, but the first time I have time to care about it.

I would be very happy do get a little help here :). Please let me know if you need any more information.
THANKS! :slight_smile:

Perhaps it is better to use external storage “local”.

And what about the app “Flow Upload” for big files?

1 Like

thanks for the answer.
I tried flowupload a while ago already and it did not work correctly. Maybe I can give it another try.

But I can’t geht the “local” option with external storage to work. What kind of path do I have to enter in the web gui?

Look a screenshot:

1 Like

This is the php error:

stat(): stat failed for external-nc-data/ at /var/www/vhosts/

I think you must use as “Konfiguration” the full path.


If you use a vps or similar post:
ls -al /external-nc-data
(only dirs . and …)

You can also switch in the directory external-nc-data and post

sorry, what is vps?

when I use the full path the nextcloud log spams:

realpath(): open_basedir restriction in effect. File(/var/www/vhosts/ is not within the allowed path(s): (/var/www/vhosts/ at /var/www/vhosts/

Did you modify chown and chmod of the files you uploaded by ftp ?
In my case when i uploaded files with scp, i had to do chmod/chown on these files then occ files:scan user to make them visible in Nextcloud

You must find the full path for your directory “external-nc-data”.



Can you use a terminal (SSH).
Go to the directory with “cd” and

Do you use ftp?
Compare the dirs in ftp and in www.
Add /var/www/vhosts/…/ to the dir-name “external-nc-data”.

I did check the write/read rights wihtin my ftp program and set it to the same which other files had. in my case 644.

Yes. But what about the paths?
If you only use Web and FTP you have no directory /
All starts with /var/www/vhosts/

Upload in an admin-dir this php-filemanager:

Only one index.php in one directory.
Start it and look at the path.

1 Like

And the owner is : www-data or httpd ?

when i do this i get the ouptut: /

how do i check the owner? and how do i edit it?

Into the server
Go in the folder before your ftp uploaded folder.
: ls -ll
Then return
You will for exemple :
Ftpuset:root 2020/04/03 Myfolder
In this case the user owner is ftpuser and the group owner is root.

If you are on Debian/Ubuntu you have to do chown -R www-data:www-data Myfolder

Look at the Nextcloud documentation about Checking permission you will see examples.

1 Like

okay … :smiley: haha this is super difficult for me. Dont think i can fix this.

maybe I just use something else than nextcloud. but I like the idea having the files on my own webspace. :confused:

Don’t give up.
I learnt how to use Linux thanks to Nextcloud.

Look on the web about videos or “how to“ on use Linux / Nextcloud

1 Like

Please upload this file (file manager) to filemanager.php or directory/index.php and start it in the browser.
(save as and then upload with ftp)


Look at the path for external data directory.

1 Like

Okay guys, I found my solution:

I had files with special german letters like “ä” in the name. I renamed them and suddenly occ command found them!

thank you for the help everyone!

the path above is correct. but i think netcup hosting provider is kind of blocking nextcloud to access it? can that be?

Tja. Deutsche Umlaute sollten abgeschafft werden :wink:
Hast du denn den Filemanager noch ausprobiert?

1 Like

Ja, auf den ersten blick sieht der echt gut aus. Aber muss mich mal in ruhe damit beschäftigen. Eventuell kann ich den für andere Sachen gut gebrauchen.