Your data directory is readable by other users. Please change the permissions to 0770 so that the directory cannot be listed by other users

i have tried everything i can think of to get rid of this error. i have even reinstalled nextcloud. i can get rid of the message by changing my config but i know this is not correct way to do this. so i would like some help with doing this the correct way.

I’m running this on my server dell pweredge R720xd with over 100Tb of storage
the OS
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

my fstab for the raid drive is
/dev/disk/by-uuid/2018BA0A2C80DD9C /mnt/2018BA0A2C80DD9C auto quiet,defaults,permissions,locale=en_US.utf8 0 0

so if anyone can help me i would appreciate it.

if you need any more information let me know

Trying checking and adjusting the permissions of the drive ls -la on it’s location in the filesystem at /mnt/2018BA0A2C80DD9C

You can search the internet for the error – click to see a number of results

or the forum

https://help.nextcloud.com/search?q=%20Your%20data%20directory%20is%20readable%20by%20other%20users.%20Please%20change%20the%20permissions%20to%200770%20so%20that%20the%20directory%20cannot%20be%20listed%20by%20other%20users

or the admin documentation

https://docs.nextcloud.com/server/latest/admin_manual/search.html?q=data+directory+readable&check_keywords=yes&area=default

or here is the error on Nextcloud server github

1 Like

For me the issue sounds more or less clear - for Nextcloud directories/files the owner should be your webserver user (www-data is common) and have 750/640 permissions

kindly list what you tried and why this failed

re-installation of Nextcloud doesn’t change your storage…

Permissions are a classic point of confusion because we either master them or keep really clear reference notes. There is no way around it when attaching your storage and then giving your applications access. :heart:
Thankfully, it is not too difficult to understand.

These should help you understand the differences between ownership and access to the location so you can adjust as needed. :heart:

  1. Know what your current permissions and ownership are.
  2. Understand what permissions options are possible.
  3. Adjust to taste.

off-topic, but Permissions remind me a bit of this fantastic SNL Sketch about science:

Dr. Charles Claproth: Molecules are very small. There are as many molecules in a teaspoon of water, as there are teaspoons of water in the Atlantic Ocean.
Peter Graves: So molecules are very, very small, then.
Dr. Charles Claproth: Yes.
Peter Graves: But Doctor… you said they were very small.
Dr. Charles Claproth: Yes.
Peter Graves: So, you were wrong.
Dr. Charles Claproth: [ grimacing ] Yes.

1 Like

i have tried
chown -h www-data:www-data /mnt/2018BA0A2C80DD9C/DATA/data
chown -R www-data:www-data /mnt/2018BA0A2C80DD9C/DATA/data
chmod 0770 /mnt/2018BA0A2C80DD9C/DATA/data

your are not doing chmod recursively… 770 is wrong… try

chown -R www-data:www-data /mnt/2018BA0A2C80DD9C/DATA/data
find /mnt/2018BA0A2C80DD9C/DATA/data -type d -exec chmod 750 ‘{}’ ;
find /mnt/2018BA0A2C80DD9C/DATA/data -type f -exec chmod 640 ‘{}’ ;

there are tons of topic in this forum discussing permissions, please use search…

ok thank you for the help. I’m not sure if this is related or off topic. but i am also getting this after I updated nextcloud.
sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:139

https://help.nextcloud.com/search?q=sudo%20-u%20www-data%20php%20%2Fvar%2Fwww%2Fnextcloud%2Focc%20db%3Aadd-missing-indices

I’ve already looked at that and the things i found I have Tried
1) sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
i got
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:139
so i went in to the config.php and put true for maintenace
2) chown -R www-data:www-data /mnt/2018BA0A2C80DD9C/DATA/data
3) chmod -R 750 /mnt/2018BA0A2C80DD9C/DATA/data
this seems to have fixed the error on login
4) sudo -u www-data php /var/www/nextcloud/occ maintenance:repair
i still get this error
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:139
and i can’t move passed this
please help

I’m not sure if this helps or not

#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1519): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1041): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(261): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(281): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(411): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(176): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(367): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(983): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(713): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(184): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1105): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2082): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(122): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(454): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(162): OC\Server->OC{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(129): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(57): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1445): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(602): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1111): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once(‘…’)
#39 /var/www/nextcloud/occ(11): require_once(‘…’)

This problem is related to a database - looks like your DB server is inaccessible. Did you happen to place your DB files into the data directory?

I figured it out I was missing some extensions for php

sudo apt-get install php8.1-{bcmath,xml,fpm,mysql,zip,intl,ldap,gd,cli,bz2,curl,mbstring,pgsql,opcache,soap,cgi}
then I installed php-apcu

sudo apt-get -y install php-apcu
```  problems are all fixed now. thank you so much for all the tips