Nextcloud 13.0.4 eats my Mariadb connections

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com 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:

example

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

longer
example
here

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!):

<?php
$CONFIG = array (
  'instanceid' => 'oc96bfef7223',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => 'owncloud.newtech.fi',
  ),
  'datadirectory' => '/usr/local/owncloud/data',
  'dbtype' => 'mysql',
  'version' => '13.0.4.0',
  'installed' => true,
  'theme' => '',
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'forcessl' => true,
  'loglevel' => '5',
  'mail_domain' => 'newtech.fi',
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'owncloud',
  'mail_smtphost' => 'mail.newtech.fi',
  '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 => '{imap.newtech.fi:3993/imap/ssl/novalidate-cert}INBOX',
      ),
    ),
  ),
  'mail_smtpport' => '2025',
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'overwrite.cli.url' => 'https://owncloud.newtech.fi',
);

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 - https://GitHub.com/Nextcloud/server/issues

@nickvergessen just in case he’s about.