Skip to content

Interrupted upload caused orphaned files in uploads/ and exception when attempting clean #31226

@dflogeras

Description

@dflogeras

I'm running owncloud 10.0.7, with php-7.1.16 on Gentoo. The server is configured with nginx + php-fpm, and uses the sqlite backend.

A user was uploading some files which got interrupted. While doing routine maintenance, I noticed that the user had 1.7G of data trapped in the data/USERNAME/uploads/ directory. There are about 10 subfolders named web-file-upload-XYZ/, and all but 1 are empty. The non-empty one has several file chunks in it.

I would like to clean this, but realize that you cannot simply delete the folders. Dumping the database I can see there are references to these specific web-upload folders.

I attempted to run sudo -u nginx php ./occ files:scan MYUSER, but that resulted in an exception, with the following:

The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Starting scan for user 1 out of 1 (MYUSER)
Exception during scan: ErrorException: Undefined index: size
#0 /var/www/localhost/htdocs/owncloud/lib/private/Files/Cache/Scanner.php(420): OCA\Files\Command\Scan->exceptionErrorHandler(8, 'Undefined index...', '/var/www/localh...', 420, Array)
#1 /var/www/localhost/htdocs/owncloud/lib/private/Files/Cache/Scanner.php(381): OC\Files\Cache\Scanner->handleChildren('', true, 3, '1698', true, 0)
#2 /var/www/localhost/htdocs/owncloud/lib/private/Files/Cache/Scanner.php(315): OC\Files\Cache\Scanner->scanChildren('', true, 3, '1698', true)
#3 /var/www/localhost/htdocs/owncloud/lib/private/Files/Utils/Scanner.php(238): OC\Files\Cache\Scanner->scan('', true, 3)
#4 /var/www/localhost/htdocs/owncloud/apps/files/lib/Command/Scan.php(224): OC\Files\Utils\Scanner->scan('/MYUSER', false)
#5 /var/www/localhost/htdocs/owncloud/apps/files/lib/Command/Scan.php(310): OCA\Files\Command\Scan->scanFiles('MYUSER', '/MYUSER', false, Object(Symfony\Component\Console\Output\ConsoleOutput), false, false)
#6 /var/www/localhost/htdocs/owncloud/lib/composer/symfony/console/Command/Command.php(262): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/localhost/htdocs/owncloud/core/Command/Base.php(159): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/localhost/htdocs/owncloud/lib/composer/symfony/console/Application.php(826): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/localhost/htdocs/owncloud/lib/composer/symfony/console/Application.php(189): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/localhost/htdocs/owncloud/lib/composer/symfony/console/Application.php(120): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/localhost/htdocs/owncloud/lib/private/Console/Application.php(161): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/localhost/htdocs/owncloud/console.php(106): OC\Console\Application->run()
#13 /var/www/localhost/htdocs/owncloud/occ(11): require_once('/var/www/localh...')
#14 {main}

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 1 | 1 | 00:00:00 |
+---------+-------+--------------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions