Cannot write into "config" directory after an upragde

Nextcloud version 12.0.4:
Operating system and version Debian 9:
Apache or nginx version nginx 1.10.3:
PHP version (7.0.19-1):

Hello all,

I have updating nextcloud from 12.0.3 to 12.0.4 using this guide
https://docs.nextcloud.com/server/12/admin_manual/maintenance/manual_upgrade.html

First problems begin to appear when I ran the command:

sudo -u www-data php occ upgrade

I had a lot of message like saying that permission was denied, but after, I have tried to re-run it and:

Nextcloud is already latest version

So i guess it is ok.

But after stating the nginx service, i have an error message when browsing to my cloud:

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/12/go.php?to=admin-dir_permissions

Here are my permission for my nextcloud directory:

drwxr-x--- 15 www-data www-data 4.0K Dec 23 12:30 .
drwxr-xr-x  5 www-data www-data 4.0K Dec 23 12:46 ..
drwxr-x--- 33 www-data www-data 4.0K Dec  4 02:22 3rdparty
drwxr-x--- 36 www-data www-data 4.0K Dec  4 02:19 apps
-rw-r-----  1 www-data www-data 8.7K Dec  4 02:18 AUTHORS
drwxr-x---  2 www-data www-data 4.0K Dec 23 13:06 config
-rw-r-----  1 www-data www-data 4.0K Dec  4 02:18 console.php
drwxr-x--- 16 www-data www-data 4.0K Dec  4 02:22 core
-rw-r-----  1 www-data www-data 5.0K Dec  4 02:18 cron.php
drwxr-x---  2 www-data www-data 4.0K Dec 23 12:30 data
-rw-r-----  1 www-data www-data  41K Dec  4 02:18 db_structure.xml
-rw-r-----  1 www-data www-data 2.8K Dec 23 12:36 .htaccess
-rw-r-----  1 www-data www-data  179 Dec  4 02:18 index.html
-rw-r-----  1 www-data www-data 2.8K Dec  4 02:18 index.php
drwxr-x---  3 www-data www-data 4.0K Dec  4 02:18 l10n
drwxr-x---  6 www-data www-data 4.0K Dec  4 02:18 lib
-rw-r-----  1 www-data www-data  283 Dec  4 02:18 occ
drwxr-x---  2 www-data www-data 4.0K Dec  4 02:18 ocs
drwxr-x---  2 www-data www-data 4.0K Dec  4 02:18 ocs-provider
-rw-r-----  1 www-data www-data 3.1K Dec  4 02:18 public.php
-rw-r-----  1 www-data www-data 5.2K Dec  4 02:18 remote.php
drwxr-x---  4 www-data www-data 4.0K Dec  4 02:18 resources
-rw-r-----  1 www-data www-data   26 Dec  4 02:18 robots.txt
drwxr-x--- 14 www-data www-data 4.0K Dec  4 02:18 settings
-rw-r-----  1 www-data www-data 2.1K Dec  4 02:18 status.php
drwxr-x---  3 www-data www-data 4.0K Dec  4 02:18 themes
drwxr-x---  2 www-data www-data 4.0K Dec  4 02:19 updater
-rw-r-----  1 www-data www-data  163 Dec  4 02:18 .user.ini
-rw-r-----  1 www-data www-data  481 Dec  4 02:22 version.php

So i think it is ok :confused:

Have you got any idea to solve my problem ?

Thank you very much for your help :santa:

Hello,

Since you just upgraded to a new version, it may be a simple configuration mistake.
What message shows /var/log/nginx/error.log ?
Do you use selinux ?

Regards

Thank you for your answer,

Here is the error log:

2017/12/23 07:29:48 [crit] 11185#11185: *20685 SSL_do_handshake() failed (SSL: error:1417D18C:SSL routines:tls_process_client_hello:version too low) while SSL handshaking, client: PRIVACY, server: 0.0.0.0:443
2017/12/23 12:45:17 [error] 31729#31729: *85 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: PRIVACY, server: PRIVACY, request: "GET /status.php HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/nextcloud.sock:", host: "PRIVACY"
2017/12/23 12:45:17 [error] 31729#31729: *85 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: PRIVACY, server: PRIVACY, request: "GET /owncloud/status.php HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.0-fpm/nextcloud.sock:", host: "PRIVACY"
2017/12/23 13:03:58 [warn] 460#460: "ssl_stapling" ignored, host not found in OCSP responder "ocsp.int-x3.letsencrypt.org"
2017/12/23 13:03:58 [warn] 460#460: "ssl_stapling" ignored, host not found in OCSP responder "ocsp.int-x3.letsencrypt.org"
2017/12/23 13:03:58 [warn] 529#529: "ssl_stapling" ignored, host not found in OCSP responder "ocsp.int-x3.letsencrypt.org"
2017/12/23 13:03:58 [warn] 529#529: "ssl_stapling" ignored, host not found in OCSP responder "ocsp.int-x3.letsencrypt.org"
2017/12/23 13:06:10 [error] 536#536: *7 FastCGI sent in stderr: "PHP message: {"reqId":"1ZsdpPWTMGGyJ2E8pVt6","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"1ZsdpPWTMGGyJ2E8pVt6","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"1ZsdpPWTMGGyJ2E8pVt6","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"1ZsdpPWTMGGyJ2E8pVt6","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"1ZsdpPWTMGGyJ2E8pVt6","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \/v
2017/12/23 13:06:10 [error] 536#536: *7 FastCGI sent in stderr: "PHP message: {"reqId":"wRqGX519SQ75xYIoQnHO","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"wRqGX519SQ75xYIoQnHO","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"wRqGX519SQ75xYIoQnHO","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"wRqGX519SQ75xYIoQnHO","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"wRqGX519SQ75xYIoQnHO","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"fopen(\/var\/www\/nextcloud\/data\/nextclou
2017/12/23 13:06:10 [error] 536#536: *7 FastCGI sent in stderr: "PHP message: {"reqId":"U8ZW0QqD3CFxoSHJ4ZBA","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"U8ZW0QqD3CFxoSHJ4ZBA","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"U8ZW0QqD3CFxoSHJ4ZBA","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"U8ZW0QqD3CFxoSHJ4ZBA","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"U8ZW0QqD3CFxoSHJ4ZBA","level":3,"time":"2017-12-23T18:06:10+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/favicon.ico","message":"fopen(\/var\/www\/nextcloud\/data\/nextclou
2017/12/23 13:06:14 [error] 536#536: *7 FastCGI sent in stderr: "PHP message: {"reqId":"RggcqkhqEvx9rvsF9Itq","level":3,"time":"2017-12-23T18:06:14+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"RggcqkhqEvx9rvsF9Itq","level":3,"time":"2017-12-23T18:06:14+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"RggcqkhqEvx9rvsF9Itq","level":3,"time":"2017-12-23T18:06:14+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"RggcqkhqEvx9rvsF9Itq","level":3,"time":"2017-12-23T18:06:14+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"RggcqkhqEvx9rvsF9Itq","level":3,"time":"2017-12-23T18:06:14+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \/v
2017/12/23 13:06:22 [error] 1095#1095: *1 FastCGI sent in stderr: "PHP message: {"reqId":"JA9p7eKUSoPZJuRXPTCg","level":3,"time":"2017-12-23T18:06:22+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"JA9p7eKUSoPZJuRXPTCg","level":3,"time":"2017-12-23T18:06:22+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"JA9p7eKUSoPZJuRXPTCg","level":3,"time":"2017-12-23T18:06:22+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"JA9p7eKUSoPZJuRXPTCg","level":3,"time":"2017-12-23T18:06:22+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"JA9p7eKUSoPZJuRXPTCg","level":3,"time":"2017-12-23T18:06:22+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \
2017/12/23 13:06:23 [error] 1095#1095: *1 FastCGI sent in stderr: "PHP message: {"reqId":"h48DUkyUwSYBYEVlOJd4","level":3,"time":"2017-12-23T18:06:23+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"h48DUkyUwSYBYEVlOJd4","level":3,"time":"2017-12-23T18:06:23+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"h48DUkyUwSYBYEVlOJd4","level":3,"time":"2017-12-23T18:06:23+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"h48DUkyUwSYBYEVlOJd4","level":3,"time":"2017-12-23T18:06:23+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"h48DUkyUwSYBYEVlOJd4","level":3,"time":"2017-12-23T18:06:23+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \
2017/12/23 13:06:24 [error] 1095#1095: *1 FastCGI sent in stderr: "PHP message: {"reqId":"GybDjRU1j0gjiOKqEeSN","level":3,"time":"2017-12-23T18:06:24+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Unable to create file \/var\/www\/nextcloud\/config\/config.php because Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"GybDjRU1j0gjiOKqEeSN","level":3,"time":"2017-12-23T18:06:24+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"GybDjRU1j0gjiOKqEeSN","level":3,"time":"2017-12-23T18:06:24+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"GybDjRU1j0gjiOKqEeSN","level":3,"time":"2017-12-23T18:06:24+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"GybDjRU1j0gjiOKqEeSN","level":3,"time":"2017-12-23T18:06:24+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \
2017/12/23 13:06:31 [error] 1095#1095: *1 FastCGI sent in stderr: "PHP message: {"reqId":"8UnJmtqQYZkWALE5b0yh","level":3,"time":"2017-12-23T18:06:31+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Utime failed: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"8UnJmtqQYZkWALE5b0yh","level":3,"time":"2017-12-23T18:06:31+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"8UnJmtqQYZkWALE5b0yh","level":3,"time":"2017-12-23T18:06:31+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): Operation not permitted at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"8UnJmtqQYZkWALE5b0yh","level":3,"time":"2017-12-23T18:06:31+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"8UnJmtqQYZkWALE5b0yh","level":3,"time":"2017-12-23T18:06:31+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#132","userAgent":"
2017/12/23 13:06:32 [error] 1095#1095: *1 FastCGI sent in stderr: "PHP message: {"reqId":"esFOo0oXgZGtSm8Vswdg","level":3,"time":"2017-12-23T18:06:32+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"touch(): Utime failed: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"esFOo0oXgZGtSm8Vswdg","level":3,"time":"2017-12-23T18:06:32+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"esFOo0oXgZGtSm8Vswdg","level":3,"time":"2017-12-23T18:06:32+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"chmod(): Operation not permitted at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"esFOo0oXgZGtSm8Vswdg","level":3,"time":"2017-12-23T18:06:32+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver at \/var\/www\/nextcloud\/lib\/private\/DB\/Connection.php#61","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\/20100101 Firefox\/57.0","version":""}
PHP message: {"reqId":"esFOo0oXgZGtSm8Vswdg","level":3,"time":"2017-12-23T18:06:32+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#132","userAgent":"
2017/12/23 13:06:37 [error] 1095#1095: *8 FastCGI sent in stderr: "PHP message: {"reqId":"ZZWudWaiGXRXp16VsoD7","level":3,"time":"2017-12-23T18:06:37+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"touch(): Utime failed: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#239","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.2 (Nextcloud)","version":""}
PHP message: {"reqId":"ZZWudWaiGXRXp16VsoD7","level":3,"time":"2017-12-23T18:06:37+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"fopen(\/var\/www\/nextcloud\/config\/config.php): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Config.php#240","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.2 (Nextcloud)","version":""}
PHP message: {"reqId":"ZZWudWaiGXRXp16VsoD7","level":3,"time":"2017-12-23T18:06:37+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"chmod(): Operation not permitted at \/var\/www\/nextcloud\/lib\/private\/Config.php#243","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.2 (Nextcloud)","version":""}
PHP message: {"reqId":"ZZWudWaiGXRXp16VsoD7","level":4,"time":"2017-12-23T18:06:37+00:00","remoteAddr":"PRIVACY","user":"--","app":"remote","method":"GET","url":"\/status.php","message":"Can't write into config directory!","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.2 (Nextcloud)","version":""}
PHP message: {"reqId":"ZZWudWaiGXRXp16VsoD7","level":3,"time":"2017-12-23T18:06:37+00:00","remoteAddr":"PRIVACY","user":"--","app":"PHP","method":"GET","url":"\/status.php","message":"fopen(\/var\/www\/nextcloud\/data\/nextcloud.log): failed to open stream: Permission denied at \/var\/www\/nextcloud\/lib\/private\/Log\/File.php#132","userAgent":"Mozilla\/5.0 (Linux) mirall\/2.3.2 (Nextcloud)","version":""}" while reading response header from upstream, client: PRIVACY, server: PRIVACY, request: "GET /status.php HTTP/1.1",

I don’t know what is SELinux so i don’t think I am using it.

Regards,

please send also a cat of this file if exists
cat /var/log/audit/audit.log | grep denied

cat nextcloud/config/config.php
remove sensitive data please

It does not exists :confused:

cat nextcloud/config/config.php
remove sensitive data please

Here we go

<?php
$CONFIG = array (
  'instanceid' => 'oc40mjdwys5t',
  'passwordsalt' => 'OOPS',
  'secret' => 'OOPS',
  'trusted_domains' => 
  array (
    0 => '192.168.10.17',
    1 => 'cloud.OOPS.org',
  ),
  'datadirectory' => '/media/raid/cloud',
  'overwrite.cli.url' => 'http://192.168.10.17',
  'dbtype' => 'mysql',
  'version' => '12.0.4.3',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'OOPS',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'maintenance' => false,
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'updater.secret' => 'OOPS',
  'loglevel' => 2,
);

This message could mean occ didn’t access file during update
/var/www/nextcloud/config/config.php because Permission denied at /var/www/nextcloud/lib/private/Config.php#239",“userAgent”:"Mozilla

and what about rights on config.php file ?

-rw-r----- 1 www-data www-data   906 Dec 23 14:50 config.php

Seems of too

Yes I had some error messages during the occ update. But at the end, it seems to have finised and says that nextcloud is update if I re-run it :confused:

Consider that upgrade hasn’t been done, so better is to download a fresh copy.
manual install is really simple
1 - then zip your current folder as a nextcloud.current.zip or rename it
wget https://download.nextcloud.com/server/releases/nextcloud-12.0.4.zip
unzip and set it as your current root

2 - copy
config.php in new folder and your data if not isolated
also file .user.ini and .htaccess if needed

set rights with this script :
Rights on folder better is 0750 files 0640

#!/bin/bash
ocpath=’/var/www/nextcloud’ <------- set your path and users
datapath=’/data/'
htuser='www-data’
htgroup='www-data’
rootuser=‘root’

#printf “Creating possible missing Directories\n”
#mkdir -p $ocpath/updater

printf “chmod Files and Directories\n”
#find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
#find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
#better using bellow command

find ${ocpath}/ -type d -exec chmod 0755 ‘{}’ ;
find ${ocpath}/ -type f -exec chmod 0644 ‘{}’ ;

find ${datapath}/ -type d -exec chmod 0755 ‘{}’ ;
find ${datapath}/ -type f -exec chmod 0644 ‘{}’ ;

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${datapath}
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
then
chmod 0644 ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${datapath}/.htaccess ]
then
chmod 0644 ${datapath}/.htaccess
chown ${rootuser}:${htgroup} ${datapath}/.htaccess
fi

Ok thanks for your help,
the sudo -u www-data php occ upgrade command went fine, all is green.
But I still have the same message when I try to access nextcloud form my browser :frowning:

EDIT I had error with your script

“chmodfind: missing argument to `-exec'
Try 'find --help' for more information.
find: missing argument to `-exec'
Try 'find --help' for more information.
find: missing argument to `-exec'
Try 'find --help' for more information.
find: missing argument to `-exec'
Try 'find --help' for more information.
chown Directories
chmod/chown .htaccess

Also, I have tried to set my old nextcloud which I have backuped, but still the same message

If nginx can’t read your file it mean that there is something around user owning process in memory : check who run nginx, php-fpm
You’re welcome

and also socket owner /var/lib/php7.0-fpm/nextcloud.sock

Yes, (i have edited my last post)
user “nextcloud” is running php-fm7.0 and user “www-data” is running nginx

and

srw-rw---- 1 nextcloud www-data 0 Dec 23 13:03 /var/lib/php7.0-fpm/nextcloud.sock

Something might me broken on my system because my old nextcloud (12.0.3) has the same message :confused: i am quite sceptical

Ok I have solve the problem with:

chmod g+w app/
chmod g+w config/config.php
chmod g+w config/

It’s weird that the official commands does not do this :confused: it should be with the

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

part

thanks to all !

happy for you :wink:
cheers

Be careful to use this typo : ‘{}’ Command in citation could partially work if any space used in file or directory name :

better is to use this
find nextcloud/ -type d -exec chmod 750 ‘{}’ ;
find nextcloud/ -type f -exec chmod 640 ‘{}’ ;

Ok i will note it for other updates !
Now i have other problem, I can’t create or add a file/folder when I am logged to my cloud with the android app, or the browser because I do not have the permission :confused:

first of all …
find nextcloud/ -type d -exec chmod 750 ‘{}’ ;
find nextcloud/ -type f -exec chmod 640 ‘{}’ ;