Unable to upload files bigger than about 100MB

Nextcloud version (eg, 10.0.2): 12
most info you can find here: https://www.shaolinsteyr.at/phpinfo.php

Is this the first time you’ve seen this error?:
Yes, before i uplodat only smaler filse. with the client software i can sync big files well, but from the browser it does not work.

Can you reliably replicate it? (If so, please outline steps):
start browser, go to my nextcloud, try to upload files bigger than 100MB

The issue you are facing:
try upload fils bigger than 100MB leads to internal server error

The output of your Nextcloud log in Admin > Logging:
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘UPDATE oc_file_locks SET lock = -1, ttl = ? WHERE key = ? AND lock = 1’ with params [1496741760, “files/b02eb6dbf78b11a0e6a6f7cbe18141d9”]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

/home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
/home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 1015: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'UPDATE `oc_file...', Array)
/home/.sites/29/site1794/web/Owncloud/lib/private/DB/Connection.php - line 213: Doctrine\DBAL\Connection->executeUpdate('UPDATE `oc_file...', Array, Array)
/home/.sites/29/site1794/web/Owncloud/lib/private/Lock/DBLockingProvider.php - line 229: OC\DB\Connection->executeUpdate('UPDATE `oc_file...', Array)
/home/.sites/29/site1794/web/Owncloud/lib/private/Files/Storage/Common.php - line 768: OC\Lock\DBLockingProvider->changeLock('files/b02eb6dbf...', 2)
/home/.sites/29/site1794/web/Owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 610: OC\Files\Storage\Common->changeLock('files/Uploads/2...', 2, Object(OC\Lock\DBLockingProvider))
/home/.sites/29/site1794/web/Owncloud/lib/private/Files/View.php - line 1945: OC\Files\Storage\Wrapper\Wrapper->changeLock('files/Uploads/2...', 2, Object(OC\Lock\DBLockingProvider))
/home/.sites/29/site1794/web/Owncloud/apps/dav/lib/Connector/Sabre/Node.php - line 351: OC\Files\View->changeLock('/Uploads/201706...', 2)
/home/.sites/29/site1794/web/Owncloud/apps/dav/lib/Connector/Sabre/File.php - line 171: OCA\DAV\Connector\Sabre\Node->changeLock(2)
/home/.sites/29/site1794/web/Owncloud/apps/dav/lib/Connector/Sabre/Directory.php - line 151: OCA\DAV\Connector\Sabre\File->put(Resource id #485)
/home/.sites/29/site1794/web/Owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1095: OCA\DAV\Connector\Sabre\Directory->createFile('20170603_194035...', Resource id #485)
/home/.sites/29/site1794/web/Owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('Uploads/2017060...', Resource id #485, NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/home/.sites/29/site1794/web/Owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/home/.sites/29/site1794/web/Owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/home/.sites/29/site1794/web/Owncloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/home/.sites/29/site1794/web/Owncloud/apps/dav/appinfo/v1/webdav.php - line 71: Sabre\DAV\Server->exec()
/home/.sites/29/site1794/web/Owncloud/remote.php - line 162: require_once('/home/.sites/29...')
{main}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
<?php
$CONFIG = array (
‘instanceid’ => ‘+++’,
‘passwordsalt’ => ‘+++’,
‘secret’ => ‘+++’,
‘trusted_domains’ =>
array (
0 => ‘+++’,
),
‘datadirectory’ => ‘+++’,
‘overwrite.cli.url’ => ‘+++’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘12.0.0.29’,
‘dbname’ => ‘+++’,
‘dbhost’ => ‘+++’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘+++’,
‘dbpassword’ => ‘+++’,
‘logtimezone’ => ‘UTC’,
‘installed’ => true,
‘asset-pipeline.enabled’ => false,
‘loglevel’ => 4,
‘theme’ => ‘’,
‘maintenance’ => false,
‘trashbin_retention_obligation’ => ‘auto’,
‘updater.release.channel’ => ‘stable’,
‘updater.secret’ => ‘$2y$10$SFj26NMTvzcsowBxuPkMI.6sZr09iJVq0sYk5M12bwbKgqoGJb8xq’,
‘mail_from_address’ => ‘+++’,
‘mail_smtpmode’ => ‘php’,
‘mail_domain’ => ‘+++’,
);

The output of your Apache/nginx/system log in /var/log/____:
[Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
[Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] #0 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): PDOStatement->execute(NULL)
[Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] #1 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute()
[Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] #2 /home/.sites/29/site1794/web/Owncloud/lib/private/DB/Connection.php(213): Doctrine\DBAL\Connection->executeUpdate(‘UPDATE oc_file...', Array, Array) [Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] #3 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(208): OC\\DB\\Connection->executeUpdate('UPDATEoc_file…’, Array, Array)
[Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] #4 /home/.sites/29/site1794/web/Owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(213): Doctrine\DBAL\Query\QueryBuilder->execute()
[Tue Jun 06 10:19:36 2017] [error] [client 86.56.135.25] #5 /home/.sites/29/site1794/web/Owncloud/lib/private/Lock/D in /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 116
[Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
[Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] #0 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): PDOStatement->execute(NULL)
[Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] #1 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute()
[Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] #2 /home/.sites/29/site1794/web/Owncloud/lib/private/DB/Connection.php(213): Doctrine\DBAL\Connection->executeUpdate(‘UPDATE oc_file...', Array, Array) [Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] #3 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(208): OC\\DB\\Connection->executeUpdate('UPDATEoc_file…’, Array, Array)
[Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] #4 /home/.sites/29/site1794/web/Owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(213): Doctrine\DBAL\Query\QueryBuilder->execute()
[Tue Jun 06 10:32:06 2017] [error] [client 86.56.135.25] #5 /home/.sites/29/site1794/web/Owncloud/lib/private/Lock/D in /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 116
[Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:91
[Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] #0 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(91): PDOStatement->execute(NULL)
[Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] #1 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1006): Doctrine\DBAL\Driver\PDOStatement->execute()
[Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] #2 /home/.sites/29/site1794/web/Owncloud/lib/private/DB/Connection.php(213): Doctrine\DBAL\Connection->executeUpdate(‘UPDATE oc_file...', Array, Array) [Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] #3 /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(208): OC\\DB\\Connection->executeUpdate('UPDATEoc_file…’, Array, Array)
[Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] #4 /home/.sites/29/site1794/web/Owncloud/lib/private/DB/QueryBuilder/QueryBuilder.php(213): Doctrine\DBAL\Query\QueryBuilder->execute()
[Tue Jun 06 10:36:00 2017] [error] [client 86.56.135.25] #5 /home/.sites/29/site1794/web/Owncloud/lib/private/Lock/D in /home/.sites/29/site1794/web/Owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 116
[Tue Jun 06 10:36:07 2017] [crit] [client 86.56.135.25] (13)Permission denied: /home/.sites/29/site1794/web/Owncloud/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Jun 06 10:36:12 2017] [crit] [client 86.56.135.25] (13)Permission denied: /home/.sites/29/site1794/web/Owncloud/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Jun 06 10:36:19 2017] [crit] [client 86.56.135.25] (13)Permission denied: /home/.sites/29/site1794/web/Owncloud/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Jun 06 10:37:30 2017] [crit] [client 86.56.135.25] (13)Permission denied: /home/.sites/29/site1794/web/Owncloud/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Tue Jun 06 10:37:34 2017] [crit] [client 86.56.135.25] (13)Permission denied: /home/.sites/29/site1794/web/Owncloud/data/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable


Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

in my opinion, this looks like an SQL timeout.

can you show us the mysql.cnf please?

usually you can find it under the following file: nano /etc/mysql/mysql.conf.d/mysqld.cnf

it is shared hosting, so i can’t. i can ask the support there if you tell me, what i should ask.

they should check for all timeouts, like innodb_lock_wait_timeout = 360 and other timeouts in your php-configs etc.

or just let them run through this script, in case youre using ubuntu 16.04:

#!/bin/bash
### GLOBAL STATIC ###
mysqlfile=/etc/mysql/mysql.conf.d/mysqld.cnf
php7ini=/etc/php/7.0/apache2/php.ini 
php7cli=/etc/php/7.0/cli/php.ini
userini=/var/www/html/nextcloud/.user.ini
htaccess=/var/www/html/nextcloud/.htaccess

#=====================================================================================================================#
### DECLARING FUNCTIONS ###

# Function CHECK VERSION
getversion () {
	wwwpath=/var/www/html
	if [ -e $wwwpath/nextcloud ] ;
	then
		wwwpath=$wwwpath/nextcloud/
		type=Nextcloud
	elif [ -e $wwwpath/owncloud ] ;
	then
		wwwpath=$wwwpath/owncloud/
		type=ownCloud
	fi
	cd $wwwpath
	version=$(sudo -u www-data php occ status | awk '/version\: /{print $2 $3}')
	echo "You're currently running $type $version" 
	export wwwpath
}

# Function GET RAM SIZE
getramsize () {
	ramsize=$(grep MemTotal /proc/meminfo | awk '{print $2}')
	echo "$ramsize KB of RAM existing."
	sleep 1
}

# Function SET INNODB MEMORY
setinnodbmem () {
	innodbmem=$(( ramsize / 8192 ))
	echo "Set innodb-Memory to $innodbmem MBytes."
	sleep 1
}

# Function PHP TUNE
phptune () {
	# Check existance of php7ini-file
	if [ -e $1 ] ;
	then
		sed -i "s/^max_execution_time.*$/max_execution_time = 360/" $1
		sed -i "s/^max_input_time.*$/max_input_time = 360/" $1
		sed -i "s/^upload_max_filesize.*$/upload_max_filesize = 16G/" $1
		sed -i "s/^post_max_size.*$/post_max_size = 16400M/" $1
		sed -i "s/^memory_limit.*$/memory_limit = 256M/" $1
		sed -i "s/^output_buffering.*$/output_buffering = Off/" $1
		echo "$1 configured."
		sleep 1
	else
		echo "\'$1\' does not exist!"
		echo "Will continue anyway in 5s."
		sleep 5	
	fi
}

# Function MYSQL TUNE
mysqltune () {
	if [ -e $mysqlfile ] ; 
	then
		test=$(grep "innodb_flush_log_at_trx_commit = 2" /etc/mysql/mysql.conf.d/mysqld.cnf)
		if [ -z "$test" ] ;
		then
			sed -i '/^\# \* InnoDB/ a innodb_lock_wait_timeout = 360 \ninnodb_buffer_pool_size = '$innodbmem'M \ninnodb_flush_log_at_trx_commit = 2' $mysqlfile
			echo "$mysqlfile configured."
			sleep 1
		else
			echo "MySQL-File has already been touched once."
			echo "Leaving everything untouched."
			echo ""
			echo "Will continue in 3s."
			sleep 3
		fi
	else
		echo "'$' does not exist!"
		echo "Will continue anyway in 5s."
		sleep 5
	fi
}

# Function HTACCESS Tuning
htinitune () {
	if [ -e $1 ] ;
	then
		sed -i "s/upload_max_filesize.*$/upload_max_filesize 16G/" $1
		sed -i "s/post_max_size.*$/post_max_size 16400M/" $1
		echo "$1 configured."
		sleep 1
	else
		echo "$1 does not exist!"
		echo "Will continue anyway in 5s."
		sleep 5
	fi
}

# Function user.ini Tuning
userini () {
	if [ -e $1 ] ;
	then
		sed -i "s/upload_max_filesize.*$/upload_max_filesize=16G/" $1
		sed -i "s/post_max_size.*$/post_max_size=16400M/" $1
		echo "$1 configured."
		sleep 1
	else
		echo "$1 does not exist!"
		echo "Will continue anyway in 5s."
		sleep 5
	fi
}

# Function SECURE
secure () {
ocpath=$wwwpath
htuser='www-data'
htgroup='www-data'
rootuser='root'

find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750

chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocpath}/data/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/

chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess

chmod 0644 ${ocpath}/.htaccess
chmod 0644 ${ocpath}/data/.htaccess

echo "$type path secured!"
sleep 1
}

#=====================================================================================================================#

### INVOKES ###
getversion
getramsize
setinnodbmem
phptune $php7cli
phptune $php7ini
mysqltune
htinitune $htaccess
userini $userini
secure

echo "All settings set!"
sleep 2

exit

#=====================================================================================================================#

** edit: this script is valid until NC version 11.0.3.
in NC 12 they’ve added a few settings which have to be set additionally into these 2 configs:

nano /etc/php/7.0/cli/php.ini
nano /etc/php/7.0/apache2/php.ini

opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1