Closed mecpcanada closed 7 months ago
Solution: Deactivate App, Uninstall App, Install App again. Then run: preview:generate-all -vvv
tried it twice same result
This may help: occ files:scan-app-data
Check out the I want to reset/regenerate all previews section from readme.
It looks like I have the same problem.
If I run:
preview:generate-all -vvv
I got this error and end of the process:
2023-08-04T09:57:28+00:00 In File.php line 56:
2023-08-04T09:57:28+00:00
2023-08-04T09:57:28+00:00 [OCP\Files\GenericFileException]
2023-08-04T09:57:28+00:00
2023-08-04T09:57:28+00:00
2023-08-04T09:57:28+00:00 Exception trace:
2023-08-04T09:57:28+00:00 at /var/www/nextcloud/lib/private/Files/Node/File.php:56
2023-08-04T09:57:28+00:00 OC\Files\Node\File->getContent() at /var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php:74
2023-08-04T09:57:28+00:00 OC\Files\SimpleFS\SimpleFile->getContent() at /var/www/nextcloud/lib/private/Preview/GeneratorHelper.php:73
2023-08-04T09:57:28+00:00 OC\Preview\GeneratorHelper->getImage() at /var/www/nextcloud/lib/private/Preview/Generator.php:213
2023-08-04T09:57:28+00:00 OC\Preview\Generator->generatePreviews() at /var/www/nextcloud/lib/private/PreviewManager.php:212
2023-08-04T09:57:28+00:00 OC\PreviewManager->generatePreviews() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:230
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->parseFile() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:212
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:190
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:136
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /var/www/nextcloud/lib/private/User/Manager.php:632
2023-08-04T09:57:28+00:00 OC\User\Manager->callForSeenUsers() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:135
2023-08-04T09:57:28+00:00 OCA\PreviewGenerator\Command\Generate->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:298
2023-08-04T09:57:28+00:00 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1040
2023-08-04T09:57:28+00:00 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:301
2023-08-04T09:57:28+00:00 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:171
2023-08-04T09:57:28+00:00 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:211
2023-08-04T09:57:28+00:00 OC\Console\Application->run() at /var/www/nextcloud/console.php:100
2023-08-04T09:57:28+00:00 require_once() at /var/www/nextcloud/occ:11
2023-08-04T09:57:28+00:00
2023-08-04T09:57:28+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>...]
I followed this guide, to install some additional packages (Ubuntu server 22.04)
And Deactivate App, Uninstall App, Install App again and executed:
occ files:scan-app-data
But still cannot finisch the preview generation. It always ends in the same directory: In this case: InstantUpload/Camera/2022/03 When I touch .nomedia I can skip this folder, but a little bit later it ends again in another folder. I even tried to fix some file names removing spaces, but that is not a solution. ;(
Can you help to find a real solution?
I guess the cause is that the DB contains some file records that do not actually exist in the file system. If that is true, you can clean up the existing preview files and the records in DB and regenerate all the previews.
sudo rm -rf /var/www/nextcloud/data/appdata_[$instanceId]/preview/*
sudo mysql
USE nextcloud;
DELETE FROM oc_filecache WHERE path LIKE "appdata\_[$instanceId]/preview/%";
occ preview:generate-all -vvv
If the problem persists, maybe you can provide the error log generated by nextcloud (located at /var/www/nextcloud/data/nextcloud.log
).
Thank you @joeywang4 Would it not been fixed with:
sudo -u www-data php occ files:scan-app-data
usually ensures the AppData folder is consistent with the records in DB, but I encountered this problem before and that command didn't seem to work (not sure though).
Still, you should check the nextcloud log to figure out the real cause of your problem.
@joeywang4 Thank you! I've just deleted appdata[$instanceId]/preview/ from data folder, and deleted appdata\[$instanceId]/preview/% in oc-filecache. I "occ files:scan --all" first, and know previews are generated. Fingers crossed. Edit: That worked. Thank you @joeywang4
I had the same issue.
DELETE FROM oc_filecache WHERE path LIKE "appdata\_[$instanceId]/preview/%";
did the trick for me also
sudo -u www-data php occ files:scan-app-data
usually ensures the AppData folder is consistent with the records in DB, but I encountered this problem before and that command didn't seem to work (not sure though).Still, you should check the nextcloud log to figure out the real cause of your problem.
This fixed the GenericFileException for me, thanks.
Rescanning and/or deleting all previews should help.
I'm closing this issue as it seems to be resolved.
hi preview generation ran for the first time but had to stop it after 15 days as it was taking too long now when i try to run it again i get In File.php line 56: 2023-07-17T12:29:23+00:00 2023-07-17T12:29:23+00:00 [OCP\Files\GenericFileException] 2023-07-17T12:29:23+00:00 2023-07-17T12:29:23+00:00 2023-07-17T12:29:23+00:00 preview:generate-all [-p|--path [PATH]] [--] [...]
tried it with next cloud 26 and 27