I’m getting this error in the Nextcloud log and red exclamation mark is shown when I want to add the new path:
Error PHP stat(): stat failed for /home/user/pictures/ at /srv/nextcloud/lib/private/Files/Storage/Local.php#143
I’ve double checked and the permissions are correct.
I’m using Nextcloud 17. Any ideas?
Also these are the warnings I see in the overview tab, anything to worry about?
* MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read [the documentation page about this](https://docs.nextcloud.com/server/17/go.php?to=admin-mysql-utf8mb4).
* The "X-Robots-Tag" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "X-Download-Options" HTTP header is not set to "noopen". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "X-Permitted-Cross-Domain-Policies" HTTP header is not set to "none". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "X-XSS-Protection" HTTP header doesn't contain "1; mode=block". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
* The "Strict-Transport-Security" HTTP header is not set to at least "15552000" seconds. For enhanced security, it is recommended to enable HSTS as described in the [security tips ↗](https://docs.nextcloud.com/server/17/go.php?to=admin-security).
* No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the [documentation](https://docs.nextcloud.com/server/17/go.php?to=admin-performance).
* This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.
* The "Referrer-Policy" HTTP header is not set to "no-referrer", "no-referrer-when-downgrade", "strict-origin", "strict-origin-when-cross-origin" or "same-origin". This can leak referer information. See the [W3C Recommendation ↗](https://www.w3.org/TR/referrer-policy/).```
you have to give the webserver user permission, e.g. putting him in the same group or something. But if there is a security issue, the webserver can possibly read the whole personal folder. It would be a better to mount this drive to a neutral path (like /mnt/pictures), /mnt is readable by everyone and for the /mnt/pictures you can define who owns it and who is in the group to access it. (a user can still access and use a symbolic link to it in his home folder).
So I mounted the folder using: sudo mount --bind /home/user/pictures /srv/nextcloud/data/user/files/pictures
and I see that it works when I look at the folder through SSH but the Nextcloud doesn’t see the files, it says that folder “pictures” has 0 KB. How do I force Nextcloud to see the files?
Also how do I get this mount to be applied on system boot?
I’ve tried adding it to /etc/fstab but it is not working properly, it seems I’m adding it incorrectly, can anyone tell what would be the exact line that needs to be added to /etc/fstab from the above example?
Because you first have to make sure that the user under which your web server is running, e.g. “http”, is allowed to access these files and folders. Second you have to scan and import the file structure to the Nextcloud database by running ./occ files:scan [options] [--] [<user_id>...] .
Thanks, I ran the occ command and Nextcloud finally displayed files. But whenever there is a change or new files are added in that folder through SSH or other apps, they are not reflected in Nextcloud web UI, how to fix that?
Nextcloud is a software which is installed on top of an exiting system not replacing a system. It relies on system components and if you’re not providing this components it couldn’t fulfill its job. So install the missing component and it should work