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

Nextcloud version: 17.0.2
Operating system and version: NextcloudPi 1.20.1
Apache or nginx version: Apache 2.4.38
PHP version: 7.3

I get this error in the logs

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

and I believe it happens every time I try to upload something.

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'
),
  'datadirectory' => '/media/myCloudDrive/ncdata',
  'dbtype' => 'mysql',
  'version' => '17.0.2.1',
  'overwrite.cli.url' => '*'
dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '*',
  'dbpassword' => '*',
  'installed' => true,
  'instanceid' => '*',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '*',
  ),
  'tempdirectory' => '/media/myCloudDrive/ncdata/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => '*'',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'loglevel' => '2',
  'log_type' => 'file',
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'theme' => '',
  'logfile' => '/media/myCloudDrive/ncdata/nextcloud.log',
  'mail_sendmailmode' => 'smtp',
  'has_rebuilt_cache' => true,
  'data-fingerprint' => '*',
);

The output of your Apache/nginx/system log in /var/log/apache2/error.log:

[Mon Dec 30 00:00:08.613658 2019] [ssl:warn] [pid 877:tid 1995993616] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Dec 30 00:00:08.617823 2019] [mpm_event:notice] [pid 877:tid 1995993616] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured -- resuming normal operations
[Mon Dec 30 00:00:08.617852 2019] [core:notice] [pid 877:tid 1995993616] AH00094: Command line: '/usr/sbin/apache2'

Could you please post the full line and context of the message?
I think it’s probably a PHP Notice, so not an error. If it is you can simply change the loglevel in your php.ini

That seems to be the whole message. What level should I change it to?

Might check value of sys_temp_dir
in
/etc/php/7.3/fpm/php.ini

see “HEADERS on invalid stream”
and this post on seemingly similar issue

sys_temp_dir = /media/myCloudDrive/ncdata/tmp
which is the same path set in config.php.

I guess I will have to reinstall nextcloud-client as suggested in HEADERS on invalid stream

Apologies for re-opening, but it seems this thread here is the only one mentioning this error message.

I get the same error, on a fresh install. It appears also when uploading files through the browser, so I don’t think it’s causes by the sync client.

I did have to edit php.ini as mentioned above, so I share some of the history. I can now upload fine. Ideally I’d like to get rid of this error.

Thanks for that, i had this message spaming my logs for ages, i have now edited the php.ini (had to uncomnent that line btw) and it seems gone now. my assumption is that without that line the files sent to nextcloud also get temp stored on the sdcard (raspbian), as my datadir is moved to a usb hdd. I will keep an eye on file transfers for a while…

Tried uncommenting, as you suggested. That doesn’t seem to work for me.

Because you also need to change the path to your own…

For me it seems solved, however i get a new message now that is quite similar but occures every 5 minutes:

Error
PHP
vor 3 Minuten
Unknown: file created in the system’s temporary directory at Unknown#0

Not sure if this is even related… however, i have no idea where i could find more infos on that

I just got this error and discovered that mod_security was causing the problem with larger files. Check your logs and modify mod_security.conf appropriately.

In my case it was “SecRequestBodyLimit” which was triggering. I increased the limit and everything’s fine.

Please check the setting about “big_file_upload_configuration” Uploading big files > 512MB — Nextcloud latest Administration Manual latest documentation

I think you may need to modify the “upload_tmp_dir” rather than “sys_temp_dir”.

Plus, be careful about the permission about the tmp file. For example,

chown -R root:www-data “YOUR_PATH_TO_TMP”
chmod -R 755 “YOUR_PATH_TO_TMP”

Thanks for your helpful comment !
but for the permissions the first line causes a lot of problems instead of correcting. It should look like this:
chown -R www-data:www-data “YOUR_PATH_TO_TMP”