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.