Sync client causing issues with NC21 after update

,
Support intro

Nextcloud version (eg, 20.0.5): 21.0.1
Operating system and version (eg, Ubuntu 20.04): ubuntu0.20.04.1
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): 7.4.3
Sync client 3.1.3

The issue you are facing:
The sync client is causing errors in the log constantly while syncing. The error also occurs during regular file upload from drag-n-drop. This did not occur before updating from 20.0.1.
The file system is on Wasabi s3 instead of local. Thanks for any help.

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

Steps to replicate it:

  1. Move, add or replace a file on local PC to make sync client work
  2. upload file to server through web interface

The output of your Nextcloud log in Admin > Logging:

Error	PHP	Error: fclose(): supplied resource is not a valid stream resource at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#96

    <<closure>>

    OC\Log\ErrorHandler::onError()

    /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php - line 96:

    fclose()

    /var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php - line 117:

    Icewind\Streams\Wrapper->stream_close()

    <<closure>>

    Icewind\Streams\CallbackWrapper->stream_close()

    /var/www/nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php - line 108:

    fclose()

    /var/www/nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php - line 74:

    GuzzleHttp\Psr7\Stream->close()

    <<closure>>

    GuzzleHttp\Psr7\Stream->__destruct() 

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

$CONFIG = array (
  'passwordsalt' => 'REMOVED',
  'secret' => 'REMOVED',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'REMOVED',

  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => 'REMOVED',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'REMOVED',
  'dbpassword' => 'REMOVED',
  'installed' => true,
  'instanceid' => 'occuqxbo5uko',
  'upgrade.disable-web' => 'true',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '10485760',
  'trashbin_retention_obligation' => 'auto, 180',
  'versions_retention_obligation' => 'auto, 365',
  'simpleSignUpLink.shown' => 'false',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => false,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'REMOVED',
  ),
  'objectstore' => 
  array (
    'class' => 'OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => 'REMOVED',
      'autocreate' => true,
      'key' => 'REMOVED',
      'secret' => 'REMOVED',
      'hostname' => 's3.us-east-2.wasabisys.com',
      'port' => 443,
      'use_ssl' => true,
      'region' => 'us-east-2',
      'use_path_style' => false,
    ),
  ),
  'logtimezone' => 'US/Eastern',
  'htaccess.RewriteBase' => '/',
  'share_folder' => '/Shared',
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\Image',
    2 => 'OC\\Preview\\Photoshop',
    3 => 'OC\\Preview\\TIFF',
    4 => 'OC\\Preview\\SVG',
    5 => 'OC\\Preview\\Font',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\Movie',
    8 => 'OC\\Preview\\MKV',
    9 => 'OC\\Preview\\MP4',
    10 => 'OC\\Preview\\AVI',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'maintenance' => false,
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'REMOVED',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'REMOVED',
  'mail_smtpport' => '25',
  'mail_smtpname' => 'REMOVED',
  'mail_smtppassword' => 'REMOVED',
  'default_phone_region' => 'us',
);
3 Likes

I’m having an identical issue. Also using external S3 storage as my primary storage, but I’m running on Debian 10 rather than Ubuntu. I notice this error any time I upload a new item. Nothing seems to function incorrectly, but I’d still like to resolve the error

Edit: This was fixed here - [S3] fclose(): supplied resource is not a valid stream resource · Issue #23373 · nextcloud/server · GitHub

Edit 2: This looks to have been fixed completely with the Nextcloud 22 stable release