Write permission for config directory

Nextcloud version (eg, 12.0.2): 17_0_1
Operating system and version (eg, Ubuntu 17.04): Fedora 30
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.1): 7.3.11

The issue you are facing: After a manual upgrade, I am receiving the error

Cannot write into "config" directory!

This can usually be fixed by giving the webserver write access to the config directory. See https://docs.nextcloud.com/server/17/go.php?to=admin-dir_permissions. Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See https://docs.nextcloud.com/server/17/go.php?to=admin-config

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

Steps to replicate it:

  1. Move current directory to new location
  2. Move new version to new Nextcloud directory
  3. Change ownership of new directory to apache:apache
  4. Change permissions of all directories to 770
  5. Change permissions of all files to 660
  6. Set Selinux type for directories config, updater, apps, 3rdparty/aws/aws-sdk-php/src/data/logs to httpd_sys_rw_content_t
  7. Set Selinux type for files .htaccess and .user.ini to httpd_sys_rw_content_t
  8. Restart httpd
  9. Perform update (sudo -u apache php occ upgrade)

The output of your Nextcloud log in Admin > Logging:

Error

Cannot write into "config" directory!

This can usually be fixed by giving the webserver write access to the config directory. See https://docs.nextcloud.com/server/17/go.php?to=admin-dir_permissions. Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See https://docs.nextcloud.com/server/17/go.php?to=admin-config

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

<?php $CONFIG = array ( 'instanceid' => 'ocirt432muru', 'passwordsalt' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'trusted_domains' => array ( 0 => 'ncldstor.mydomain.org', ), 'datadirectory' => '/mnt/extradasd/qcloud', 'dbtype' => 'mysql', 'version' => '17.0.1.1', 'overwrite.cli.url' => 'https://ncldstor.mydomain.org', 'dbname' => 'nextcloud', 'dbhost' => 'localhost:3306', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'oc_myadmin', 'dbpassword' => 'XXXXXXXXXXXXXXXXXXXXXXXXX', 'installed' => true, 'theme' => '', 'loglevel' => 2, 'maintenance' => false, 'memcache.local' => '\\OC\\Memcache\\APCu', ); The output of your Apache/nginx/system log in `/var/log/____`: nextcloud-error_log is empty Other info: drwxrwx---. 14 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 . drwxr-xr-x. 7 root root system_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:40 .. drwxrwx---. 33 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:34 3rdparty drwxrwx---. 46 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Nov 13 09:40 apps -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 12063 Nov 13 09:33 AUTHORS drwxrwx---. 2 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Nov 13 09:40 config -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 3805 Nov 13 09:33 console.php -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 34520 Nov 13 09:33 COPYING drwxrwx---. 23 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 core -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4993 Nov 13 09:33 cron.php -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 2627 Nov 13 09:40 .htaccess -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 156 Nov 13 09:33 index.html -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 3172 Nov 13 09:33 index.php drwxrwx---. 6 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 lib -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 283 Nov 13 09:33 occ drwxrwx---. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 ocm-provider drwxrwx---. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 ocs drwxrwx---. 2 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 ocs-provider -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 2951 Nov 13 09:33 public.php -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 5139 Nov 13 09:33 remote.php drwxrwx---. 4 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 resources -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 26 Nov 13 09:33 robots.txt drwxrwx---. 13 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 settings -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 2287 Nov 13 09:33 status.php drwxrwx---. 3 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 4096 Nov 13 09:33 themes drwxrwx---. 2 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Nov 13 09:33 updater -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 101 Nov 13 09:33 .user.ini -rw-rw----. 1 apache apache unconfined_u:object_r:httpd_sys_content_t:s0 362 Nov 13 09:33 version.php

Sorry, but no-one can read what you’ve pasted here. Please insert separate lines with “```” before and after a block of lines and make sure that the information is readable.

Quotes have been added around each line

Although the file permissions appear to be valid and despite the documentation discouraging it, I have added ‘‘config_is_read_only’ => true,’ to the config.php and that has allowed me to again have access to my nextcloud.