Sudden restarts (RPi4)

Nextcloud version (eg, 20.0.5): 20.0.6.1
Operating system and version (eg, Ubuntu 20.04): Linux nextcloudpi 5.10.5-v8+ #1392 SMP PREEMPT Sat Jan 9 18:56:30 GMT 2021 aarch64 GNU/Linux
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Debian)
PHP version (eg, 7.4): 7.4.1.4

Raspberry Pi4 which runs Nextcloud, Pi-Hole and Wireguard restarts itself without known reason. After the restart, nothing is accessile (not even SSH) so only option is to plug off the power cord and then back.

Temperatures are OK (below 40c under stress). Power adapter is 5V/3A. SSD is connected via USB. Another external drive (for backups) is self-powered. RPI4 is connected to the router via ethernet cable.

At first this happened after I had used raspiBackup for a while (restarted after backup at certain time). But I disabled raspiBackup few days ago, RPi ran fine and the pi restarted suddenly again today. I

In Nextcloud log there wasn’t anything logged near the restarts.

The output of config.php file in /path/to/nextcloud

<?php
$CONFIG = array (
  'passwordsalt' => ***PRIVATE***',
  'secret' => '***PRIVATE***',
  'trusted_domains' => 
  array ( ***PRIVATE***  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.6.1',
  'overwrite.cli.url' => '***PRIVATE***'
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '***PRIVATE***',
  'installed' => true,
  'instanceid' => 'ocrnfg5r4p1o',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '***PRIVATE***',
  ),
  'tempdirectory' => '/var/www/nextcloud/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'loglevel' => '2',
  'log_type' => 'file',
  'logfile' => 'nextcloud.log',
  'maintenance' => false,
  'theme' => '',
  'app_install_overwrite' => 
  array (
    0 => 'previewgenerator',
    1 => 'drawio',
  ),
  'htaccess.RewriteBase' => '/',
  'updater.release.channel' => 'stable',
  'data-fingerprint' => '***PRIVATE***',
);

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

Jan 29 07:44:23 nextcloudpi rngd[361]: stats: bits received from HRNG source: 1140064
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: bits sent to kernel pool: 1082560
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: entropy added to kernel pool: 1082560
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2 successes: 57
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2 failures: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Monobit: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Poker: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Runs: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Long run: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Continuous run: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: HRNG source speed: (min=377.956; avg=512.695; max=544.167)Kibits/s
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: FIPS tests speed: (min=10.924; avg=15.555; max=28.596)Mibits/s
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: Lowest ready-buffers level: 2
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: Entropy starvations: 0
Jan 29 07:44:23 nextcloudpi rngd[361]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us
Jan 29 07:45:01 nextcloudpi CRON[31170]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 07:50:01 nextcloudpi CRON[31202]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 07:58:01 nextcloudpi CRON[31268]: (daemon) CMD (test -x /usr/bin/debsecan && /usr/bin/debsecan --cron)
Jan 29 08:00:01 nextcloudpi CRON[31286]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 08:00:01 nextcloudpi CRON[31287]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 08:00:01 nextcloudpi CRON[31288]: (root) CMD (/usr/local/etc/duckdns/duck.sh >/dev/null 2>&1)
Jan 29 08:09:01 nextcloudpi CRON[31362]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jan 29 08:09:02 nextcloudpi systemd[1]: Starting Clean php session files...
Jan 29 08:09:03 nextcloudpi systemd[1]: phpsessionclean.service: Succeeded.
Jan 29 08:09:03 nextcloudpi systemd[1]: Started Clean php session files.
Jan 29 08:10:01 nextcloudpi CRON[31465]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 08:15:01 nextcloudpi CRON[31516]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 08:17:01 nextcloudpi CRON[31569]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jan 29 08:20:01 nextcloudpi CRON[31596]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 08:30:01 nextcloudpi CRON[31677]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 08:30:01 nextcloudpi CRON[31679]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 08:39:01 nextcloudpi CRON[31751]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jan 29 08:39:02 nextcloudpi systemd[1]: Starting Clean php session files...
Jan 29 08:39:03 nextcloudpi systemd[1]: phpsessionclean.service: Succeeded.
Jan 29 08:39:03 nextcloudpi systemd[1]: Started Clean php session files.
Jan 29 08:40:01 nextcloudpi CRON[31852]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 08:40:01 nextcloudpi CRON[31853]: (root) CMD (/usr/local/bin/ncp-notify-update && /usr/local/bin/ncp-notify-unattended-upgrade)
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: bits received from HRNG source: 1160064
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: bits sent to kernel pool: 1112800
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: entropy added to kernel pool: 1112800
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2 successes: 58
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2 failures: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Monobit: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Poker: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Runs: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Long run: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS 140-2(2001-10-10) Continuous run: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: HRNG source speed: (min=377.956; avg=512.582; max=544.167)Kibits/s
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: FIPS tests speed: (min=10.924; avg=15.579; max=28.596)Mibits/s
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: Lowest ready-buffers level: 2
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: Entropy starvations: 0
Jan 29 08:44:23 nextcloudpi rngd[361]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us
Jan 29 08:45:01 nextcloudpi CRON[31946]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 08:50:01 nextcloudpi CRON[31984]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 08:58:01 nextcloudpi CRON[32049]: (daemon) CMD (test -x /usr/bin/debsecan && /usr/bin/debsecan --cron)
Jan 29 09:00:01 nextcloudpi CRON[32067]: (root) CMD (/usr/local/etc/duckdns/duck.sh >/dev/null 2>&1)
Jan 29 09:00:01 nextcloudpi CRON[32069]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 09:00:01 nextcloudpi CRON[32068]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 09:09:01 nextcloudpi CRON[32149]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jan 29 09:09:03 nextcloudpi systemd[1]: Starting Clean php session files...
Jan 29 09:09:03 nextcloudpi systemd[1]: phpsessionclean.service: Succeeded.
Jan 29 09:09:03 nextcloudpi systemd[1]: Started Clean php session files.
Jan 29 09:10:01 nextcloudpi CRON[32247]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 09:15:01 nextcloudpi CRON[32296]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 09:17:01 nextcloudpi CRON[32314]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jan 29 09:20:01 nextcloudpi CRON[32342]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 09:30:01 nextcloudpi CRON[32418]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 09:30:01 nextcloudpi CRON[32419]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Jan 29 09:39:01 nextcloudpi CRON[32532]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
Jan 29 09:39:03 nextcloudpi systemd[1]: Starting Clean php session files...
Jan 29 09:39:04 nextcloudpi systemd[1]: phpsessionclean.service: Succeeded.
Jan 29 09:39:04 nextcloudpi systemd[1]: Started Clean php session files.
Jan 29 09:40:01 nextcloudpi CRON[32633]: (root) CMD (/usr/local/bin/ncp-notify-update && /usr/local/bin/ncp-notify-unattended-upgrade)
Jan 29 09:40:01 nextcloudpi CRON[32634]: (root) CMD ( PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local)
Jan 29 09:17:28 nextcloudpi fake-hwclock[122]: pe 29.1.2021 07.17.01 +0000
Jan 29 09:17:28 nextcloudpi kernel: [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]```

I did a clean install, using docker version this time. It has been working for like two weeks now.