Crashing during cron run on mornings

Linuxserver.io version: 30.0.1-ls347
Build-date: 2024-10-22T11:52:26+00:00
Apache or nginx version (eg, Apache 2.4.25): nginx/1.23.3
PHP version (eg, 8.3): Version: 8.3.12

The issue you are facing:
Came home and checked the server to find it shutdown. This is the second time in 3 days. First time was two days ago.

When I restarted the server in the docker container the startup log has this error:

[custom-init] No custom files found, skipping…
[ls.io-init] done.
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused in /app/www/public/lib/private/DB/Connection.php:233
Stack trace:

In the admin overview there was an error in red stating: Last background job execution ran 12 hours ago. Something seems wrong. Check the background job section.

In the Admin Log reader 12 hours ago there is this php error:

Using ${var} in strings is deprecated, use {$var} instead at /config/www/nextcloud/apps/news/lib/Controller/ExportController.php#64

I recently transfered my files over to nextcloud aster having the install running for a couple weeks. Within that time it has been stable. This started after I transfered my files and ran the memory index. Im new to nextcloud and linux so I may be totally wrong about that.

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

Steps to replicate it:

Wait for 6:10 AM

The output of your Nextcloud log in Admin > Logging:

https://pastebin.com/MF1Wc5J7

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

config.php                                                                         
<?php
$CONFIG = array (
  'datadirectory' => '/data',
  'instanceid' => 'ocxs4uogss45',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' => 
  array (
    0 => '192.168.104.11:444',
    1 => 'cloud.XXX.com',
  ),
  'dbtype' => 'mysql',
  'version' => '30.0.1.2',
  'overwrite.cli.url' => 'https://cloud.XXX.com/',
  'overwritehost' => 'cloud.XXX.com',
  'overwriteprotocol' => 'https',
  'dbname' => 'XXX',
  'dbhost' => 'XXX:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXX',
  'dbpassword' => 'XXX',
  'installed' => true,
  'maintenance_window_start' => 1,
  'default_phone_region' => 'CA',
  'app_install_overwrite' => 
  array (
    0 => 'news',
    1 => 'files_external_dropbox',
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\APCu',
  'upgrade.disable-web' => true,
  'maintenance' => false,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'XXX.co',
  'mail_smtphost' => 'mail.XXX.co',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'nextcloud@XXX.co',
  'mail_smtppassword' => 'XXX',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
    0 => 'admin',
  ),
  'loglevel' => 2,
);

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

There is only one file in this location error.og, this file is empty.
/var/log/nginx# ls -l
total 0
-rw-r--r-- 1 root root 0 Oct 22 20:45 error.log

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

https://pastebin.com/m2zGGHz1