How to fix config permission?

Nextcloud version : 17
Operating system and version : Arch
nginx version: nginx/1.16.1
PHP version : 7.4 (commented out the lines in nextcloud/lib/versioncheck.php)

The issue you are facing:

Error message shows

Cannot write into “config” directory!
This can usually be fixed by giving the webserver write access to the config directory.

Is this the first time you’ve seen this error? Y

Steps to replicate it:

  1. Start webserver and php
  2. go to URL of nextcloud

The output of your config.php file in /usr/share/webapps/nextcloud /config.ini (make sure you remove any identifiable information!):

  1 <?php
  2 $CONFIG = array (
  3   'instanceid' => '',
  4   'passwordsalt' => '',
  5   'secret' => '',
  6   'trusted_domains' =>
  7   array (
  8     0 => '',
  9   ),
 10   'datadirectory' => '/media/hdd1',
 11   'dbtype' => 'mysql',
 12   'version' => '17.0.1.1',
 13   'overwrite.cli.url' => '',
 14   'dbname' => 'nextcloud',
 15   'dbhost' => 'localhost',
 16   'dbport' => '',
 17   'dbtableprefix' => 'oc_',
 18   'mysql.utf8mb4' => true,
 19   'dbuser' => 'nextclouduser',
 20   'dbpassword' => '',
 21   'installed' => true,
 22   'memcache.distributed' => '\\OC\\Memcache\\Redis',
 23   'memcache.local' => '\\OC\\Memcache\\Redis',
 24   'memcache.locking' => '\\OC\\Memcache\\Redis',
 25   'redis' =>
 26   array (
 27     'host' => 'localhost',
 28     'port' => 6379,
 29   ),
 30   'maintenance' => false,
 31   'theme' => '',
 32   'loglevel' => 2,
 33 );

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

  1 84.174.153.173 - user [02/Dec/2019:18:46:45 +0000] "GET /status.php HTTP/1.1" 503 3690 "-" "Mozilla/5.0 (Linux) mirall/2.6.1git (Nextcloud)"
  2 84.174.153.173 - user [02/Dec/2019:18:47:06 +0000] "GET /index.php/apps/bookmarks/public/rest/v2/folder/-1/hash HTTP/1.1" 503 3690 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ch    rome/78.0.3904.108 Safari/537.36"
  3 84.174.153.173 - user [02/Dec/2019:18:47:06 +0000] "GET /index.php/apps/bookmarks/public/rest/v2/bookmark?page=0&limit=300 HTTP/1.1" 503 3690 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, lik    e Gecko) Chrome/78.0.3904.108 Safari/537.36"
  4 84.174.153.173 - user [02/Dec/2019:18:47:17 +0000] "GET /status.php HTTP/1.1" 503 3690 "-" "Mozilla/5.0 (Linux) mirall/2.6.1git (Nextcloud)"
  5 84.174.153.173 - user [02/Dec/2019:18:47:49 +0000] "GET /status.php HTTP/1.1" 503 3690 "-" "Mozilla/5.0 (Linux) mirall/2.6.1git (Nextcloud)"
  6 84.174.153.173 - user [02/Dec/2019:18:48:21 +0000] "GET /status.php HTTP/1.1" 503 3690 "-" "Mozilla/5.0 (Linux) mirall/2.6.1git (Nextcloud)"

Changed permission but still appears

/usr/share/webapps/nextcloud
[alarm@alarmpi nextcloud]$ ls -al
total 160
drwxr-xr-x 14 http http  4096 Nov 26 14:24 .
drwxr-xr-x  3 root root  4096 Oct  5 20:45 ..
drwxr-xr-x 33 http http  4096 Nov 11 16:21 3rdparty
drwxr-x--- 50 http http  4096 Nov 11 16:25 apps
-rw-r--r--  1 http http 12063 Nov  8 13:58 AUTHORS
lrwxrwxrwx  1 http http    29 Nov  8 13:58 config -> /etc/webapps/nextcloud/config
-rw-r--r--  1 http http  3805 Nov  8 13:58 console.php
-rw-r--r--  1 http http 34520 Nov  8 13:58 COPYING
drwxr-xr-x 23 http http  4096 Nov 11 16:22 core
-rw-r--r--  1 http http  4993 Nov  8 13:58 cron.php
drwxr-xr-x  2 http http  4096 Oct  9 22:12 data
-rw-r--r--  1 http http  2537 Nov  8 13:58 .htaccess
-rw-r--r--  1 http http   156 Nov  8 13:58 index.html
-rw-r--r--  1 http http  3172 Nov  8 13:58 index.php
drwxr-xr-x  6 http http  4096 Dec  2 17:52 lib
-rwxr-xr-x  1 http http   283 Nov  8 13:58 occ
drwxr-xr-x  2 http http  4096 Nov 11 16:22 ocm-provider
drwxr-xr-x  2 http http  4096 Nov 11 16:22 ocs
drwxr-xr-x  2 http http  4096 Nov 11 16:22 ocs-provider
-rw-r--r--  1 http http  2951 Nov  8 13:58 public.php
-rw-r--r--  1 http http  5139 Nov  8 13:58 remote.php
drwxr-xr-x  4 http http  4096 Nov 11 16:22 resources
-rw-r--r--  1 http http    26 Nov  8 13:58 robots.txt
drwxr-xr-x 13 http http  4096 Nov 11 16:22 settings
-rw-r--r--  1 http http  2287 Nov  8 13:58 status.php
drwxr-xr-x  3 http http  4096 Nov 11 16:22 themes
drwxr-xr-x  2 http http  4096 Nov 11 16:22 updater
-rw-r--r--  1 http http   101 Nov  8 13:58 .user.ini
-rw-r--r--  1 http http   362 Nov  8 13:58 version.php

well why not doing just as they hint on…

plus: a more detailed screenshot of ls -la, eg would eventually help more.

added details. changed the permission already but it still apears

Do I have to adjust the php version to 7.4?

dunno. maybe - since php4 isnt yet officially supported by nc - it would be better to go down to 7.3?

I also went this route but then nextcloud is unable to start. I can add the logs later when I downgrade to php-7.3.11-1.

you are aware that
lrwxrwxrwx 1 http http 29 Nov 8 13:58 config -> /etc/webapps/nextcloud/config
is actually a symlink? you need to adjust its target’s perms (or replace the symlink with a copy of the target dir which seems a little cleaner to me but entails manual adjustments when updating).
GOOD LUCK!

Thanks. I saw that, too and I changed permission of the file in /etc/webapps/nextcloud/config. But that does not have any effect.

how about the superior dir(s) /etc/webapps/nextcloud/config/ ?
does your webserver-user have at leat rx for (all of) them?
GOOD LUCK!

Yes the directory has the proper permissions from what I can tell

[alarm@alarmpi webapps]$ pwd 
/etc/webapps
[alarm@alarmpi webapps]$ ls -alh
total 12K
drwxr-xr-x  3 root root 4.0K Oct  5 20:45 .
drwxr-xr-x 59 root root 4.0K Dec  2 21:39 ..
drwxr-xr-x  3 http http 4.0K Nov 11 16:21 nextcloud

When reinstall the php version pacman -U /var/cache/pacman/pkg/php-7.3.11-1-armv7h.pkg.tar.xz

I get this message when go to the nextcloud page

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

I have exactly the same issue with php 7.4 and when I downgrade, I have the same message too !

Did you find a solution @mangoTango ?

Hey @Clement, this topic is has effected a couple of people. I found that someone used downgrade on arch to get it to work. For my part mine is still broken. That is quite bad.

Ok thanks, keep me informed if you find something…

make sure to manually downgrade all relevant php-modules, too - not just the “main” prog.
GOOD LUCK!

For my part, I did that yesterday, downgrade all php modules and in my php logs I have this :

[16-Dec-2019 21:57:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'apcu.so' (tried: /usr/lib/php/modules/apcu.so (/usr/lib/php/modules/apcu.so: undefined symbol: php_error_docref), /usr/lib/php/modules/apcu.so.so (/usr/lib/php/modules/apcu.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[16-Dec-2019 21:57:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'apc.so' (tried: /usr/lib/php/modules/apc.so (/usr/lib/php/modules/apc.so: undefined symbol: apc_iterator_obj_init), /usr/lib/php/modules/apc.so.so (/usr/lib/php/modules/apc.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[16-Dec-2019 21:57:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'igbinary.so' (tried: /usr/lib/php/modules/igbinary.so (/usr/lib/php/modules/igbinary.so: undefined symbol: zend_get_properties_for), /usr/lib/php/modules/igbinary.so.so (/usr/lib/php/modules/igbinary.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
[16-Dec-2019 21:57:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick' (tried: /usr/lib/php/modules/imagick (/usr/lib/php/modules/imagick: cannot open shared object file: No such file or directory), /usr/lib/php/modules/imagick.so (/usr/lib/php/modules/imagick.so: undefined symbol: php_error_docref)) in Unknown on line 0
[16-Dec-2019 21:57:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'redis' (tried: /usr/lib/php/modules/redis (/usr/lib/php/modules/redis: cannot open shared object file: No such file or directory), /usr/lib/php/modules/redis.so (/usr/lib/php/modules/redis.so: undefined symbol: php_error_docref)) in Unknown on line 0

And they are in the folder /usr/lib/php/modules/ with the right 755 for the user root.

Thank you :slight_smile:

You have to make sure that the required library packages are installed on your server too, to get rid of the cannot open shared object file messages.

Hey, So I found a temporary solution, I have downgraded and I remove all the php extensions, seems to work, but it’s really slow and i have some issue (nothing really bad)

Hi,

Have you tried to edit php-pfm service as mentionned on archlinux bugtracker?

https://bugs.archlinux.org/task/64689#comment184108

I had almost the same problem and explained hw to resolve it here: Problem to acces data folder after upgrade to 18.0.0 RC1

So yesterday was the 18 update. but now I get the permissions error even tough the permission should be right

I tried the suggestion of @quiwy but still no progress

ls -al
total 160
drwxr-xr-x 13 http http  4096 Jan 19 10:10 .
drwxr-xr-x  3 root root  4096 Oct  5 20:45 ..
drwxr-xr-x 33 http http  4096 Jan 19 10:09 3rdparty
drwxr-x--- 51 http http  4096 Jan 19 10:10 apps
-rw-r--r--  1 http http 15752 Jan 18 20:51 AUTHORS
lrwxrwxrwx  1 http http    29 Jan 18 20:51 config -> /etc/webapps/nextcloud/config
-rw-r--r--  1 http http  3910 Jan 18 20:51 console.php
-rw-r--r--  1 http http 34520 Jan 18 20:51 COPYING
drwxr-xr-x 23 http http  4096 Jan 19 10:10 core
-rw-r--r--  1 http http  5048 Jan 18 20:51 cron.php
drwxr-xr-x  2 http http  4096 Oct  9 22:12 data
-rw-r--r--  1 http http  2537 Jan 18 20:51 .htaccess
-rw-r--r--  1 http http   156 Jan 18 20:51 index.html
-rw-r--r--  1 http http  2976 Jan 18 20:51 index.php
drwxr-xr-x  6 http http  4096 Jan 19 10:10 lib
-rwxr-xr-x  1 http http   283 Jan 18 20:51 occ
drwxr-xr-x  2 http http  4096 Jan 19 10:10 ocm-provider
drwxr-xr-x  2 http http  4096 Jan 19 10:10 ocs
drwxr-xr-x  2 http http  4096 Jan 19 10:10 ocs-provider
-rw-r--r--  1 http http  3056 Jan 18 20:51 public.php
-rw-r--r--  1 http http  5235 Jan 18 20:51 remote.php
drwxr-xr-x  4 http http  4096 Jan 19 10:10 resources
-rw-r--r--  1 http http    26 Jan 18 20:51 robots.txt
-rw-r--r--  1 http http  2381 Jan 18 20:51 status.php
drwxr-xr-x  3 http http  4096 Jan 19 10:10 themes
drwxr-xr-x  2 http http  4096 Jan 19 10:10 updater
-rw-r--r--  1 http http   101 Jan 18 20:51 .user.ini
-rw-r--r--  1 http http   363 Jan 18 20:51 version.php