nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
455 stars 57 forks source link

occ preview:generate-all fails to generate previews for paths with whitespaces #403

Closed SeanGaia closed 1 year ago

SeanGaia commented 1 year ago

Versions: NC 27.0.0, previewgenerator 5.3.0

Executing occ preview:generate-all produces GenericFileException for paths with whitespaces:

2023-07-07T01:23:45+00:00 In File.php line 56:
2023-07-07T01:23:45+00:00
2023-07-07T01:23:45+00:00   [OCP\Files\GenericFileException]
2023-07-07T01:23:45+00:00
2023-07-07T01:23:45+00:00
2023-07-07T01:23:45+00:00 Exception trace:
2023-07-07T01:23:45+00:00   at /config/www/nextcloud/lib/private/Files/Node/File.php:56
2023-07-07T01:23:45+00:00  OC\Files\Node\File->getContent() at /config/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php:74
2023-07-07T01:23:45+00:00  OC\Files\SimpleFS\SimpleFile->getContent() at /config/www/nextcloud/lib/private/Preview/GeneratorHelper.php:73
2023-07-07T01:23:45+00:00  OC\Preview\GeneratorHelper->getImage() at /config/www/nextcloud/lib/private/Preview/Generator.php:213
2023-07-07T01:23:45+00:00  OC\Preview\Generator->generatePreviews() at /config/www/nextcloud/lib/private/PreviewManager.php:212
2023-07-07T01:23:45+00:00  OC\PreviewManager->generatePreviews() at /config/www/nextcloud/userapps/previewgenerator/lib/Command/Generate.php:230
2023-07-07T01:23:45+00:00  OCA\PreviewGenerator\Command\Generate->parseFile() at /config/www/nextcloud/userapps/previewgenerator/lib/Command/Generate.php:212
2023-07-07T01:23:45+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/userapps/previewgenerator/lib/Command/Generate.php:210
2023-07-07T01:23:45+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/userapps/previewgenerator/lib/Command/Generate.php:190
2023-07-07T01:23:45+00:00  OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /config/www/nextcloud/userapps/previewgenerator/lib/Command/Generate.php:136
2023-07-07T01:23:45+00:00  OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /config/www/nextcloud/lib/private/User/Manager.php:632
2023-07-07T01:23:45+00:00  OC\User\Manager->callForSeenUsers() at /config/www/nextcloud/userapps/previewgenerator/lib/Command/Generate.php:137
2023-07-07T01:23:45+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php:298
2023-07-07T01:23:45+00:00  Symfony\Component\Console\Command\Command->run() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:1040
2023-07-07T01:23:45+00:00  Symfony\Component\Console\Application->doRunCommand() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:301
2023-07-07T01:23:45+00:00  Symfony\Component\Console\Application->doRun() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:171
2023-07-07T01:23:45+00:00  Symfony\Component\Console\Application->run() at /config/www/nextcloud/lib/private/Console/Application.php:211
2023-07-07T01:23:45+00:00  OC\Console\Application->run() at /config/www/nextcloud/console.php:100
2023-07-07T01:23:45+00:00  require_once() at /config/www/nextcloud/occ:11

It falls over fetching the FileInfo, specifically on files with whitespaces in the path. I've tested it on single files to confirm this. For context: I'm regenerating the previews after a system backup, where I exclude previews from being uploaded.

SeanGaia commented 1 year ago

Closing this as I'm getting inconsistent results.