Following symlinks is not allowed, how to fix

Nextcloud version (eg, 18.0.2): 19.0.2
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.1 LTS \n \l
Apache or nginx version (eg, Apache 2.4.25): Server version: Apache/2.4.41 (Ubuntu)
PHP version (eg, 7.1): PHP 7.4.3 (cli) (built: May 26 2020 12:24:22) ( NTS )

The issue you are facing:
When I go to http://sturtz.ml I get:


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

Steps to replicate it:

  1. Install with the occ command
  2. goto website

The output of your Nextcloud log in Admin > Logging:

{"reqId":"fLut6i6Jnlh80SZIL6hB","level":3,"time":"2020-09-09T22:05:07+00:00","remoteAddr":"","user":"admin","app":"core","method":"","url":"--","message":"Following symlinks is not allowed ('/home/sturtz/public_html/data/admin/.' -> '/data/admin/' not inside '/home/sturtz/public_html/data/admin/')","userAgent":"--","version":"19.0.2.2"}

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

<?php
$CONFIG = array (
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => 'sturtz.ml',
  ),
  'datadirectory' => '***',
  'dbtype' => 'mysql',
  'version' => '19.0.2.2',
  'overwrite.cli.url' => 'http://sturtz.ml',
  'dbname' => '***',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
);

The output of your Apache/nginx/system log in /var/log/____: Here is the last 10 lines

[Wed Sep 09 18:32:33.922946 2020] [fcgid:warn] [pid 106053] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62734] mod_fcgid: stderr: {"reqId":"rlN4Pu9MitiiidWpPGXp","level":3,"time":"2020-09-09T23:32:33+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"PHP","method":"GET","url":"/","message":"chmod(): Operation not permitted at /home/sturtz/public_html/lib/private/Config.php#246","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:32:33.922961 2020] [fcgid:warn] [pid 106053] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62734] mod_fcgid: stderr: {"reqId":"rlN4Pu9MitiiidWpPGXp","level":3,"time":"2020-09-09T23:32:33+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"index","method":"GET","url":"/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/home/sturtz/public_html/lib/private/Config.php","line":134,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/home/sturtz/public_html/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/home/sturtz/public_html/lib/private/legacy/OC_Util.php","line":1146,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/home/sturtz/public_html/lib/base.php","line":650,"function":"initSession","class":"OC","type":"::"},{"file":"/home/sturtz/public_html/lib/base.php","line":1095,"function":"init","class":"OC","type":"::"},{"file":"/home/sturtz/public_html/index.php","line":35,"args":["/home/sturtz/public_html/lib/base.php"],"function":"require_once"}],"File":"/home/sturtz/public_html/lib/private/Config.php","Line":250,"Hint":"This can usually be fixed by giving the webserver write access to the config directory.","CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:32:33.922985 2020] [fcgid:warn] [pid 106053] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62734] mod_fcgid: stderr: {"reqId":"rlN4Pu9MitiiidWpPGXp","level":3,"time":"2020-09-09T23:32:33+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"index","method":"GET","url":"/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: could not find driver","Code":0,"Trace":[{"file":"/home/sturtz/public_html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":889,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/home/sturtz/public_html/lib/private/DB/Connection.php","line":194,"function":"executeQuery","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/home/sturtz/public_html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":200,"function":"executeQuery","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/home/sturtz/public_html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder","type":"->"},{"file":"/home/sturtz/public_html/lib/private/AppConfig.php","line":331,"function":"execute","class":"OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder","type":"->"},{"file":"/home/sturtz/public_html/lib/private/AppConfig.php","line":109,"function":"loadConfigValues","class":"OC\\\\AppConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/private/AppConfig.php","line":287,"function":"getApps","class":"OC\\\\AppConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/private/App/AppManager.php","line":136,"function":"getValues","class":"OC\\\\AppConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/private/App/AppManager.php","line":225,"function":"getInstalledAppsValues","class":"OC\\\\App\\\\AppManager","type":"->"},{"file":"/home/sturtz/public_html/lib/private/legacy/OC_Template.php","line":286,"function":"isEnabledForUser","class":"OC\\\\App\\\\AppManager","type":"->"},{"file":"/home/sturtz/public_html/index.php","line":45,"function":"printErrorPage","class":"OC_Template","type":"::"}],"File":"/home/sturtz/public_html/lib/private/DB/Connection.php","Line":67,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:32:33.923034 2020] [fcgid:warn] [pid 106053] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62734] mod_fcgid: stderr: {"reqId":"rlN4Pu9MitiiidWpPGXp","level":3,"time":"2020-09-09T23:32:33+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"PHP","method":"GET","url":"/","message":"fopen(/home/sturtz/public_html/data/nextcloud.log): failed to open stream: Permission denied at /home/sturtz/public_html/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:33:53.680373 2020] [fcgid:warn] [pid 106051] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62786] mod_fcgid: stderr: {"reqId":"3DwsuGXBOcTyo0RI7EHN","level":3,"time":"2020-09-09T23:33:53+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"PHP","method":"GET","url":"/","message":"touch(): Utime failed: Permission denied at /home/sturtz/public_html/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:33:53.680416 2020] [fcgid:warn] [pid 106051] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62786] mod_fcgid: stderr: {"reqId":"3DwsuGXBOcTyo0RI7EHN","level":3,"time":"2020-09-09T23:33:53+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"PHP","method":"GET","url":"/","message":"fopen(/home/sturtz/public_html/config/config.php): failed to open stream: Permission denied at /home/sturtz/public_html/lib/private/Config.php#243","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:33:53.680430 2020] [fcgid:warn] [pid 106051] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62786] mod_fcgid: stderr: {"reqId":"3DwsuGXBOcTyo0RI7EHN","level":3,"time":"2020-09-09T23:33:53+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"PHP","method":"GET","url":"/","message":"chmod(): Operation not permitted at /home/sturtz/public_html/lib/private/Config.php#246","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:33:53.680444 2020] [fcgid:warn] [pid 106051] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62786] mod_fcgid: stderr: {"reqId":"3DwsuGXBOcTyo0RI7EHN","level":3,"time":"2020-09-09T23:33:53+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"index","method":"GET","url":"/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/home/sturtz/public_html/lib/private/Config.php","line":134,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/home/sturtz/public_html/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/home/sturtz/public_html/lib/private/legacy/OC_Util.php","line":1146,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/home/sturtz/public_html/lib/base.php","line":650,"function":"initSession","class":"OC","type":"::"},{"file":"/home/sturtz/public_html/lib/base.php","line":1095,"function":"init","class":"OC","type":"::"},{"file":"/home/sturtz/public_html/index.php","line":35,"args":["/home/sturtz/public_html/lib/base.php"],"function":"require_once"}],"File":"/home/sturtz/public_html/lib/private/Config.php","Line":250,"Hint":"This can usually be fixed by giving the webserver write access to the config directory.","CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:33:53.680485 2020] [fcgid:warn] [pid 106051] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62786] mod_fcgid: stderr: {"reqId":"3DwsuGXBOcTyo0RI7EHN","level":3,"time":"2020-09-09T23:33:53+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"index","method":"GET","url":"/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: could not find driver","Code":0,"Trace":[{"file":"/home/sturtz/public_html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":889,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/home/sturtz/public_html/lib/private/DB/Connection.php","line":194,"function":"executeQuery","class":"Doctrine\\\\DBAL\\\\Connection","type":"->"},{"file":"/home/sturtz/public_html/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php","line":200,"function":"executeQuery","class":"OC\\\\DB\\\\Connection","type":"->"},{"file":"/home/sturtz/public_html/lib/private/DB/QueryBuilder/QueryBuilder.php","line":216,"function":"execute","class":"Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder","type":"->"},{"file":"/home/sturtz/public_html/lib/private/AppConfig.php","line":331,"function":"execute","class":"OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder","type":"->"},{"file":"/home/sturtz/public_html/lib/private/AppConfig.php","line":109,"function":"loadConfigValues","class":"OC\\\\AppConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/private/AppConfig.php","line":287,"function":"getApps","class":"OC\\\\AppConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/private/App/AppManager.php","line":136,"function":"getValues","class":"OC\\\\AppConfig","type":"->"},{"file":"/home/sturtz/public_html/lib/private/App/AppManager.php","line":225,"function":"getInstalledAppsValues","class":"OC\\\\App\\\\AppManager","type":"->"},{"file":"/home/sturtz/public_html/lib/private/legacy/OC_Template.php","line":286,"function":"isEnabledForUser","class":"OC\\\\App\\\\AppManager","type":"->"},{"file":"/home/sturtz/public_html/index.php","line":45,"function":"printErrorPage","class":"OC_Template","type":"::"}],"File":"/home/sturtz/public_html/lib/private/DB/Connection.php","Line":67,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}
[Wed Sep 09 18:33:53.680520 2020] [fcgid:warn] [pid 106051] [client 2604:99c0:8:2f96:24bd:f193:3e04:80c0:62786] mod_fcgid: stderr: {"reqId":"3DwsuGXBOcTyo0RI7EHN","level":3,"time":"2020-09-09T23:33:53+00:00","remoteAddr":"2604:99c0:8:2f96:24bd:f193:3e04:80c0","user":"--","app":"PHP","method":"GET","url":"/","message":"fopen(/home/sturtz/public_html/data/nextcloud.log): failed to open stream: Permission denied at /home/sturtz/public_html/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0","version":""}

I am using virtualmin on webmin, any help will be apreacted thank you!

Perhaps you can first set an IPv4 address so i can test it.

 host sturtz.ml
sturtz.ml has IPv6 address 2604:99c0:8:2f96:223:24ff:fe08:581f
sturtz.ml mail is handled by 0 mail.sturtz.ml.

With only IPv6 i think the server is useless.

Solve also this problem:

Post:

ls -l /home/sturtz/public_html/data/admin

I think on your server you are not allowed to break out of your “public_html”-folder with a symlink.

I run my own Server so how do I fix that?

And I use IPv6

You can normally set the IPv4 on your nameserver settings (where you have bought your domain)

Please post the output of the command.
ls -l /home/sturtz/public_html/data/admin

Perhaps you must only set the correct rights e.g.
chown -R www-data.www-data /data/admin

Ok, will do

drwxrwxr-x 2 www-data www-data 4096 Sep 10 07:11 files
and

did not work

I do not have a public IPv4, only a Public IPv6,
ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:23:24:08:58:1f brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.8/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s25
       valid_lft 86395sec preferred_lft 86395sec
    inet 192.168.1.20/24 brd 192.168.1.255 scope global secondary noprefixroute enp0s25
       valid_lft forever preferred_lft forever
    inet 192.168.1.21/24 brd 192.168.1.255 scope global secondary noprefixroute enp0s25
       valid_lft forever preferred_lft forever
    inet 192.168.1.22/24 brd 192.168.1.255 scope global secondary noprefixroute enp0s25
       valid_lft forever preferred_lft forever
    inet 192.168.1.23/24 brd 192.168.1.255 scope global secondary noprefixroute enp0s25
       valid_lft forever preferred_lft forever
    inet 192.168.1.24/24 brd 192.168.1.255 scope global secondary noprefixroute enp0s25
       valid_lft forever preferred_lft forever
    inet6 2604:99c0:8:2f96:223:24ff:fe08:581f/64 scope global noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fe80::223:24ff:fe08:581f/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

Sorry. Than i do not understand the error.
Sorry i can not access your website. Perhaps i have only IPv4.
Test the website from your mobile phone (mobile internet not wlan) please.

1 Like

I do not have a mobile phone.

I fixed the issue by running ‘chmod -R 0770 /data && chown -R cloud:cloud /data’

1 Like