Internal Server Error. Cannot upload most files

9.1.x
webserver_issue
help

#1

Edit 1
I set the Loglevel to 0. And when I upload files. The "internal server error" is not loged in the owncloud.log and apache.log

Edit 2
I run the sudo -u www-data php5 occ files:scan --all command and this happend:

Exception while scanning: Jail rootPath is null
#0 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Jail.php(470): OC\Files\Storage\Wrapper\Jail->getSourcePath('scanner::')
#1 /var/www/owncloud/apps/files_sharing/lib/sharedstorage.php(371): OC\Files\Storage\Wrapper\Jail->resolvePath('scanner::')
#2 /var/www/owncloud/lib/private/Files/Storage/Wrapper/Wrapper.php(584): OC\Files\Storage\Shared->acquireLock('scanner::', 2, Object(OC\Lock\DBLockingProvider))
#3 /var/www/owncloud/lib/private/Files/Cache/Scanner.php(305): OC\Files\Storage\Wrapper\Wrapper->acquireLock('scanner::', 2, Object(OC\Lock\DBLockingProvider))
#4 /var/www/owncloud/lib/private/Files/Utils/Scanner.php(195): OC\Files\Cache\Scanner->scan('', true, 3)
#5 /var/www/owncloud/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan('/sarah')
#6 /var/www/owncloud/apps/files/lib/Command/Scan.php(226): OCA\Files\Command\Scan->scanFiles('sarah', '/sarah', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false)
#7 /var/www/owncloud/3rdparty/symfony/console/Command/Command.php(259): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/owncloud/core/Command/Base.php(158): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/owncloud/3rdparty/symfony/console/Application.php(844): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/owncloud/3rdparty/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/owncloud/3rdparty/symfony/console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/owncloud/lib/private/Console/Application.php(146): Symfony\Component\Console\Application->run(NULL, NULL)
#13 /var/www/owncloud/console.php(102): OC\Console\Application->run()
#14 /var/www/owncloud/occ(11): require_once('/var/www/ownclo...')
#15 {main}

Steps to reproduce
1. Upload a file

Expected behaviour
File gets uploaded

Actual behaviour
An error message appears. : Internal Server Error
Happens very often to the web client.
I can only upload files smaller than 160kb.
And it happens somethimes with the desktop client too. But not so often. I can upload files that are as large as my 800MB max_file_size.

Server configuration
Operating system: Debian 8.6
Web server: Apache 2.4.10
Database: 5.5.53
PHP version: 5.6.27
ownCloud version (see ownCloud admin page): 9.1.2 (stable)
Updated from an older ownCloud or fresh install: update from 8.2.0 -> 8.2.9 -> 9.0 -> 9.1 -> 9.1.2 and then i did a fresh install and recovered from a backup.

Special configuration (external storage, external authentication, reverse proxy, server-side-encryption):
My data folder is mounted through sshfs.
A simple reverse proxy is set on a different server that handles the request to the apache running on the owncloud host.
I hat still 8.2.0 running. But updated to 9.1.2 today.
That didn't help so I did a fresh install mounted the data drive to the new host and did a mysql restore of the db. It worked shortly. But then it didn't. Last thing I changed was adding the contact, calender and document app.
It seems as files I've allready had uploaded tend to definitly fail. But some new, small files seem to work.
Both, / and /var/www/owncloud/data have more than 50% free capacity.

ownCloud log (data/owncloud.log)

Please paste possible errors in the following code block, see https://central.owncloud.org/t/how-to-find-webserver-or-oc-logfile-enable-php-logfile/808 for more info

 Fatal 	webdav 	Exception: {"Message":"HTTP\/1.1 503 Could not open file","Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Code":0,"Trace":"#0 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(83): OCA\\DAV\\Connector\\Sabre\\File->get()\n#1 [internal function]: Sabre\\DAV\\CorePlugin->httpGet(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#2 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:GET', Array)\n#4 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#5 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/webdav.php(56): Sabre\\DAV\\Server->exec()\n#6 \/var\/www\/owncloud\/remote.php(164): require_once('\/var\/www\/ownclo...')\n#7 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php","Line":306,"User":"ole"} 	2016-11-30T20:40:52+00:00
Error 	PHP 	fopen(/var/www/owncloud/data/clemo/files/works/studi/unterlagen fuer alle/bach/2016WS/ADM/mfi1.pdf): failed to open stream: No such file or directory at /var/www/owncloud/lib/private/Files/Storage/Local.php#278 	2016-11-30T20:40:52+00:00
Warning 	core 	Trusted domain error. "192.168.1.172" tried to access using "192.168.1.25" as host. 	2016-11-30T20:34:54+00:00 
 Debug 	caldav 	Exception: {"Message":"HTTP\/1.1 403 Forbidden","Exception":"Sabre\\DAV\\Exception\\Forbidden","Code":0,"Trace":"#0 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(771): OCA\\DAV\\CalDAV\\Calendar->propPatch(Object(Sabre\\DAV\\PropPatch))\n#1 [internal function]: Sabre\\DAV\\CorePlugin->propPatchNodeUpdate('calendars\/Margi...', Object(Sabre\\DAV\\PropPatch))\n#2 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1194): Sabre\\Event\\EventEmitter->emit('propPatch', Array)\n#4 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(383): Sabre\\DAV\\Server->updateProperties('calendars\/Margi...', Array)\n#5 [internal function]: Sabre\\DAV\\CorePlugin->httpPropPatch(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#7 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:PROPPATC...', Array)\n#8 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#9 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/caldav.php(83): Sabre\\DAV\\Server->exec()\n#10 \/var\/www\/owncloud\/remote.php(164): require_once('\/var\/www\/ownclo...')\n#11 {main}","File":"\/var\/www\/owncloud\/apps\/dav\/lib\/CalDAV\/Calendar.php","Line":161,"User":"Margit"} 	2016-11-30T21:00:19+00:00
Debug 	caldav 	Exception: {"Message":"HTTP\/1.1 401 No 'Authorization: Basic' header found. Either the client didn't send one, or the server is mis-configured","Exception":"Sabre\\DAV\\Exception\\NotAuthenticated","Code":0,"Trace":"#0 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#1 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#2 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(446): Sabre\\Event\\EventEmitter->emit('beforeMethod', Array)\n#3 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#4 \/var\/www\/owncloud\/apps\/dav\/appinfo\/v1\/caldav.php(83): Sabre\\DAV\\Server->exec()\n#5 \/var\/www\/owncloud\/remote.php(164): require_once('\/var\/www\/ownclo...')\n#6 {main}","File":"\/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php","Line":188,"User":false} 	2016-11-30T21:00:18+00:00
Error 	PHP 	Class 'OC\Session\Internal' not found at /var/www/owncloud/lib/base.php#427 
 Error 	files 	Exception: {"Exception":"InvalidArgumentException","Message":"Jail rootPath is null","Code":0,"Trace":"#0 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Jail.php(470): OC\\Files\\Storage\\Wrapper\\Jail->getSourcePath('scanner::')\n#1 \/var\/www\/owncloud\/apps\/files_sharing\/lib\/sharedstorage.php(371): OC\\Files\\Storage\\Wrapper\\Jail->resolvePath('scanner::')\n#2 \/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(584): OC\\Files\\Storage\\Shared->acquireLock('scanner::', 2, Object(OC\\Lock\\DBLockingProvider))\n#3 \/var\/www\/owncloud\/lib\/private\/Files\/Cache\/Scanner.php(305): OC\\Files\\Storage\\Wrapper\\Wrapper->acquireLock('scanner::', 2, Object(OC\\Lock\\DBLockingProvider))\n#4 \/var\/www\/owncloud\/lib\/private\/Files\/Cache\/Scanner.php(478): OC\\Files\\Cache\\Scanner->scan('', true, 1)\n#5 \/var\/www\/owncloud\/lib\/private\/Files\/Cache\/Scanner.php(495): OC\\Files\\Cache\\Scanner->OC\\Files\\Cache\\{closure}()\n#6 \/var\/www\/owncloud\/lib\/private\/Files\/Cache\/Scanner.php(479): OC\\Files\\Cache\\Scanner->runBackgroundScanJob(Object(Closure), '')\n#7 \/var\/www\/owncloud\/lib\/private\/Files\/Utils\/Scanner.php(143): OC\\Files\\Cache\\Scanner->backgroundScan()\n#8 \/var\/www\/owncloud\/apps\/files\/lib\/BackgroundJob\/ScanFiles.php(87): OC\\Files\\Utils\\Scanner->backgroundScan('')\n#9 \/var\/www\/owncloud\/apps\/files\/lib\/BackgroundJob\/ScanFiles.php(111): OCA\\Files\\BackgroundJob\\ScanFiles->runScanner(Object(OC\\User\\User))\n#10 \/var\/www\/owncloud\/lib\/private\/BackgroundJob\/Job.php(52): OCA\\Files\\BackgroundJob\\ScanFiles->run(NULL)\n#11 \/var\/www\/owncloud\/lib\/private\/BackgroundJob\/TimedJob.php(53): OC\\BackgroundJob\\Job->execute(Object(OC\\BackgroundJob\\JobList), Object(OC\\Log))\n#12 \/var\/www\/owncloud\/cron.php(122): OC\\BackgroundJob\\TimedJob->execute(Object(OC\\BackgroundJob\\JobList), Object(OC\\Log))\n#13 {main}","File":"\/var\/www\/owncloud\/lib\/private\/Files\/Storage\/Wrapper\/Jail.php","Line":55}

Integrity status for oC9+

No errors have been found.

config.php

<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => '<secret>',
  'passwordsalt' => '<secret>',
  'secret' => '<secret>',
  'trusted_domains' => 
  array (
    0 => <secret>',
    1 => '192.168.1.25',
  ),
  'datadirectory' => '/var/www/owncloud/data',
  'overwrite.cli.url' => 'http://localhost/',
  'dbtype' => 'mysql',
  'version' => '9.1.2.5',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => '<secret>',
  'dbpassword' => '<secret>',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => '<secret>',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => '<secret>',
  'mail_smtpport' => '25',
  'mail_smtpname' => '<secret>',
  'mail_smtppassword' => '<secret>',
  'loglevel' => 0,
  'trashbin_retention_obligation' => 30,
);