Cannot upload: "Unable to create temporary files"

Nextcloud version (eg, 10.0.2): nextcloud-12.0.0-1.ns7.noarch
Operating system and version (eg, Ubuntu 16.04): NethServer release 7.3.1611 (Final)
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.6 (CentOS)
PHP version (eg, 5.6): 5.6
Is this the first time you’ve seen this error?: yes

How to replicate:

  • Login
  • Try to upload a file bigger than ~ 15KB

The issue you are facing:

Cannot upload files (only small files)

The output of my Nextcloud log in Admin > Logging:

Level	App	Message	Time
Warning	core	Login failed: 'admin' (Remote IP: '192.168.50.34')	2017-07-13T19:25:58-0300
Warning	core	Login failed: 'admin' (Remote IP: '192.168.50.34')	2017-07-13T19:25:43-0300
Fatal	webdav	Sabre\DAV\Exception\BadRequest: HTTP/1.1 400 expected filesize 16384 got 8192

    /usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1129: OCA\DAV\Connector\Sabre\File->put(Resource id #501)
    /usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 513: Sabre\DAV\Server->updateFile('Videos/qqfile', Resource id #501, NULL)
    [internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /usr/share/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
    /usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
    /usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
    /usr/share/nextcloud/apps/dav/appinfo/v1/webdav.php - line 71: Sabre\DAV\Server->exec()
    /usr/share/nextcloud/remote.php - line 162: require_once('/usr/share/next...')
    {main}

	2017-07-13T19:21:14-0300
Error	PHP	fread(): Unable to create temporary file, Check permissions in temporary files directory. at /usr/share/nextcloud/lib/private/legacy/helper.php#296	2017-07-13T19:21:14-0300

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 => 'groupware-test.infoestructura.local',
    2 => '192.168.50.3',
    3 => 'example.com',
  ),          
  'datadirectory' => '/var/lib/nethserver/nextcloud/',
  'overwrite.cli.url' => 'http://localhost',
  'dbtype' => 'mysql',
  'version' => '12.0.0.29',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '',
  'installed' => true,
  'instanceid' => xxxxxxxx',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
);

Please could you help me?

Hi, is there no-one with that issue?

thanks

For the record: I’ve fixed the problem editing /usr/share/nextcloud/.user.ini file and reading at https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html#php-fpm-configuration-notes1

HTH