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:
{ā€œreqIdā€:ā€œXEZopH8AAQEAAGNn6C4AAAsRā€,ā€œlevelā€:3,ā€œtimeā€:ā€œ2019-01-22T00:49:40+00:00ā€,ā€œremoteAddrā€:ā€œ10.10.10.1ā€,ā€œuserā€:ā€œtestuserā€,ā€œappā€:ā€œcoreā€,ā€œmethodā€:ā€œPOSTā€,ā€œurlā€:
ā€œ/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ā€:ā€œ15.0.2.0ā€}

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