nextcloud / previewgenerator

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

`OCP\Files\NotPermittedException` `Could not create folder` #289

Open st3iny opened 2 years ago

st3iny commented 2 years ago

I had a similar issue with Nextcloud 22.2.4:

2022-02-06T10:01:50+00:00 In Folder.php line 173:
2022-02-06T10:01:50+00:00                                         
2022-02-06T10:01:50+00:00   [OCP\Files\NotPermittedException]     
2022-02-06T10:01:50+00:00   Could not create folder: {$fullPath}  
2022-02-06T10:01:50+00:00                                         
2022-02-06T10:01:50+00:00 
2022-02-06T10:01:50+00:00 Exception trace:
2022-02-06T10:01:50+00:00   at /var/www/html/lib/private/Files/Node/Folder.php:173
2022-02-06T10:01:50+00:00  OC\Files\Node\Folder->newFolder() at /var/www/html/lib/private/Files/AppData/AppData.php:156
2022-02-06T10:01:50+00:00  OC\Files\AppData\AppData->newFolder() at /var/www/html/lib/private/Preview/Storage/Root.php:74
2022-02-06T10:01:50+00:00  OC\Preview\Storage\Root->newFolder() at /var/www/html/lib/private/Preview/Generator.php:472
2022-02-06T10:01:50+00:00  OC\Preview\Generator->getPreviewFolder() at /var/www/html/lib/private/Preview/Generator.php:132
2022-02-06T10:01:50+00:00  OC\Preview\Generator->generatePreviews() at /var/www/html/lib/private/PreviewManager.php:204
2022-02-06T10:01:50+00:00  OC\PreviewManager->generatePreviews() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:243
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->parseFile() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:214
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:212
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:212
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:212
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:183
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->generatePathPreviews() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:131
2022-02-06T10:01:50+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /var/www/html/3rdparty/symfony/console/Command/Command.php:255
2022-02-06T10:01:50+00:00  Symfony\Component\Console\Command\Command->run() at /var/www/html/3rdparty/symfony/console/Application.php:1009
2022-02-06T10:01:50+00:00  Symfony\Component\Console\Application->doRunCommand() at /var/www/html/3rdparty/symfony/console/Application.php:273
2022-02-06T10:01:50+00:00  Symfony\Component\Console\Application->doRun() at /var/www/html/3rdparty/symfony/console/Application.php:149
2022-02-06T10:01:50+00:00  Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:209
2022-02-06T10:01:50+00:00  OC\Console\Application->run() at /var/www/html/console.php:99
2022-02-06T10:01:50+00:00  require_once() at /var/www/html/occ:11

I added a log output in nextcloud/lib/private/Files/Node/Folder.php:173: throw new NotPermittedException('Could not create folder, fullPath: '.$fullPath.', path: '.$path);

After i checked and the folder did exist for me. So to fix this i added a check on the creation if the folder already exists to fix this and changed it to: if (!$this->get($path) || !$this->view->mkdir($fullPath)) { throw new NotPermittedException('Could not create folder, fullPath: '.$fullPath.', path: '.$path); }

Originally posted by @f4t-t0ny in https://github.com/nextcloud/previewgenerator/issues/121#issuecomment-1030803305

skjnldsv commented 2 years ago

Same issue

stratege1401 commented 2 years ago

Fresh install debian 11.3, apapche 2.4.57, mariaDB 10-5-15, php8.0

Same error, connot create folder:

In Folder.php line 173: 2022-03-31T21:07:14+00:00 2022-03-31T21:07:14+00:00 [OCP\Files\NotPermittedException] 2022-03-31T21:07:14+00:00 Could not create folder 2022-03-31T21:07:14+00:00 2022-03-31T21:07:14+00:00 2022-03-31T21:07:14+00:00 Exception trace: 2022-03-31T21:07:14+00:00 at /var/www/html/lib/private/Files/Node/Folder.php:173 2022-03-31T21:07:14+00:00 OC\Files\Node\Folder->newFolder() at /var/www/html/lib/private/Files/AppData/AppData.php:156 2022-03-31T21:07:14+00:00 OC\Files\AppData\AppData->newFolder() at /var/www/html/lib/private/Preview/Storage/Root.php:74 2022-03-31T21:07:14+00:00 OC\Preview\Storage\Root->newFolder() at /var/www/html/lib/private/Preview/Generator.php:472 2022-03-31T21:07:14+00:00 OC\Preview\Generator->getPreviewFolder() at /var/www/html/lib/private/Preview/Generator.php:132 2022-03-31T21:07:14+00:00 OC\Preview\Generator->generatePreviews() at /var/www/html/lib/private/PreviewManager.php:227 2022-03-31T21:07:14+00:00 OC\PreviewManager->generatePreviews() at /var/www/html/apps/previewgenerator/lib/Command/Generate.php:243 2022-03-31T21:07:14+00:00 OCA\PreviewGenerator\Command\Generate->parseFile() at /var/www/html/apps/previewgenerator/lib/Command/Generate.php:214 2022-03-31T21:07:14+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/apps/previewgenerator/lib/Command/Generate.php:212 2022-03-31T21:07:14+00:00 OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/apps/previewgenerator/lib/Command/Generate.php:192 2022-03-31T21:07:14+00:00 OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /var/www/html/apps/previewgenerator/lib/Command/Generate.php:138 2022-03-31T21:07:14+00:00 OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /var/www/html/lib/private/User/Manager.php:656 2022-03-31T21:07:14+00:00 OC\User\Manager->callForSeenUsers() at /var/www/html/apps/previewgenerator/lib/Command/Generate.php:139 2022-03-31T21:07:14+00:00 OCA\PreviewGenerator\Command\Generate->execute() at /var/www/html/3rdparty/symfony/console/Command/Command.php:255 2022-03-31T21:07:14+00:00 Symfony\Component\Console\Command\Command->run() at /var/www/html/3rdparty/symfony/console/Application.php:1009 2022-03-31T21:07:14+00:00 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/3rdparty/symfony/console/Application.php:273 2022-03-31T21:07:14+00:00 Symfony\Component\Console\Application->doRun() at /var/www/html/3rdparty/symfony/console/Application.php:149 2022-03-31T21:07:14+00:00 Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:211 2022-03-31T21:07:14+00:00 OC\Console\Application->run() at /var/www/html/console.php:99 2022-03-31T21:07:14+00:00 require_once() at /var/www/html/occ:11 2022-03-31T21:07:14+00:00 2022-03-31T21:07:14+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>...] 2022-03-31T21:07:14+00:00

stratege1401 commented 2 years ago

The idea of letting the process run to end, and logging the errors is nice...

st3iny commented 2 years ago

@f4t-t0ny @stratege1401 I think I found the problem and developed a patch. The problem is, that I'm not able to reproduce the issue locally. Could you test it for me?

Patch: preview-duplicate-folder-creation.patch.txt

stratege1401 commented 2 years ago

I am ok to test and report... But only tomorrow...

Le mer. 13 avr. 2022 à 18:39, Richard Steinmetz @.***> a écrit :

@f4t-t0ny https://github.com/f4t-t0ny @stratege1401 https://github.com/stratege1401 I think I found the problem and developed a patch. The problem is, that I'm not able to reproduce the issue locally. Could you test it for me?

— Reply to this email directly, view it on GitHub https://github.com/nextcloud/previewgenerator/issues/289#issuecomment-1098263761, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCBCPKLQFENTYNOBX57UETVE32ETANCNFSM5NXBCBBA . You are receiving this because you were mentioned.Message ID: @.***>

emptinessboy commented 2 years ago

I meet the same problem

2022-04-27T12:02:26+00:00 2022-04-27T12:02:26+00:00 In Folder.php line 173: 2022-04-27T12:02:26+00:00
2022-04-27T12:02:26+00:00 Could not create folder
2022-04-27T12:02:26+00:00
2022-04-27T12:02:26+00:00 2022-04-27T12:02:26+00:00 preview:generate-all [-p|--path [PATH]] [--] [...] 2022-04-27T12:02:26+00:00

emptinessboy commented 2 years ago

@f4t-t0ny @stratege1401我想我发现了问题并开发了一个补丁。问题是,我无法在本地重现该问题。你能帮我测试一下吗?

补丁:preview-duplicate-folder-creation.patch.txt

I tried this patch, it works ok now. I am running Nextcloud23.0 with preview plugin 4.0 on CentOS7,php8.

MB-Finski commented 2 years ago

@f4t-t0ny @stratege1401 I think I found the problem and developed a patch. The problem is, that I'm not able to reproduce the issue locally. Could you test it for me?

Patch: preview-duplicate-folder-creation.patch.txt

Can confirm, this patch fixed this issue for me.

st3iny commented 2 years ago

Thanks a lot for testing the patch. I'll submit it upstream.

Blisk commented 2 years ago

I have the same problem, don't know what this patch is and how it is used?

st3iny commented 2 years ago

It is already merged and released. The problem will be fixed if you are using Nextcloud >= 22 and installed the latest update.

Kh3nsu commented 2 years ago

Hello I'm currently running Nextcloud 24.0.1. I got the same error and have installed PreviewGenerator 5.0.0. I applied the patch but still get this error:

https://pastebin.com/GMxbyMZh

rhyst commented 1 year ago

I am using Nextcloud 24.0.6 and 5.0.1 of this app and also get this error when trying to run php occ preview:generate-all. Let me know what logs I could provide to help with this.

Chuckame commented 1 year ago

Same for me, nextcloud 25.0.3 (plugin 5.1.1) and 24.0.5 (forgot to take the version) in docker environment

Chuckame commented 1 year ago

After a full reinstall, i don't have this error anymore

zvarnes commented 1 year ago

I'm running the most recent version of this app, and Nextcloud and still getting this issue...

2023-03-27T01:26:29+00:00 In Folder.php line 166: 2023-03-27T01:26:29+00:00 2023-03-27T01:26:29+00:00 [OCP\Files\NotPermittedException] 2023-03-27T01:26:29+00:00 Could not create folder 2023-03-27T01:26:29+00:00 2023-03-27T01:26:29+00:00 2023-03-27T01:26:29+00:00 Exception trace: 2023-03-27T01:26:29+00:00 at /var/www/nextcloud/lib/private/Files/Node/Folder.php:166 2023-03-27T01:26:29+00:00 OC\Files\Node\Folder->newFolder() at /var/www/nextcloud/lib/private/Files/AppData/AppData.php:147 2023-03-27T01:26:29+00:00 OC\Files\AppData\AppData->newFolder() at /var/www/nextcloud/lib/private/Preview/Storage/Root.php:74 2023-03-27T01:26:29+00:00 OC\Preview\Storage\Root->newFolder() at /var/www/nextcloud/lib/private/Preview/Generator.php:685 2023-03-27T01:26:29+00:00 OC\Preview\Generator->getPreviewFolder() at /var/www/nextcloud/lib/private/Preview/Generator.php:139 2023-03-27T01:26:29+00:00 OC\Preview\Generator->generatePreviews() at /var/www/nextcloud/lib/private/PreviewManager.php:212 2023-03-27T01:26:29+00:00 OC\PreviewManager->generatePreviews() at /var/www/nextcloud/apps/previewgenerator/lib/Command/PreGenerate.php:199 2023-03-27T01:26:29+00:00 OCA\PreviewGenerator\Command\PreGenerate->processFile() at /var/www/nextcloud/apps/previewgenerator/lib/Command/PreGenerate.php:177 2023-03-27T01:26:29+00:00 OCA\PreviewGenerator\Command\PreGenerate->processRow() at /var/www/nextcloud/apps/previewgenerator/lib/Command/PreGenerate.php:145 2023-03-27T01:26:29+00:00 OCA\PreviewGenerator\Command\PreGenerate->startProcessing() at /var/www/nextcloud/apps/previewgenerator/lib/Command/PreGenerate.php:113 2023-03-27T01:26:29+00:00 OCA\PreviewGenerator\Command\PreGenerate->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:255 2023-03-27T01:26:29+00:00 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1009 2023-03-27T01:26:29+00:00 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:273 2023-03-27T01:26:29+00:00 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:149 2023-03-27T01:26:29+00:00 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:215 2023-03-27T01:26:29+00:00 OC\Console\Application->run() at /var/www/nextcloud/console.php:100 2023-03-27T01:26:29+00:00 require_once() at /var/www/nextcloud/occ:11 2023-03-27T01:26:29+00:00 2023-03-27T01:26:29+00:00 preview:pre-generate 2023-03-27T01:26:29+00:00

st3iny commented 1 year ago

@zvarnes Did you apply said patch manually at some point in the past?

zvarnes commented 1 year ago

@st3iny No I did not.

AndyXheli commented 1 year ago

Still an issue on NC 26.0.0

{"reqId":"C9cREwf8AoxLPgLYppzf","level":3,"time":"2023-03-27T21:57:43-05:00","remoteAddr":"1.1.1.1","user":"IT","app":"index","method":"GET","url":"/apps/photos/api/v1/preview/978628?etag=bc17f3e333f5a2b73aaa6d7b095162fd&x=512&y=512","message":"Could not create folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36","version":"26.0.0.11","exception":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/AppData/AppData.php","line":147,"function":"newFolder","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Storage/Root.php","line":74,"function":"newFolder","class":"OC\\Files\\AppData\\AppData","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":685,"function":"newFolder","class":"OC\\Preview\\Storage\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":139,"function":"getPreviewFolder","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":116,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":192,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/apps/photos/lib/Controller/PreviewController.php","line":162,"function":"getPreview","class":"OC\\PreviewManager","type":"->"},{"file":"/var/www/nextcloud/apps/photos/lib/Controller/PreviewController.php","line":128,"function":"fetchPreview","class":"OCA\\Photos\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"index","class":"OCA\\Photos\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1055,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","Line":166,"CustomMessage":"--"},"id":"642350c51ba48"}
CorneliousJD commented 1 year ago

I just installed this app and am seeing the same issue running docker exec -u www-data Nextcloud ./occ preview:generate-all -vvv

2023-04-18T18:56:38+00:00 
2023-04-18T18:56:38+00:00 In Folder.php line 166:
2023-04-18T18:56:38+00:00                                      
2023-04-18T18:56:38+00:00   [OCP\Files\NotPermittedException]  
2023-04-18T18:56:38+00:00   Could not create folder            
2023-04-18T18:56:38+00:00                                      
2023-04-18T18:56:38+00:00 
2023-04-18T18:56:38+00:00 Exception trace:
2023-04-18T18:56:38+00:00   at /var/www/html/lib/private/Files/Node/Folder.php:166
2023-04-18T18:56:38+00:00  OC\Files\Node\Folder->newFolder() at /var/www/html/lib/private/Files/AppData/AppData.php:147
2023-04-18T18:56:38+00:00  OC\Files\AppData\AppData->newFolder() at /var/www/html/lib/private/Preview/Storage/Root.php:74
2023-04-18T18:56:38+00:00  OC\Preview\Storage\Root->newFolder() at /var/www/html/lib/private/Preview/Generator.php:685
2023-04-18T18:56:38+00:00  OC\Preview\Generator->getPreviewFolder() at /var/www/html/lib/private/Preview/Generator.php:139
2023-04-18T18:56:38+00:00  OC\Preview\Generator->generatePreviews() at /var/www/html/lib/private/PreviewManager.php:212
2023-04-18T18:56:38+00:00  OC\PreviewManager->generatePreviews() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:230
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->parseFile() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:212
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:210
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:210
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:210
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:190
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:136
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /var/www/html/lib/private/User/Manager.php:639
2023-04-18T18:56:38+00:00  OC\User\Manager->callForSeenUsers() at /var/www/html/custom_apps/previewgenerator/lib/Command/Generate.php:137
2023-04-18T18:56:38+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /var/www/html/custom_apps/recognize/vendor/symfony/console/Command/Command.php:298
2023-04-18T18:56:38+00:00  Symfony\Component\Console\Command\Command->run() at /var/www/html/custom_apps/recognize/vendor/symfony/console/Application.php:1040
2023-04-18T18:56:38+00:00  Symfony\Component\Console\Application->doRunCommand() at /var/www/html/custom_apps/recognize/vendor/symfony/console/Application.php:301
2023-04-18T18:56:38+00:00  Symfony\Component\Console\Application->doRun() at /var/www/html/custom_apps/recognize/vendor/symfony/console/Application.php:171
2023-04-18T18:56:38+00:00  Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:215
2023-04-18T18:56:38+00:00  OC\Console\Application->run() at /var/www/html/console.php:100
2023-04-18T18:56:38+00:00  require_once() at /var/www/html/occ:11
2023-04-18T18:56:38+00:00 
2023-04-18T18:56:38+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>...]
2023-04-18T18:56:38+00:00 
krlls commented 1 year ago

Same issue: NextCloud: 26.0.1 (Docker) PreviewGenerator: 5.2.4

CorneliousJD commented 1 year ago

I eventually kept running it over and over and it finished successfully.

arcoast commented 1 year ago

I'm also seeing this on v5.2.4 on Nextcloud v26.0.0

Running occ preview:generate-all -vvv

2023-05-01T17:20:10+00:00 
2023-05-01T17:20:10+00:00 In Folder.php line 166:
2023-05-01T17:20:10+00:00                                      
2023-05-01T17:20:10+00:00   [OCP\Files\NotPermittedException]  
2023-05-01T17:20:10+00:00   Could not create folder            
2023-05-01T17:20:10+00:00                                      
2023-05-01T17:20:10+00:00 
2023-05-01T17:20:10+00:00 Exception trace:
2023-05-01T17:20:10+00:00   at /config/www/nextcloud/lib/private/Files/Node/Folder.php:166
2023-05-01T17:20:10+00:00  OC\Files\Node\Folder->newFolder() at /config/www/nextcloud/lib/private/Files/AppData/AppData.php:147
2023-05-01T17:20:10+00:00  OC\Files\AppData\AppData->newFolder() at /config/www/nextcloud/lib/private/Preview/Storage/Root.php:74
2023-05-01T17:20:10+00:00  OC\Preview\Storage\Root->newFolder() at /config/www/nextcloud/lib/private/Preview/Generator.php:685
2023-05-01T17:20:10+00:00  OC\Preview\Generator->getPreviewFolder() at /config/www/nextcloud/lib/private/Preview/Generator.php:139
2023-05-01T17:20:10+00:00  OC\Preview\Generator->generatePreviews() at /config/www/nextcloud/lib/private/PreviewManager.php:212
2023-05-01T17:20:10+00:00  OC\PreviewManager->generatePreviews() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:230
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->parseFile() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:212
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:190
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:136
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /config/www/nextcloud/lib/private/User/Manager.php:639
2023-05-01T17:20:10+00:00  OC\User\Manager->callForSeenUsers() at /config/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:137
2023-05-01T17:20:10+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /config/www/nextcloud/3rdparty/symfony/console/Command/Command.php:255
2023-05-01T17:20:10+00:00  Symfony\Component\Console\Command\Command->run() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:1009
2023-05-01T17:20:10+00:00  Symfony\Component\Console\Application->doRunCommand() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:273
2023-05-01T17:20:10+00:00  Symfony\Component\Console\Application->doRun() at /config/www/nextcloud/3rdparty/symfony/console/Application.php:149
2023-05-01T17:20:10+00:00  Symfony\Component\Console\Application->run() at /config/www/nextcloud/lib/private/Console/Application.php:215
2023-05-01T17:20:10+00:00  OC\Console\Application->run() at /config/www/nextcloud/console.php:100
2023-05-01T17:20:10+00:00  require_once() at /config/www/nextcloud/occ:11
2023-05-01T17:20:10+00:00 
2023-05-01T17:20:10+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>...]
2023-05-01T17:20:10+00:00 
arcoast commented 1 year ago

Just to update, I ran the scan for each user separately and it seems to have done the trick and I can't reproduce the above any longer.

zvarnes commented 1 year ago

Still getting this error on version 26.0.1

SchoolGuy commented 1 year ago

I was able to trigger this bug with executing two preview:generate-all in parallel on accident.

NC 26.0.2 and Preview Generator 5.3.0

zvarnes commented 11 months ago

Still getting this error on 27.0.1. Where can I confirm your patch backport was successful? @st3iny

Well apparently it's fixed in 27.0.2 😐

I've done more testing, and I think just rescanning the files would help get ride of the error that was showing up. I ran this on a loop until the error went away. while true; do sudo -u www-data php /var/www/nextcloud/occ files:scan-app-data && sudo -u www-data php /var/www/nextcloud/occ preview:generate-all; done

maxkratz commented 9 months ago

This issue also occurs on my Nextcloud instance (v25.0.12). Is there any ETA for a fix?

JOHLC commented 8 months ago

I am also seeing this. Installation: Nextcloud VM Nextcloud version: 27.1.3 Preview generator version: 5.3.0

It seems to get through 974 files/folders or more before erroring out, and seems to always be on the same folder. A reinstall of the app didn't resolve it.

sudo -u www-data php /var/www/nextcloud/occ preview:generate-all

[...]

2023-11-22T03:08:01+00:00 Generating previews for /User/files/User/Pictures/Graphics/DC Pictures/GEDC0607.JPG
2023-11-22T03:08:01+00:00 
2023-11-22T03:08:01+00:00 In Folder.php line 162:
2023-11-22T03:08:01+00:00                                                                                 
2023-11-22T03:08:01+00:00   [OCP\Files\NotPermittedException]                                             
2023-11-22T03:08:01+00:00   Could not create folder "/appdata_ockpphbbu4qb/preview/6/9/0/5/c/3/3/867860"  
2023-11-22T03:08:01+00:00                                                                                 
2023-11-22T03:08:01+00:00 
2023-11-22T03:08:01+00:00 Exception trace:
2023-11-22T03:08:01+00:00   at /var/www/nextcloud/lib/private/Files/Node/Folder.php:162
2023-11-22T03:08:01+00:00  OC\Files\Node\Folder->newFolder() at /var/www/nextcloud/lib/private/Files/AppData/AppData.php:147
2023-11-22T03:08:01+00:00  OC\Files\AppData\AppData->newFolder() at /var/www/nextcloud/lib/private/Preview/Storage/Root.php:74
2023-11-22T03:08:01+00:00  OC\Preview\Storage\Root->newFolder() at /var/www/nextcloud/lib/private/Preview/Generator.php:607
2023-11-22T03:08:01+00:00  OC\Preview\Generator->getPreviewFolder() at /var/www/nextcloud/lib/private/Preview/Generator.php:139
2023-11-22T03:08:01+00:00  OC\Preview\Generator->generatePreviews() at /var/www/nextcloud/lib/private/PreviewManager.php:212
2023-11-22T03:08:01+00:00  OC\PreviewManager->generatePreviews() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:230
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->parseFile() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:212
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:210
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->parseFolder() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:190
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->generateUserPreviews() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:136
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->OCA\PreviewGenerator\Command\{closure}() at /var/www/nextcloud/lib/private/User/Manager.php:632
2023-11-22T03:08:01+00:00  OC\User\Manager->callForSeenUsers() at /var/www/nextcloud/apps/previewgenerator/lib/Command/Generate.php:137
2023-11-22T03:08:01+00:00  OCA\PreviewGenerator\Command\Generate->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:298
2023-11-22T03:08:01+00:00  Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1040
2023-11-22T03:08:01+00:00  Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:301
2023-11-22T03:08:01+00:00  Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:171
2023-11-22T03:08:01+00:00  Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:211
2023-11-22T03:08:01+00:00  OC\Console\Application->run() at /var/www/nextcloud/console.php:100
2023-11-22T03:08:01+00:00  require_once() at /var/www/nextcloud/occ:11
2023-11-22T03:08:01+00:00 
2023-11-22T03:08:01+00:00 preview:generate-all [-p|--path [PATH]] [--] [<user_id>...]
2023-11-22T03:08:01+00:00 
njchristoffersen commented 6 months ago

Installation: Nextcloud AIO via docker Version: Nextcloud Hub 6 (27.1.4) all commands below have been prepended with docker exec -u 33 -it nextcloud-aio-nextcloud, but I left that out for simplicity

I am seeing the same thing:

In Folder.php line 162:
...
Could not create folder "/appdata_ocmqi08lafyh/preview/6/6/3/f/a/6/5/84785"

My best guess is that this happens when it gets to photos that have already generated previews for (as my process ran for about 120GiB worth of photos without errors, but then when it got to ones that I have accessed before in browser and on my phone, it spit the error).

Steps Attempted:

Scan Files (returns same error in same location)

php occ files:scan --all
php occ preview:generate-all

Scan App Data (same error but later on, so more previews were successfully generated)

php occ files:scan-app-data
php occ preview:generate-all
Mat-DB commented 6 months ago

I have the same error on NC28.0.1 and the preview generator app just installed and run number 3 I think.

What is the difference between the following?

php occ preview:generate-all
php occ preview:generate --all
njchristoffersen commented 6 months ago

The first is a correct command, the second is a typo that I made. Thank you for catching that and I've edited my previous comment accordingly.

joshtrichards commented 3 months ago

I think this may be nextcloud/server#36463 which was just fixed in nextcloud/server#41067 (Server v27.1.7 and v28.0.3 have the fix).

chrisborell commented 1 month ago

Still occuring for me in [Nextcloud Hub 8] (29.0.2)

Screenshot 2024-06-20 at 10 09 39 am