Nextcloud 13.0.4 eats my Mariadb connections

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 13.0.4
Operating system and version (eg, Ubuntu 17.04): Fedora Core 27
Apache or nginx version (eg, Apache 2.4.25): 2.4.33
PHP version (eg, 7.1): 7.1.18

Mariadb: 10.2.14

The issue you are facing:

Occasionally (2-4 times / month) Nextcloud will clog the Mariadb server with sleeping connections. Have max 150 configured and normally Nextcloud doesn’t use too many of these but on occasions there will be all 150 used by Netcloud connections in SLEEP state.
Is there a program path where some thing will open a new connection without closing the old one?

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

Steps to replicate it:

  1. Run Nextcloud for some weeks
  2. Check the connections with “echo “show processlist;” | mysql”
  3. Watch for the owncloud/nextcloud connections

The output of your Nextcloud log in Admin > Logging:

PASTE HERE (This log is empty)

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

$CONFIG = array (
  'instanceid' => 'oc96bfef7223',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/usr/local/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'installed' => true,
  'theme' => '',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'forcessl' => true,
  'loglevel' => '5',
  'mail_domain' => '',
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'owncloud',
  'mail_smtphost' => '',
  'enable_certificate_management' => true,
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbuser' => 'xxxxxxx',
  'dbpassword' => 'xxxxxxxx',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  'secret' => 'xxxxxxxxxxxxxxxxxx',
  'trashbin_retention_obligation' => 'auto',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'user_x',
  'mail_smtppassword' => 'xxxxxxxxx',
  'user_backends' => 
  array (
    0 => 
    array (
      'class' => 'OC_User_IMAP',
      'arguments' => 
      array (
        0 => '{}INBOX',
  'mail_smtpport' => '2025',
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'overwrite.cli.url' => '',

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

PASTE HERE (Nothing special (No errors) here and a very long access log ...)

This maybe sounds like a GitHub question -

@nickvergessen just in case he’s about.