Nextcloud - Can't create any new folder

Nextcloud version : 18.0.7
Operating system and version : Ubuntu 18.04.4 LTS
Apache or nginx version : Apache 2.4.29
PHP version : 7.2.24

The issue you are facing:
I can’t create any folders. If I try to create one, I get the message that the “Could not create folder …”.
Now if I refresh the page, the folder were created, but I can’t access it - I only get the message “This directory is unavailable, please check the logs or contact the administrator”
At the column “Size” has the new folder “Pending”.
If I go into Ubuntu and navigate to the folders path the folder is there. So it was created.
In PHPMyAdmin in the oc_filecache I got this:

fileid storage path path_hash parent name mimetype mimepart size mtime storage_mtime encrypted unencrypted_size etag permissions checksum
722980 3 files/… 1f8c2c1129c7d4c165eb60a01ebb2313 705099 asadfa 2 1 -1 1596362973 1596362973 0 0 5f2690dd63827 31

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

The output of your Nextcloud log in Admin > Logging:

[webdav] Fatal: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'UPDATE `oc_filecache` SET `size` = ? WHERE (`fileid` = ?) AND ((`size` <> ?) OR (`size` IS NULL))' with params [0, 722979, 0]:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away at <<closure>>

 0. /var/www/cloud.cs-koenig.org/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 169
    Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException("An exception oc ... y", Doctrine\DBAL\Dr ... ]})
 1. /var/www/cloud.cs-koenig.org/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 145
    Doctrine\DBAL\DBALException::wrapException(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "An exception oc ... y")
 2. /var/www/cloud.cs-koenig.org/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php line 1063
    Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Doctrine\DBAL\Driver\PDOMySql\Driver {}, Doctrine\DBAL\Dr ... ]}, "UPDATE `oc_file ... )", {1: 0,2: "*** se ... 0})
 3. /var/www/cloud.cs-koenig.org/lib/private/DB/Connection.php line 220
    Doctrine\DBAL\Connection->executeUpdate("UPDATE `oc_file ... )", [0,"*** sensitiv ... 0], [2,1,2])
 4. /var/www/cloud.cs-koenig.org/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php line 203
    OC\DB\Connection->executeUpdate("UPDATE `oc_file ... )", {dcValue1: "***  ... 0}, {dcValue1: 1,dcValue2: 2,dcValue3: 2})
 5. /var/www/cloud.cs-koenig.org/lib/private/DB/QueryBuilder/QueryBuilder.php line 215
    Doctrine\DBAL\Query\QueryBuilder->execute()
 6. /var/www/cloud.cs-koenig.org/lib/private/Files/Cache/Cache.php line 357
    OC\DB\QueryBuilder\QueryBuilder->execute()
 7. /var/www/cloud.cs-koenig.org/lib/private/Files/Cache/Wrapper/CacheJail.php line 133
    OC\Files\Cache\Cache->update("*** sensitive parameters replaced ***")
 8. /var/www/cloud.cs-koenig.org/apps/files_sharing/lib/Cache.php line 122
    OC\Files\Cache\Wrapper\CacheJail->update("*** sensitive parameters replaced ***")
 9. /var/www/cloud.cs-koenig.org/lib/private/Files/Cache/Scanner.php line 418
    OCA\Files_Sharing\Cache->update("*** sensitive parameters replaced ***")
10. /var/www/cloud.cs-koenig.org/lib/private/Files/Cache/Scanner.php line 339
    OC\Files\Cache\Scanner->scanChildren("*** sensitive parameter replaced ***", false, 3, "*** sensitive parameter replaced ***", false)
11. /var/www/cloud.cs-koenig.org/lib/private/Files/Cache/Updater.php line 124
    OC\Files\Cache\Scanner->scan("*** sensitive parameter replaced ***", false, 3, false)
12. /var/www/cloud.cs-koenig.org/lib/private/Files/View.php line 321
    OC\Files\Cache\Updater->update("*** sensitive parameters replaced ***")
13. /var/www/cloud.cs-koenig.org/lib/private/Files/View.php line 1177
    OC\Files\View->writeUpdate(OCA\Files_Trashb ... }}, "*** sensitive parameter replaced ***")
14. /var/www/cloud.cs-koenig.org/lib/private/Files/View.php line 269
    OC\Files\View->basicOperation("mkdir", "/CS-Koenig GbR/ ... 2", ["create","write"])
15. /var/www/cloud.cs-koenig.org/apps/dav/lib/Connector/Sabre/Directory.php line 189
    OC\Files\View->mkdir("/CS-Koenig GbR/ ... 2")
16. /var/www/cloud.cs-koenig.org/3rdparty/sabre/dav/lib/DAV/Server.php line 1210
    OCA\DAV\Connector\Sabre\Directory->createDirectory("Neuer Test 2")
17. /var/www/cloud.cs-koenig.org/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 590
    Sabre\DAV\Server->createCollection("files/Administr ... 2", Sabre\DAV\MkCol {})
18. <<closure>>
    Sabre\DAV\CorePlugin->httpMkcol(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
19. /var/www/cloud.cs-koenig.org/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpMkcol"], [Sabre\HTTP\Requ ... }])
20. /var/www/cloud.cs-koenig.org/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:MKCOL", [Sabre\HTTP\Requ ... }])
21. /var/www/cloud.cs-koenig.org/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
22. /var/www/cloud.cs-koenig.org/apps/dav/lib/Server.php line 319
    Sabre\DAV\Server->exec()
23. /var/www/cloud.cs-koenig.org/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
24. /var/www/cloud.cs-koenig.org/remote.php line 165
    require_once("/var/www/cloud. ... p")

MKCOL /remote.php/dav/files/Administrator/CS-Koenig%20GbR/Projekte/20009%20-%20RTI%20OHG%20-%20Layout%20Anlage/Neuer%20Test%202
from 2a02:810d:4c40:d7c:5898:cae7:bde:21a3 by Administrator at 2020-08-02T09:45:59+00:00

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

<?php
$CONFIG = array (
  'instanceid' => '*********************************************',
  'passwordsalt' => '*********************************************',
  'secret' => '*********************************************',
  'trusted_domains' => 
  array (
    0 => '*********************************************',
    1 => '*********************************************',
    2 => '*********************************************',
  ),
  'datadirectory' => '/media/cs-koenig-gbr/STOR-NEXTCLOUD/data',
  'dbtype' => 'mysql',
  'version' => '18.0.7.1',
  'overwrite.cli.url' => 'https://localhost/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_Administrator',
  'dbpassword' => '*********************************************',
  'installed' => true,
  'mail_domain' => 'cs-koenig.org',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_smtphost' => 'smtp.1und1.de',
  'mail_smtpport' => '465',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'cloud.cs-koenig.org',
  'mail_smtppassword' => '*********************************************',
  'mail_smtpsecure' => 'ssl',
  'maintenance' => false,
  'filelocking.enabled' => false,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
    0 => 'kunde',
  ),
  'updater.release.channel' => 'stable',
  'theme' => '',
  'log_type' => 'file',
  'logfile' => '/var/www/cloud.cs-koenig.org/data/nextcloud.log',
  'loglevel' => 0,
  'logdateformat' => 'F d, Y H:i:s',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'updater.secret' => '*********************************************',
);

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

[Sun Aug 02 13:07:48.130549 2020] [ssl:warn] [pid 1189] AH01909: cloud.cs-koenig.org:443:0 server certificate does NOT include an ID which matches the server name
[Sun Aug 02 13:07:48.302255 2020] [ssl:warn] [pid 1509] AH01909: cloud.cs-koenig.org:443:0 server certificate does NOT include an ID which matches the server name
[Sun Aug 02 13:07:48.304876 2020] [mpm_prefork:notice] [pid 1509] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 configured -- resuming normal operations
[Sun Aug 02 13:07:48.304893 2020] [core:notice] [pid 1509] AH00094: Command line: '/usr/sbin/apache2'

Well, your database can’t be reached anymore. Try to start the database again and if that is failing, check the error logs of the database.