Your data directory is not writable after NC Upgrade to 21.0.3.1

Nextcloud version (eg, 20.0.5): 21.0.3.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 19.10
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.41 (Ubuntu)
PHP version (eg, 7.4): PHP 7.3.16-1+ubuntu19.10.1+deb.sury.org+1

The issue you are facing:

After upgrading to NC 21.0.3.1 and try a Ubuntu release upgrade i run into several problems. As my NC is running on a Proxmox CT i restored the latest backup taken after NC upgrade. It looks that yesterday NC was working fine after restoring the backup but this morning i got this screen:

grafik

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

Steps to replicate it:

  1. restore NC Backup

Permissions:

root@Nextcloud:/var/www/nextcloud# ls -la /mnt
total 12
drwxr-xr-x  3 root root 4096 Aug  4 09:47 .
drwxr-xr-x 22 root root 4096 Aug  4 10:04 ..
drwxr-xr-x 16 root root 4096 Aug  4 09:54 data
root@Nextcloud:/var/www/nextcloud# ls -la /mnt/data/
total 15132
drwxr-xr-x 16 root     root         4096 Aug  4 09:54 .
drwxr-xr-x  3 root     root         4096 Aug  4 09:47 ..
-rwxr-xr-x  1 www-data www-data      542 Aug  2 17:29 .htaccess
-rwxr-xr-x  1 www-data www-data        0 Aug  2 17:29 .ocdata
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Abfall
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Abfallkalender
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Familie
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Familienkalender
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Geburtstag
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Geburtstage
drwxr-xr-x  5 www-data www-data     4096 May 29 19:21 Lxxx
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Mxxx
drwxr-xr-x  9 www-data www-data     4096 Apr  3  2020 Mirko
drwxr-xr-x  4 www-data www-data     4096 Apr  2  2020 Sxxx
drwxr-xr-x 14 www-data www-data     4096 Jul  6 16:39 appdata_oc1pfu1ifcq8
drwxr-xr-x  2 www-data www-data     4096 Jul  6 16:39 files_external
-rwxr-xr-x  1 www-data www-data        0 Aug  2 17:29 index.html
drwx------  2 nobody   nogroup     16384 Aug  4 09:47 lost+found
-rw-r-----  1 www-data www-data 15282902 Aug  4 10:51 nextcloud.log
drwxr-xr-x  4 www-data www-data     4096 Aug  2 17:31 updater-oc1pfu1ifcq8
-rw-r--r--  1 www-data www-data   119457 Aug  2 17:29 updater.log
root@Nextcloud:/var/www/nextcloud#

The output of your Nextcloud log in Admin > Logging: log taken from /var/www/nextcloud/nextcloud.log

{"reqId":"8G6fU9cgTprm26SREjYX","level":3,"time":"2021-08-04T07:54:53+00:00","remoteAddr":"192.168.178.82","user":"--","app":"PHP","method":"PROPFIND","url":"/remote.php/dav/principals/users/Mirko/","message":{"Exception":"Error","Message":"fopen(/mnt/data/data_dir_writability_test_610a47cddffa0.tmp): failed to open stream: Permission denied at /var/www/nextcloud/lib/private/legacy/OC_Util.php#809","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"fopen(/mnt/data/data_dir_writability_test_610a47cddffa0.tmp): failed to open stream: Permission denied","/var/www/nextcloud/lib/private/legacy/OC_Util.php",809,{"config":{"__class__":"OC\\SystemConfig"},"l":{"__class__":"OC\\L10N\\LazyL10N"},"errors":[],"CONFIG_DATADIRECTORY":"/mnt/data","webServerRestart":false,"0":"And 4 more entries, set log level to debug to see all entries"}]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Util.php","line":809,"function":"fopen","args":["/mnt/data/data_dir_writability_test_610a47cddffa0.tmp","w"]},{"file":"/var/www/nextcloud/lib/base.php","line":650,"function":"checkServer","class":"OC_Util","type":"::","args":[{"__class__":"OC\\SystemConfig"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1076,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/nextcloud/remote.php","line":115,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"iOS/14.6 (18F72) dataaccessd/1.0","version":"21.0.3.1"}
{"reqId":"lBkgVlTVZ6z5gqxGwnaM","level":3,"time":"2021-08-04T07:57:28+00:00","remoteAddr":"192.168.178.30","user":"--","app":"PHP","method":"GET","url":"/index.php/settings/admin/logging","message":{"Exception":"Error","Message":"fopen(/mnt/data/data_dir_writability_test_610a486858bf4.tmp): failed to open stream: Permission denied at /var/www/nextcloud/lib/private/legacy/OC_Util.php#809","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"fopen(/mnt/data/data_dir_writability_test_610a486858bf4.tmp): failed to open stream: Permission denied","/var/www/nextcloud/lib/private/legacy/OC_Util.php",809,{"config":{"__class__":"OC\\SystemConfig"},"l":{"__class__":"OC\\L10N\\LazyL10N"},"errors":[],"CONFIG_DATADIRECTORY":"/mnt/data","webServerRestart":false,"0":"And 4 more entries, set log level to debug to see all entries"}]},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Util.php","line":809,"function":"fopen","args":["/mnt/data/data_dir_writability_test_610a486858bf4.tmp","w"]},{"file":"/var/www/nextcloud/lib/base.php","line":650,"function":"checkServer","class":"OC_Util","type":"::","args":[{"__class__":"OC\\SystemConfig"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1076,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/nextcloud/index.php","line":35,"args":["/var/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"}

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

root@Nextcloud:/var/www/nextcloud# cat config/config.php
<?php
$CONFIG = array (
  'instanceid' => 'oc1pfu1ifcq8',
  'passwordsalt' => '/jxS5xxxxxD8Cm/jsl',
  'secret' => 'AtgB/4riPSvTccccccccmeM49TR9',
  'trusted_domains' =>
  array (
    0 => '192.168.178.37',
  ),
  'datadirectory' => '/mnt/data',
  'dbtype' => 'mysql',
  'version' => '21.0.3.1',
  'overwrite.cli.url' => 'https://192.168.178.37',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'omxxxxxr',
  'installed' => true,
  'default_phone_region' => 'DE',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'mxxxxx0',
  'mail_domain' => 'gmx.de',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.gmx.net',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'mxxxxx1@gmx.de',
  'mail_smtppassword' => 'Sxxxxxx2',
  'updater.release.channel' => 'stable',
  'updater.secret' => '$2y$10$zBDu5vtkaIETjWCntm4XeeJrZGUULMsqt7oXsyp9taxoga3opz6pC',
);
root@Nextcloud:/var/www/nextcloud#

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

Syslog:

Aug  4 09:54:51 Nextcloud rsyslogd:  [origin software="rsyslogd" swVersion="8.1901.0" x-pid="98" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
Aug  4 09:54:52 Nextcloud systemd[1]: logrotate.service: Succeeded.
Aug  4 09:54:52 Nextcloud systemd[1]: Started Rotate log files.
Aug  4 09:54:53 Nextcloud /etc/mysql/debian-start[476]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Aug  4 09:54:53 Nextcloud /etc/mysql/debian-start[476]: Looking for 'mysql' as: /usr/bin/mysql
Aug  4 09:54:53 Nextcloud /etc/mysql/debian-start[476]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Aug  4 09:54:53 Nextcloud /etc/mysql/debian-start[476]: This installation of MySQL is already upgraded to 10.3.22-MariaDB, use --force if you still need to run mysql_upgrade
Aug  4 09:54:53 Nextcloud /etc/mysql/debian-start[496]: Checking for insecure root accounts.
Aug  4 09:54:53 Nextcloud /etc/mysql/debian-start[500]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
Aug  4 09:54:53 Nextcloud systemd[1]: man-db.service: Succeeded.
Aug  4 09:54:53 Nextcloud systemd[1]: Started Daily man-db regeneration.
Aug  4 09:54:53 Nextcloud systemd[1]: Startup finished in 18.993s.
Aug  4 09:55:01 Nextcloud CRON[533]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 09:57:48 Nextcloud systemd[1]: Created slice User Slice of UID 0.
Aug  4 09:57:48 Nextcloud systemd[1]: Starting User Runtime Directory /run/user/0...
Aug  4 09:57:48 Nextcloud systemd[1]: Started User Runtime Directory /run/user/0.
Aug  4 09:57:48 Nextcloud systemd[1]: Starting User Manager for UID 0...
Aug  4 09:57:48 Nextcloud systemd[540]: Listening on GnuPG cryptographic agent and passphrase cache.
Aug  4 09:57:48 Nextcloud systemd[540]: Listening on debconf communication socket.
Aug  4 09:57:48 Nextcloud systemd[540]: Reached target Timers.
Aug  4 09:57:48 Nextcloud systemd[540]: Listening on GnuPG network certificate management daemon.
Aug  4 09:57:48 Nextcloud systemd[540]: Reached target Paths.
Aug  4 09:57:48 Nextcloud systemd[540]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Aug  4 09:57:48 Nextcloud systemd[540]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Aug  4 09:57:48 Nextcloud systemd[540]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Aug  4 09:57:48 Nextcloud systemd[540]: Reached target Sockets.
Aug  4 09:57:48 Nextcloud systemd[540]: Reached target Basic System.
Aug  4 09:57:48 Nextcloud systemd[540]: Reached target Main User Target.
Aug  4 09:57:48 Nextcloud systemd[540]: Startup finished in 28ms.
Aug  4 09:57:48 Nextcloud systemd[1]: Started User Manager for UID 0.
Aug  4 09:57:48 Nextcloud systemd[1]: Started Session 100016 of user root.
Aug  4 09:57:48 Nextcloud systemd[1]: Started Session 100018 of user root.
Aug  4 10:00:01 Nextcloud CRON[626]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:00:15 Nextcloud systemd[1]: Received SIGRTMIN+3.
Aug  4 10:00:15 Nextcloud systemd[1]: Stopped target Graphical Interface.
Aug  4 10:00:15 Nextcloud systemd[1]: Stopping Authorization Manager...
Aug  4 10:00:15 Nextcloud systemd[1]: Condition check resulted in Show Plymouth Halt Screen being skipped.
Aug  4 10:00:15 Nextcloud systemd[1]: Stopping Session 100016 of user root.
Aug  4 10:00:15 Nextcloud systemd[1]: Stopping Accounts Service...
Aug  4 10:00:15 Nextcloud systemd[1]: Stopping Session 100018 of user root.
Aug  4 10:00:15 Nextcloud systemd[1]: Stopped target Multi-User System.
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '4 4 1 7' to 'kernel/printk', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '1' to 'kernel/kptr_restrict', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '1' to 'fs/protected_hardlinks', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '1' to 'fs/protected_symlinks', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud keyboard-setup.sh[50]: Couldn't get a file descriptor referring to the console
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '176' to 'kernel/sysrq', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud keyboard-setup.sh[50]: Couldn't get a file descriptor referring to the console
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '1' to 'kernel/yama/ptrace_scope', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud keyboard-setup.sh[50]: /etc/console-setup/cached_setup_keyboard.sh: 9: cannot open /dev/tty3: No such file
Aug  4 10:04:50 Nextcloud keyboard-setup.sh[50]: /etc/console-setup/cached_setup_keyboard.sh: 10: cannot open /dev/tty4: No such file
Aug  4 10:04:50 Nextcloud systemd-sysctl[53]: Couldn't write '65536' to 'vm/mmap_min_addr', ignoring: Permission denied
Aug  4 10:04:50 Nextcloud rsyslogd: imuxsock: Acquired UNIX socket '/run/systemd/journal/syslog' (fd 3) from systemd.  [v8.1901.0]
Aug  4 10:04:50 Nextcloud rsyslogd: imklog: cannot open kernel log (/proc/kmsg): Permission denied.
Aug  4 10:04:50 Nextcloud systemd[1]: Started System Logging Service.
Aug  4 10:04:50 Nextcloud rsyslogd: activation of module imklog failed [v8.1901.0 try https://www.rsyslog.com/e/2145 ]
Aug  4 10:04:50 Nextcloud rsyslogd: rsyslogd's groupid changed to 103
Aug  4 10:04:50 Nextcloud rsyslogd: rsyslogd's userid changed to 101
Aug  4 10:04:50 Nextcloud rsyslogd:  [origin software="rsyslogd" swVersion="8.1901.0" x-pid="100" x-info="https://www.rsyslog.com"] start
Aug  4 10:04:50 Nextcloud dbus-daemon[101]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service' requested by ':1.4' (uid=0 pid=102 comm="/usr/lib/accountsservice/accounts-daemon " label="unconfined")
Aug  4 10:04:50 Nextcloud systemd-resolved[95]: Positive Trust Anchors:
Aug  4 10:04:50 Nextcloud systemd-resolved[95]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
Aug  4 10:04:50 Nextcloud systemd-resolved[95]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Aug  4 10:04:50 Nextcloud systemd-resolved[95]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa 168.192.in-addr.arpa d.f.ip6.arpa corp home internal intranet lan local private test
Aug  4 10:04:50 Nextcloud systemd-resolved[95]: Using system hostname 'Nextcloud'.
Aug  4 10:04:50 Nextcloud systemd[1]: Starting Authorization Manager...
Aug  4 10:04:50 Nextcloud systemd[1]: Started Network Name Resolution.
Aug  4 10:04:50 Nextcloud systemd[1]: Reached target Network.
Aug  4 10:04:50 Nextcloud systemd[1]: Starting OpenBSD Secure Shell server...
Aug  4 10:04:50 Nextcloud systemd[1]: Starting Advanced key-value store...
Aug  4 10:04:50 Nextcloud systemd[1]: Starting MariaDB 10.3.22 database server...
Aug  4 10:04:50 Nextcloud systemd[1]: Reached target Network is Online.
Aug  4 10:04:50 Nextcloud systemd[1]: Starting Permit User Sessions...
Aug  4 10:04:50 Nextcloud systemd[1]: Started Unattended Upgrades Shutdown.
Aug  4 10:04:50 Nextcloud systemd[1]: Condition check resulted in fast remote file copy program daemon being skipped.
Aug  4 10:04:50 Nextcloud systemd[1]: Reached target Host and Network Name Lookups.
Aug  4 10:04:50 Nextcloud systemd[1]: Starting The Apache HTTP Server...
Aug  4 10:04:50 Nextcloud systemd[1]: Starting Postfix Mail Transport Agent (instance -)...
Aug  4 10:04:50 Nextcloud systemd[1]: Started Permit User Sessions.
Aug  4 10:04:50 Nextcloud systemd[1]: Starting Hold until boot process finishes up...
Aug  4 10:04:50 Nextcloud systemd[1]: Starting Terminate Plymouth Boot Screen...
Aug  4 10:04:50 Nextcloud polkitd[112]: started daemon version 0.105 using authority implementation `local' version `0.105'
Aug  4 10:04:50 Nextcloud dbus-daemon[101]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Aug  4 10:04:50 Nextcloud systemd[1]: Started Authorization Manager.
Aug  4 10:04:50 Nextcloud systemd[1]: plymouth-quit-wait.service: Succeeded.
Aug  4 10:04:50 Nextcloud systemd[1]: Started Hold until boot process finishes up.
Aug  4 10:04:50 Nextcloud systemd[1]: Condition check resulted in Container Getty on /dev/tty0 being skipped.
Aug  4 10:04:50 Nextcloud systemd[1]: Started Container Getty on /dev/tty2.
Aug  4 10:04:50 Nextcloud accounts-daemon[102]: started daemon version 0.6.55
Aug  4 10:04:50 Nextcloud systemd[1]: Started Container Getty on /dev/tty1.
Aug  4 10:04:50 Nextcloud systemd[1]: Condition check resulted in Set console scheme being skipped.
Aug  4 10:04:50 Nextcloud systemd[1]: Started Console Getty.
Aug  4 10:04:50 Nextcloud systemd[1]: Reached target Login Prompts.
Aug  4 10:04:50 Nextcloud systemd[1]: Started Accounts Service.
Aug  4 10:04:50 Nextcloud systemd[1]: plymouth-quit.service: Succeeded.
Aug  4 10:04:50 Nextcloud systemd[1]: Started Terminate Plymouth Boot Screen.
Aug  4 10:04:50 Nextcloud systemd[1]: Started OpenBSD Secure Shell server.
Aug  4 10:04:51 Nextcloud systemd[1]: redis-server.service: Can't open PID file /run/redis/redis-server.pid (yet?) after start: No such file or directory
Aug  4 10:04:51 Nextcloud systemd[1]: Started Advanced key-value store.
Aug  4 10:04:51 Nextcloud networkd-dispatcher[104]: No valid path found for iwconfig
Aug  4 10:04:51 Nextcloud networkd-dispatcher[104]: No valid path found for iw
Aug  4 10:04:51 Nextcloud systemd[1]: Started Dispatcher daemon for systemd-networkd.
Aug  4 10:04:51 Nextcloud postfix[250]: Postfix is running with backwards-compatible default settings
Aug  4 10:04:51 Nextcloud postfix[250]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Aug  4 10:04:51 Nextcloud postfix[250]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Aug  4 10:04:51 Nextcloud systemd[1]: Started The Apache HTTP Server.
Aug  4 10:04:51 Nextcloud mysqld[210]: 2021-08-04 10:04:51 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0ubuntu0.19.10.1) starting as process 210 ...
Aug  4 10:04:51 Nextcloud postfix/postfix-script[316]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Aug  4 10:04:51 Nextcloud postfix/postfix-script[353]: starting the Postfix mail system
Aug  4 10:04:51 Nextcloud postfix/master[355]: daemon started -- version 3.4.5, configuration /etc/postfix
Aug  4 10:04:51 Nextcloud systemd[1]: Started Postfix Mail Transport Agent (instance -).
Aug  4 10:04:51 Nextcloud systemd[1]: Starting Postfix Mail Transport Agent...
Aug  4 10:04:51 Nextcloud systemd[1]: Started Postfix Mail Transport Agent.
Aug  4 10:04:51 Nextcloud systemd[1]: Started MariaDB 10.3.22 database server.
Aug  4 10:04:51 Nextcloud systemd[1]: Reached target Multi-User System.
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[396]: Upgrading MySQL tables if necessary.
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[399]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[399]: Looking for 'mysql' as: /usr/bin/mysql
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[399]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[399]: This installation of MySQL is already upgraded to 10.3.22-MariaDB, use --force if you still need to run mysql_upgrade
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[407]: Checking for insecure root accounts.
Aug  4 10:04:51 Nextcloud /etc/mysql/debian-start[411]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
Aug  4 10:04:52 Nextcloud systemd-networkd[66]: eth0: Gained IPv6LL
Aug  4 10:04:52 Nextcloud systemd-networkd[66]: eth0: Configured
Aug  4 10:04:52 Nextcloud systemd[1]: e2scrub_reap.service: Succeeded.
Aug  4 10:04:52 Nextcloud systemd[1]: Started Remove Stale Online ext4 Metadata Check Snapshots.
Aug  4 10:04:52 Nextcloud systemd[1]: Reached target Graphical Interface.
Aug  4 10:04:52 Nextcloud systemd[1]: Starting Update UTMP about System Runlevel Changes...
Aug  4 10:04:52 Nextcloud systemd[1]: systemd-update-utmp-runlevel.service: Succeeded.
Aug  4 10:04:52 Nextcloud systemd[1]: Started Update UTMP about System Runlevel Changes.
Aug  4 10:04:52 Nextcloud systemd[1]: Startup finished in 2.403s.
Aug  4 10:04:52 Nextcloud systemd[1]: dmesg.service: Succeeded.
Aug  4 10:05:01 Nextcloud CRON[451]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:08:30 Nextcloud systemd[1]: Created slice User Slice of UID 0.
Aug  4 10:08:30 Nextcloud systemd[1]: Starting User Runtime Directory /run/user/0...
Aug  4 10:08:30 Nextcloud systemd[1]: Started User Runtime Directory /run/user/0.
Aug  4 10:08:30 Nextcloud systemd[1]: Starting User Manager for UID 0...
Aug  4 10:08:30 Nextcloud systemd[463]: Reached target Timers.
Aug  4 10:08:30 Nextcloud systemd[463]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Aug  4 10:08:30 Nextcloud systemd[463]: Listening on debconf communication socket.
Aug  4 10:08:30 Nextcloud systemd[463]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Aug  4 10:08:30 Nextcloud systemd[463]: Listening on GnuPG network certificate management daemon.
Aug  4 10:08:30 Nextcloud systemd[463]: Reached target Paths.
Aug  4 10:08:30 Nextcloud systemd[463]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Aug  4 10:08:30 Nextcloud systemd[463]: Listening on GnuPG cryptographic agent and passphrase cache.
Aug  4 10:08:30 Nextcloud systemd[463]: Reached target Sockets.
Aug  4 10:08:30 Nextcloud systemd[463]: Reached target Basic System.
Aug  4 10:08:30 Nextcloud systemd[463]: Reached target Main User Target.
Aug  4 10:08:30 Nextcloud systemd[463]: Startup finished in 30ms.
Aug  4 10:08:30 Nextcloud systemd[1]: Started User Manager for UID 0.
Aug  4 10:08:30 Nextcloud systemd[1]: Started Session 2 of user root.
Aug  4 10:08:31 Nextcloud systemd[1]: Started Session 4 of user root.
Aug  4 10:09:01 Nextcloud CRON[542]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug  4 10:09:01 Nextcloud systemd[1]: Starting Clean php session files...
Aug  4 10:09:01 Nextcloud systemd[1]: phpsessionclean.service: Succeeded.
Aug  4 10:09:01 Nextcloud systemd[1]: Started Clean php session files.
Aug  4 10:10:01 Nextcloud CRON[598]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:15:01 Nextcloud CRON[602]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:20:01 Nextcloud CRON[606]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:20:01 Nextcloud systemd[1]: Starting Cleanup of Temporary Directories...
Aug  4 10:20:01 Nextcloud systemd[1]: systemd-tmpfiles-clean.service: Succeeded.
Aug  4 10:20:01 Nextcloud systemd[1]: Started Cleanup of Temporary Directories.
Aug  4 10:24:01 Nextcloud CRON[691]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug  4 10:25:01 Nextcloud CRON[697]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:28:31 Nextcloud systemd[1]: Starting Daily apt upgrade and clean activities...
Aug  4 10:28:32 Nextcloud systemd[1]: apt-daily-upgrade.service: Succeeded.
Aug  4 10:28:32 Nextcloud systemd[1]: Started Daily apt upgrade and clean activities.
Aug  4 10:30:01 Nextcloud CRON[767]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:35:01 Nextcloud CRON[773]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:39:01 Nextcloud CRON[776]: (root) CMD (  [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Aug  4 10:39:01 Nextcloud systemd[1]: Starting Clean php session files...
Aug  4 10:39:01 Nextcloud systemd[1]: phpsessionclean.service: Succeeded.
Aug  4 10:39:01 Nextcloud systemd[1]: Started Clean php session files.
Aug  4 10:40:01 Nextcloud CRON[832]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug  4 10:45:01 Nextcloud CRON[836]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)

Apache logs:
error log:

[Wed Aug 04 09:54:42.377398 2021] [ssl:warn] [pid 172] AH01906: nc1.local:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Aug 04 09:54:48.355747 2021] [ssl:warn] [pid 389] AH01906: nc1.local:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Aug 04 09:54:48.361385 2021] [mpm_prefork:notice] [pid 389] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1c configured -- resuming normal operations
[Wed Aug 04 09:54:48.361412 2021] [core:notice] [pid 389] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 04 10:00:15.288904 2021] [mpm_prefork:notice] [pid 389] AH00169: caught SIGTERM, shutting down
[Wed Aug 04 10:04:51.160142 2021] [ssl:warn] [pid 152] AH01906: nc1.local:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Aug 04 10:04:51.398154 2021] [ssl:warn] [pid 261] AH01906: nc1.local:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Wed Aug 04 10:04:51.400979 2021] [mpm_prefork:notice] [pid 261] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1c configured -- resuming normal operations
[Wed Aug 04 10:04:51.401007 2021] [core:notice] [pid 261] AH00094: Command line: '/usr/sbin/apache2'

I already tried a full Proxmox Server restart, CT restart. delete and recreate the CT using the Backup.

Additional information can be provided on request as i already used to many signs.

I appreciate any kind of help.

Kind regards

Mirko

Some more information about config at Proxmox:

root@Nextcloud:/var/www/nextcloud# mount
/dev/mapper/pve-vm--103--disk--1 on / type ext4 (rw,relatime,stripe=16)
/dev/mapper/pve-vm--103--disk--2 on /mnt/data type ext4 (rw,relatime,stripe=16)
none on /dev type tmpfs (rw,relatime,size=492k,mode=755,uid=100000,gid=100000)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
proc on /proc/sys/net type proc (rw,nosuid,nodev,noexec,relatime)
proc on /proc/sys type proc (ro,nosuid,nodev,noexec,relatime)
proc on /proc/sysrq-trigger type proc (ro,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)
sysfs on /sys/devices/virtual/net type sysfs (rw,relatime)
sysfs on /sys/devices/virtual/net type sysfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
lxcfs on /proc/cpuinfo type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /proc/diskstats type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /proc/loadavg type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /proc/meminfo type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /proc/stat type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /proc/swaps type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /proc/uptime type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
lxcfs on /sys/devices/system/cpu/online type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
udev on /dev/full type devtmpfs (rw,nosuid,relatime,size=16354028k,nr_inodes=4088507,mode=755)
udev on /dev/null type devtmpfs (rw,nosuid,relatime,size=16354028k,nr_inodes=4088507,mode=755)
udev on /dev/random type devtmpfs (rw,nosuid,relatime,size=16354028k,nr_inodes=4088507,mode=755)
udev on /dev/tty type devtmpfs (rw,nosuid,relatime,size=16354028k,nr_inodes=4088507,mode=755)
udev on /dev/urandom type devtmpfs (rw,nosuid,relatime,size=16354028k,nr_inodes=4088507,mode=755)
udev on /dev/zero type devtmpfs (rw,nosuid,relatime,size=16354028k,nr_inodes=4088507,mode=755)
devpts on /dev/console type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
none on /proc/sys/kernel/random/boot_id type tmpfs (ro,nosuid,nodev,noexec,relatime,size=492k,mode=755,uid=100000,gid=100000)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=100005,mode=620,ptmxmode=666,max=1024)
devpts on /dev/ptmx type devpts (rw,nosuid,noexec,relatime,gid=100005,mode=620,ptmxmode=666,max=1024)
devpts on /dev/tty1 type devpts (rw,nosuid,noexec,relatime,gid=100005,mode=620,ptmxmode=666,max=1024)
devpts on /dev/tty2 type devpts (rw,nosuid,noexec,relatime,gid=100005,mode=620,ptmxmode=666,max=1024)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,uid=100000,gid=100000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=3275764k,mode=755,uid=100000,gid=100000)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,uid=100000,gid=100000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755,uid=100000,gid=100000)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=3275760k,mode=700,uid=100000,gid=100000)

grafik

Doesn’t this mean that www-data can’t create or write to the files and folder in the mainlevel of /mnt/data, just in the subfolders? Try sudo -u www-data touch /mnt/data/test.txt

Change the user and group to www-data:www-data:

sudo chown www-data:www-data /mnt/data
(Ubuntu way)
or

chown www-data:www-data /mnt/data
(user root, Debian way)

This did the trick.

Thanks for quick reply and help!!!

Wondering how this could happen or when it has been changed.

Now only the Cron Job issue is left:

Letzte Cron-Job-Ausführung: Gestern. Möglicherweise liegt ein Fehler vor. Überprüfe Einstellungen für Hintergrundausführungen

Please post your cron configuration.

Here we go:

root@Nextcloud:/var/www/nextcloud# crontab -u www-data -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
*/5  *  *  *  * php -f /var/www/nextcloud/cron.php

Anything else needed?

execute:

sudo -u www-data php -f /var/www/nextcloud/cron.php

This seems to work.

Next step will be Ubuntu release upgrade.

Release upgrade finished. Now i have these messages:

    Eine Hintergrundaufgabe, die nach vom Benutzer importierten SSL-Zertifikaten sucht, läuft noch. Bitte später erneut versuchen.

    Dieser Installation fehlen einige empfohlene PHP-Module. Für bessere Leistung und bessere Kompatibilität wird dringend empfohlen, diese zu installieren.
        bcmath

For the SSL info i have no clue what needs to be checked.

For bcmath i tried to install:

root@Nextcloud:~# apt install php-bcmath
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-bcmath is already the newest version (2:7.4+75).
The following packages were automatically installed and are no longer required:
  libcupsfilters1 libcupsimage2 libperl5.28 perl-modules-5.28
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@Nextcloud:~# apachectl -t -D DUMP_MODULES
Loaded Modules:
 core_module (static)
 so_module (static)
 watchdog_module (static)
 http_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 unixd_module (static)
 access_compat_module (shared)
 alias_module (shared)
 auth_basic_module (shared)
 authn_core_module (shared)
 authn_file_module (shared)
 authz_core_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 filter_module (shared)
 headers_module (shared)
 mime_module (shared)
 mpm_prefork_module (shared)
 negotiation_module (shared)
 php7_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 socache_shmcb_module (shared)
 ssl_module (shared)
 status_module (shared)

Before release upgrade php7.3 was running:

root@Nextcloud:~# ls -la /etc/php/7.3/
total 20
drwxr-xr-x 5 root root 4096 Mar 21  2020 .
drwxr-xr-x 8 root root 4096 Mar 21  2020 ..
drwxr-xr-x 3 root root 4096 Mar 21  2020 apache2
drwxr-xr-x 3 root root 4096 Mar 21  2020 cli
drwxr-xr-x 2 root root 4096 Aug  4 15:04 mods-available
root@Nextcloud:~#

After release upgrade php7.4 should be running:

root@Nextcloud:~# php -v
PHP 7.4.3 (cli) (built: Jul  5 2021 15:13:35) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies
root@Nextcloud:~# ls -la /etc/php/7.4/
total 20
drwxr-xr-x 5 root root 4096 Aug  4 15:02 .
drwxr-xr-x 8 root root 4096 Mar 21  2020 ..
drwxr-xr-x 3 root root 4096 Aug  4 15:03 cli
drwxr-xr-x 2 root root 4096 Aug  4 15:06 mods-available
drwxr-xr-x 3 root root 4096 Aug  4 15:04 phpdbg
root@Nextcloud:~#

Is it correct that i do not have a “apache2” folder at php7.4 ?

After one hour the message appears again.

PHP7.4 was installed but not configured/active.

I activated and configured, made some other installation for php gmp and php gd.

Used this link SSL Hinweis to overcome the SSL warning and now everything looks ok.

grafik