Cannot write into "config" directory - after upgrade to NC 25.0.1

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version: 25.0.1
Operating system and version: Ubuntu 22.04.1 LTS (AWS EC2)
Apache or nginx version: Apache/2.4.52
PHP version: PHP 8.1.2

The issue you are facing:

Hello, I have recently updated NC to the latest version, initially I was getting HTTP 500 Errors after the update, I managed to fix this by running occ update which seems to have fixed the error, but now I am getting the “cannot write into config directory” error.

www-data owns the nextcloud directory and all file permissions seem correct, I have even tried giving the ncpath/config directory 755 permissions and this has also failed.

I have ran apt update %% upgrade on my server to see if this fixed any issues and still nothing.

I’ve looked through the help posts here, and a lot of people have had these issues but none of them seem to relate my setup as I am not running docker or php-fpm.

What am I missing here? Stupid me has a snapshot of my server but that is over a month old so I’d rather not have to roll back to that.

Any help would be appreciated

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

The output of your Nextcloud log in Admin > Logging: Inaccessible

Inaccessible

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

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxxx',
  'trusted_domains' =>
  array (
    0 => 'nc.mobilia.au',
  ),
  'datadirectory' => '/var/www/nc.mobilia.au/data',
  'dbtype' => 'mysql',
  'version' => '25.0.1.1',
  'overwrite.cli.url' => 'http://nc.mobilia.au',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'super secret password',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'app_install_overwrite' => true,
  0 =>
  array (
    0 => 'keeporsweep',
    1 => 'podcast',
    2 => 'files_external_onedrive',
  ),
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
  'default_phone_region' => 'AU',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'email@email',
  'mail_smtppassword' => 'xxx',
  'mail_from_address' => 'admin',
  'mail_domain' => ''xxx,
  'updater.secret' => 'xxx',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
  ),
);

The output of your Apache/nginx/system log in /var/log/____:

[Fri Nov 18 11:01:16.648952 2022] [access_compat:error] [pid 104613] [client :55343] AH01797: client denied by server configuration: /var/www/nc.mobilia.au/data/.ocdata
[Fri Nov 18 11:03:39.305684 2022] [php:error] [pid 104708] [client :55345] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:03:43.165024 2022] [php:error] [pid 104613] [client :55370] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:03:45.039349 2022] [php:error] [pid 104707] [client :55371] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:03:54.331445 2022] [php:error] [pid 104709] [client :55374] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:03:59.974906 2022] [php:error] [pid 104708] [client :55375] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:04:01.059033 2022] [php:error] [pid 104613] [client :55376] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:04:02.209527 2022] [php:error] [pid 104707] [client :55377] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:06:57.384428 2022] [php:error] [pid 104709] [client :55387] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:06:59.463565 2022] [php:error] [pid 104708] [client :51276] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:09:52.720637 2022] [php:error] [pid 779] [client :51411] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:16:26.104050 2022] [php:error] [pid 779] [client :51458] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:22:34.872464 2022] [php:error] [pid 778] [client :51536] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:23:48.584556 2022] [php:error] [pid 953] [client 162.158.2.150:12166] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:29:35.384819 2022] [php:error] [pid 1806] [client :59982] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:29:36.575306 2022] [php:error] [pid 1805] [client :59983] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:29:37.653158 2022] [php:error] [pid 1809] [client :59984] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:39:09.005017 2022] [php:error] [pid 1810] [client :60043] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:39:11.352958 2022] [php:error] [pid 1809] [client :60045] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:40:03.467861 2022] [php:error] [pid 1805] [client :60062] PHP Fatal error:  Declaration of OCA\\Talk\\Share\\RoomShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares): array must be compatible with OCP\\Share\\IShareProvider::getSharesInFolder($userId, OCP\\Files\\Folder $node, $reshares, $shallow = true) in /var/www/nc.mobilia.au/apps/spreed/lib/Share/RoomShareProvider.php on line 520
[Fri Nov 18 11:42:25.562109 2022] [php:error] [pid 1806] [client :60082] script '/var/www/nc.mobilia.au/opcachetest.php' not found or unable to stat

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

The directory and the files?

According to documentation permissions should be 750 for folders and 640 for files, all owned by user and group www-data.

chown -R www-data:www-data nextcloud
find nextcloud/ -type d -exec chmod 750 {} \;
find nextcloud/ -type f -exec chmod 640 {} \;
1 Like

It worked for me
Thanks a lot !!!

Hey @KarlF12, Thanks so much. I was so sure I checked these perms and ensured that www-data owned all the files, but for some reason it must have changed during the update?

Any how, these commands solved my issues, Thanks a lot!

1 Like