StorageNotAvailableException error when adding a mounted sd drive as external storage

Nextcloud version (eg, 20.0.5): 28.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.57 (Ubuntu)
PHP version (eg, 7.4): 8.2.14 (CLI)

The issue you are facing:

I have a StorageNotAvailableException error when adding external storage in the admin interface:

StorageNotAvailableException Local storage path does not exist “/media/steve/samsung/”

I have this mounted as:

Filesystem:
/dev/sda1

Mounted on:
/media/steve/samsung

When I try to add /media/steve, I have no issue with mounting this part in the admin interface, but when I try to access the folders beneath this directory, I get a message saying the folder is empty. The permissions on the folder are:

owner: steve
group: steve

I’ve added the www-data user to the steve group and I’ve restarted apache, but no changes. I’m able to add local folders under the /home/steve folder with no issue. I don’t want to change the ownership of the /media/steve/samsung folder, as I don’t think I should have to. This isn’t running in docker as I’ve seen in most of the solutions, so I’m hoping it’s just something that I’m missing in adding this storage.

Thank you,

Steve

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

Steps to replicate it:

  1. Go to the admin section of Nextcloud
  2. Click on External storage
  3. Add new storage /media/steve/samsung
  4. Set folder name to Media
  5. Authentication is set to none
  6. Click the checkmark on the right
  7. Red error image appears to the left of the added line with the error message seen below.

The output of your Nextcloud log in Admin > Logging:

StorageNotAvailableException Local storage path does not exist "/media/steve/samsung/"

That’s the ownership. What are the permissions and ownership for each of the following (e.g. from an ls -l [folderName]`):

/media
/media/steve
/media/steve/samsung

I’m able to add local folders under the /home/steve folder with no issue.

I assume you meant /media/steve?

I don’t want to change the ownership of the /media/steve/samsung folder, as I don’t think I should have to.

The only real requirement from Nextcloud’s perspective is that the OS permits it to do a stat() on the underlying target path - e.g. can lookup some basic data about the folder (e.g. that it exists, it’s content, disk space used, etc.) And, of course, that any files created within share the same permissions.

I’ve added the www-data user to the steve group and I’ve restarted apache, but no changes.

You may need to bump the server, depending on how your services are managed. A simple reload of Apache may not inject the new group membership.

Permissions for :

/media
/media/steve
/media/steve/samsung

an ls -l [foldername] gives:

drwxr-x—+ 3 steve steve 4096 Jan 4 05:59 steve
drwxr-xr-x 12 steve steve 32768 Dec 31 1969 samsung
drwxr-xr-x 5 steve steve 32768 Oct 13 17:11 eBooks

for /home/steve, this is part of the local drive, not the sd drive and I’m able to add anything in the /home/steve folder, permissions are:

drwxr-xr-x 200 steve steve 12288 Jun 14 2023 Music

I have done a sudo systemctl restart apache2 on the server, would more be needed to “bump” the server?

Are there limitations with accessing the drive as it’s formatted as FAT32?

Thank you for your help.

Anyone have a solution for this?