External storage reading "0 kb" despite probably showing up in filesystem

This is a new issue but may be related to this previous topic: Can't add local external storage to fresh Nextcloud install- error: External storage not available: stat() failed

Nextcloud version: 19.01

Operating system and version:

Ubuntu 20.04

Apache or nginx version:

nginx 1.18.0

PHP version:

7.4.9

The issue you are facing:

I have added local external storage but it is showing up in the Nextcloud Web UI interface as containing 0kb of data

Is this the first time you’ve seen this error?

yes

Steps to replicate it:

  1. fresh install using this ansible playbook: https://github.com/ReinerNippes/nextcloud/tree/nextcloud-reloaded
  2. attempt to add external storage
  3. ran into errors
  4. fixed errors as per previously linked forum topic
  5. Now running into new problem with the local storage

The output of your Nextcloud log in Admin > Logging:

no relevant logs

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

<?php
$CONFIG = array (
  'passwordsalt' => '{REDACTED}',
  'secret' => '{REDACTED}',
  'trusted_domains' => 
  array (
    0 => 'cloud.aslanfrench.work',
  ),
  'datadirectory' => '/var/nc-data',
  'dbtype' => 'pgsql',
  'version' => '19.0.1.1',
  'overwrite.cli.url' => 'https://cloud.aslanfrench.work',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '{REDACTED}',
  'installed' => true,
  'instanceid' => 'occ902x1gtuw',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0,
    'password' => '{REDACTED}',
  ),
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 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\\MarkDown',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\Illustrator',
    9 => 'OC\\Preview\\Movie',
    10 => 'OC\\Preview\\MSOffice2003',
    11 => 'OC\\Preview\\MSOffice2007',
    12 => 'OC\\Preview\\MSOfficeDoc',
    13 => 'OC\\Preview\\OpenDocument',
    14 => 'OC\\Preview\\PDF',
    15 => 'OC\\Preview\\Photoshop',
    16 => 'OC\\Preview\\Postscript',
    17 => 'OC\\Preview\\StarOffice',
    18 => 'OC\\Preview\\SVG',
    19 => 'OC\\Preview\\TIFF',
    20 => 'OC\\Preview\\Font',
  ),
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_facto' => 1,
  'auth.bruteforce.protection.enabled' => true,
  'trashbin_retention_obligation' => 'auto,7',
  'skeletondirectory' => '',
  'defaultapp' => 'file',
  'activity_expire_days' => 14,
  'integrity.check.disabled' => false,
  'updater.release.channel' => 'stable',
  'loglevel' => 1,
  'maintenance' => false,
  'theme' => '',
);

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

Nextcloud error log:

no relevant logs

nginx error log sample:

no relevant logs

Further Info

Following troubleshooting in previous thread I remounted the drive under /work.

I can now successfully add it to Nextcloud via external storage but it’s showing up in the web client as having 0 kb.

I think the problem is that /work is showing as still having ownership under the root:root user and group.

When I try to chown the group ownership to aslan it dos not work. When I google this I see posts saying that this may be because an NTFS drive is being mounted as read-only, but I’m not clear on how to fix that? Do I have to change the drive into a non NTFS drive?

I guess I could do that, but what confuses me is that this was working as an NTFS drive previously with nextcloud so I don’t understand what the issue is now.

Hi, maybe you could have a look at your fstab and see what the permissions are for this drive?
I am pretty sure that you should be able to mount a ntfs drive in writeable mode.

Sorry for the delay in response. Here’s my fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=62f8caf9-6ff7-4386-935f-95ed395c17b3 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=9222-327D  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

I tried mounting the drive by adding it to fstab but it caused a problem when I restarted. I had to manually remount it using the “disks” app. When I check fstab I see the following:

# work hard drive
/dev/sdd1 /work NTFS defaults,x-gvfs-name=work,noauto 0 0

which looks like my mounting info but the “x-gvfs-name-work” and noauto have been added by the disks app, I’m pretty sure.

EDIT: I checked in on the disks app thing again and just edited mount options there and got it working. Can confirm that the contents of /work are now visible in the nextcloud web client. fstab was auto updated to

/dev/disk/by-uuid/26A897D121465A69 /work auto nosuid,nodev,nofail,x-gvfs-show 0 0

IDK what exactly fixed it, doing it that way but it seems to be working and the changes are in fstab so it should be persistent. Thank you!