All shares disapear on an S3 external storage

Nextcloud version (eg, 12.0.2): 15.0.2
Operating system and version (eg, Ubuntu 17.04): Working on a Jelastic provider
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.34
PHP version (eg, 7.1): 7.2.9

Hey first thanks a lot for your help!

The issue you are facing:
I setup a remote storage on an S3 compatible provider (Swisscom in Switzerland) to handle files for my small organization, currently like 10 users, maximum 4 simultaneous connexions.
My logs sometimes get suddenly filled with connection reset by peer, more than 10 errors (error and fatal). The app they are listed under are Webdav, files_external and sometimes no app in context.
The problem is not really the logs, but the fact that every share on that remote storage is simply erased. I then have to add them back manually (I setup some important shares myself) but if a user wants to share something particular with another and then it’s suddenly not shared anymore, that’s a problem.

Here is an example of two possible errors, messages are different depending on the app but it’s always those two requests, either CreateBucket or ListObjects.

Exception: Creation of bucket "swisscombox" failed. Error executing "CreateBucket" on "[...]"; AWS HTTP error: cURL error 56: TCP connection reset by peer (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

or

Aws\S3\Exception\S3Exception: Error executing "ListObjects" on "[...]"; AWS HTTP error: cURL error 56: TCP connection reset by peer (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

I replaced the […]
My guess is that nextcloud thinks there’s no more external storage as it is not reachable, thus deletes all shares.

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

Steps to replicate it:

  1. Configure a remote storage on Swisscom
  2. add a directory, share it and wait for errors to come
  3. See that share information has disapeared

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

<?php
$CONFIG = array (
  'passwordsalt' => '#####',
  'secret' => ''#####',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'stammbox.devbs.ch',
    2 => 'stammbox.sauvabelin.ch',
  ),
  'datadirectory' => '/var/www/webroot/stammbox/mount-data',
  'dbtype' => 'mysql',
  'version' => '15.0.2.0',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'stammbox',
  'dbhost' => ''#####',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => ''#####',
  'dbpassword' => ''#####',
  'installed' => true,
  'quota_include_external_storage' => false,
  'default_language' => 'fr',
  'knowledgebaseenabled' => true,
  'allow_user_to_change_display_name' => false,
  'instanceid' => 'ocxqisl7c2tw',
  'loglevel' => 2,
  'maintenance' => false,
  'data-fingerprint' => '75b2df8ca4d2a9a931b095550e3697fb',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => ''#####',
    'port' => 6379,
    'password' => ''#####',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
);

Thanks a lot for your help and advices!