Nextcloud only lists ten files and folders from s3 (wasabi) external storage

Nextcloud version: 17.0.0
Operating system and version: Ubuntu 18.04.3 LTS
Apache or nginx version: nginx/1.14.0
PHP version: 7.3.11

The issue you are facing:

I set up a new Nextcloud server and connected a Wasabi S3 bucket. The bucket works and the files and folders are visible, but it looks like Nextcloud only retrieves 10 files and folders on the root folder.

So when I navigate to my mount point in Nextcloud, for example, I see 9 folders and 1 file. If I go into a folder that has a bunch of subfolders, I can see 12 folders and 1 file.

The subfolders seem to be working fine. I can’t figure out why the Nextcloud isn’t pulling in all of its subfolders.

The storage is not encrypted.

I can see all the folders and files on Wasabi’s website, as well as other tools.

I took a look at the network request in the devtools. It returns 11 objects, one for the root folder, and 10 for its files and subfolders. I don’t see any properties or settings that seem to be relevant.

Is this the first time you’ve seen this error? (Y/N): It’s a new server and I’m new here. So, yes, I guess.

Steps to replicate it: I’m not really sure. The setup is detailed above.

The output of your Nextcloud log in Admin > Logging:
I’m skipping log entries that don’t seem to be relevant.

[PHP] Error: fclose(): supplied resource is not a valid stream resource at /home/cloususer/my.cloud/public/apps/files_external/lib/Lib/Storage/AmazonS3.php#641

PUT /remote.php/webdav/main/<subfolder>/<long-html-encoded-file-name>.pdf
from <my-ip> by <user1> at 2019-11-04T18:04:20+00:00

There’s another error just like it. These are the only two errors related to storage that occurred after I managed to connect the bucket. The only other errors are login errors from a few failed attempts by another user.

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

<?php
$CONFIG = array (
  'instanceid' => '<snip>',
  'passwordsalt' => '<snip>',
  'secret' => '<snip>',
  'trusted_domains' =>
  array (
    0 => '<my-domain>',
  ),
  'datadirectory' => '/home/clouduser/<my-domain>/public/data',
  'dbtype' => 'mysql',
  'version' => '17.0.0.9',
  'overwrite.cli.url' => 'https://<my-domain>',
  'dbname' => '<db-name>',
  'dbhost' => '<server-host>:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '<db-user>',
  'dbpassword' => '<db-password>',
  'installed' => true,
  'maintenance' => false,
);

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

// file: <my-domain>-error.log
2019/11/06 20:16:39 [error] 1217#1217: *39366 access forbidden by rule, client: <my-ip>, server: <my-domain>, request: "PROPFIND /.well-known/caldav HTTP/2.0", host: "<my-domain>"
2019/11/06 20:16:39 [error] 1217#1217: *39366 access forbidden by rule, client: <my-ip>, server: <my-domain>, request: "PROPFIND /.well-known/carddav HTTP/2.0", host: "<my-domain>"
2019/11/06 20:16:39 [error] 1217#1217: *39366 access forbidden by rule, client: <my-ip>, server: <my-domain>, request: "GET /data/.ocdata?t=1573067799269 HTTP/2.0", host: "<my-domain>"

// file: error.log
2019/11/06 09:21:01 [crit] 1217#1217: *37975 SSL_do_handshake() failed (SSL: error:1420918C:SSL routines:tls_early_post_process_client_hello:version too low) while SSL handshaking, client: <some-ip>, server: 0.0.0.0:443

Is it possible that you have to rescan the files to add them to Nextcloud?
On Ubuntu: sudo -u www-data php occ files:scan --all

If you place the files on server with ftp, then They are not added to Nextcloud automatically.

Thanks for your help!

I was about to start the rescan when I noticed that the cronjob hasn’t been running. Assuming these scans typically happen in the background, I figure that might be the cause.

The cronjob is reporting this error:

Could not open input file: /home/<user>/<domain>/cron.php

The funny thing is that I’m actually executing cron.php with this command:

php -f /home/<user>/<domain>/public/cron.php

Note the public directory missing in the error message. This is the correct directory.

Is this a setting that needs to be fixed somewhere or a bug in cron.php? I can’t see any relevant setting in config.php