[PHP] Error: fread(): file created in the system's temporary directory at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#91

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:


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: 18.0.4
Operating system and version: Raspbian 10 Buster
Apache version: 2.4.38
PHP version: 7.3.14-1~deb10u1

The issue you are facing:

After moving Data folder to external storage, anytime I upload something this get logged:

[PHP] Error: fread(): file created in the system’s temporary directory at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#91

But the file itself uploads fine, just the log gets spammed, and then it’s hard to notice if something else is wrong.

I tried moving temp directory from SD Card to my external drive and back, changing path settings in both config.php and php.ini but still the same. I also tried to uninstall all my clients and log out all my sessions, but after login back it’s the same.

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

Steps to replicate it:

  1. Upload anything (Doesn’t matter if through web browser, Windows or Android client)
  2. Files gets uploaded
  3. Error line is logged

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: fread(): file created in the system's temporary directory at /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php#91

PUT /nextcloud/remote.php/webdav/xx/xx.jpg
from IP by USERNAME at 2020-05-03T12:56:03+02:00

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

$CONFIG = array (
  'instanceid' => 'X',
  'passwordsalt' => 'X',
  'secret' => 'X',
  'trusted_domains' => 
  array (
    0 => 'X',
    1 => 'localhost',
    2 => 'X',
    3 => 'X',
  'datadirectory' => '/mnt/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'X',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'X',
  'dbpassword' => 'X',
  'installed' => true,
  'htaccess.RewriteBase' => '/nextcloud',
  'log_type' => 'file',
  'logfile' => '/var/www/nextcloud/logs/nextcloud.log',
  'logtimezone' => 'X',
  'log_rotate_size' => 104857600,
  'tempdirectory' => '/var/www/nextcloud/tmp',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  'twofactor_enforced_excluded_groups' => 
  array (
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,

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

Nothing was logged at the time of PHP ERROR.

Please check the answer in Fread(): file created in the system's temporary directory at /var/www/nextcloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php#91