New users fail first login, don't get default files "Following symlinks is not allowed"

New install of NC15 on a Raspbian Jesse 9 RPI3 (bash script install). Have a WD 2T drive on USB. Used NCP wizard to format that with BTRFS and use it as nc-datadir. ncp sets the nc-datadir to be /media/USBdrive/ncdata which is a symlink to /media/myCloudDrive

ncp admin user works fine, has the default files (Nextcloud manual pdf etc) but when I create a new user then attempt to login as that user the first login will fail with “Internal Server Error”, subsequent login succeeds, but Files is blank. Not a huge issue as I’d normally delete those files anyway but something is obviously wrong.

Log file shows:
“/index.php/login”,“message”:“Following symlinks is not allowed (’/media/USBdrive/ncdata/testuser/cache’ -> '/media/myCloudDrive/ncdata/testuser/cache/
’ not inside ‘/media/USBdrive/ncdata/testuser/’)”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome
/71.0.3578.98 Safari/537.36”,“version”:“”}

I have done a permissions fix after getting this error on one user and before creating another - same result
Permissions are as follows:
root@nextcloudpi:/media# ls -al
total 24
drwxr-xr-x 3 root root 4096 Jan 22 10:23 .
drwxr-xr-x 21 root root 4096 Jan 19 16:34 …
drwxr-xr-x 1 root root 34 Jan 22 11:19 myCloudDrive
lrwxrwxrwx 1 root root 19 Jan 22 10:23 USBdrive -> /media/myCloudDrive

root@nextcloudpi:/media/myCloudDrive# ls -al
total 20
drwxr-xr-x 1 root root 34 Jan 22 11:19 .
drwxr-xr-x 3 root root 4096 Jan 22 10:23 …
drwxr-x— 1 www-data www-data 246 Jan 22 11:49 ncdata
drwxr-xr-x 1 root root 74 Jan 22 11:19 ncp-backups

I tried following the advice to not use symlinks in this post, although this is a later NC version and I only have one drive but I changed nc-datadir to point to /media/myCloudDrive/ncdata instead of via the /media/USBdrive/ncdata but that failed and then the installation was very broken (ncdata existed but was owned by root and no files, tools kept throwing errors because they couldn’t find ncdata etc) so I reinstalled. Stuck on same issue.

1 Like

Did you find the solution? I have the same problem

Nope, I switched to a snap install on linux. Missing out on some of the ncp features but haven’t hit this issue since.

I still get the same error. Any help?

Workaround working for me:

  1. In wizard say “NO” to “Do you want to save Nextcloud data in a USB drive?”.
  2. Go to Format USB-Setting in NCP and set as myCloudDrive.
  3. activate auto-mount setting in NCP
  4. Go to Datapath-Settings in NCP and set “/media/myCloudDrive/ncdata” as Path.

:slight_smile: 5. be happy

1 Like

At step 4, I get the message and cannot change the folder:

[ nc-datadir ]
Error reading data directory. Is NextCloud running and configured?

I will try to reproduce and fix it. In the mean time, you can edit /var/www/nextcloud/config/config.php and replace the contents of datadir to the correct path that is not a symlink, like /media/myCloudDrive/ncdata

I have a fix in the devel branch. Testing it well before pushing it to everyone

1 Like

fixed. Thanks for reporting

1 Like