nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
516 stars 59 forks source link

OCP\Files\NotPermittedException: Could not create folder #1498

Open AndyXheli opened 1 year ago

AndyXheli commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

Upgraded to NC25.0.1 RC1 from NC 24.0.6

Steps to reproduce

Upgraded to NC 25.0.1 RC1

Expected behavior

Should not show the error

It was suppose to ge fixed by https://github.com/nextcloud/server/pull/34543

Installation method

Community Manual installation with Archive

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

Na

List of activated Apps

Na

Nextcloud Signing status

No response

Nextcloud Logs

{"reqId":"TMod8jonQTy9dGEggrnp","level":3,"time":"2022-10-27T15:39:51-05:00","remoteAddr":"66.158.36.34","user":"axheli","app":"index","method":"GET","url":"/apps/theming/img/core/filetypes/image.svg?v=21","message":"Could not create folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","version":"25.0.1.0","exception":{"Exception":"OCP\Files\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":106,"function":"newFolder","class":"OC\Files\Node\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ImageManager.php","line":165,"function":"newFolder","class":"OC\Files\SimpleFS\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/ImageManager.php","line":180,"function":"getCacheFolder","class":"OCA\Theming\ImageManager","type":"->"},{"file":"/var/www/nextcloud/apps/theming/lib/Controller/IconController.php","line":90,"function":"getCachedImage","class":"OCA\Theming\ImageManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"getThemedIcon","class":"OCA\Theming\Controller\IconController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"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":165,"CustomMessage":"--"},"id":"635aed9472be6"}

Additional info

No response

Pytal commented 1 year ago

Can't reproduce but going by the exception trace

[
  {
    "file": "/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php",
    "line": 106,
    "function": "newFolder",
    "class": "OCFilesNodeFolder",
    "type": "->"
  },
  {
    "file": "/var/www/nextcloud/apps/theming/lib/ImageManager.php",
    "line": 165,
    "function": "newFolder",
    "class": "OCFilesSimpleFSSimpleFolder",
    "type": "->"
  },
  {
    "file": "/var/www/nextcloud/apps/theming/lib/ImageManager.php",
    "line": 180,
    "function": "getCacheFolder",
    "class": "OCAThemingImageManager",
    "type": "->"
  },
  // ...
]

The related code was most recently changed in https://github.com/nextcloud/server/commit/e4ff84d468acf3c0e2d497412b7192651bbd4e23#diff-87af58077888f9b1c961e33eaa933010033b1a3cf494fe9470943a5d8f9d44f7R106

Ideas on the error @skjnldsv?

Shamar commented 1 year ago

Same issue here, while installing a minimal NextCloud instance on a OVH shared hosting.

The Web Installer seemed working fine until the end but after the installation completed, the UI lacks most of CSS (curiously, without much errors in the Network panel). To be honest, such minimalist style is quite amusing (I'm honest here, no kidding, I love minimalist UIs with text only), but unfortunately unusable because most of the VUE ui falls outside the viewport and there are no scrolls; moreover menus have no opaque backgrounds, so that when you expand a menu its text overlaps with the text already present in the page.

This made me realize that a minimal usable theme should be shipped with NextCloud bundle (or at least the current default theme). Indeed we could install NextCloud on a local network closed to the Internet and the install bundle should be self-contained and usable.

As an alternative, if you consider such use case too... "edgy", I suggest to proper document manual installation of a theme (so that one could even workaround the current installation bug).

And by the way... thanks for this great piece of software!

AndyXheli commented 1 year ago

Just got another one

AndyXheli commented 1 year ago

Just got another one

{"reqId":"V8uQqXWq6qlhnaoGaxct","level":3,"time":"2022-11-03T13:26:23-05:00","remoteAddr":"X.X.X.X","user":"admin","app":"index","method":"GET","url":"/apps/photos/api/v1/preview/704672?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/107.0.0.0 Safari/537.36","version":"25.0.1.1","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":581,"function":"newFolder","class":"OC\Preview\Storage\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":137,"function":"getPreviewFolder","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":114,"function":"generatePreviews","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":185,"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":225,"function":"index","class":"OCA\Photos\Controller\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"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":165,"CustomMessage":"--"},"id":"636408dd77fb9"}

Lelo5657 commented 1 year ago

Same here:

[index] Fehler: OCP\Files\NotPermittedException: Could not create folder at <<closure>>

 0. /config/www/nextcloud/lib/private/Files/AppData/AppData.php line 147
    OC\Files\Node\Folder->newFolder()
 1. /config/www/nextcloud/lib/private/Preview/Storage/Root.php line 74
    OC\Files\AppData\AppData->newFolder()
 2. /config/www/nextcloud/lib/private/Preview/Generator.php line 581
    OC\Preview\Storage\Root->newFolder()
 3. /config/www/nextcloud/lib/private/Preview/Generator.php line 137
    OC\Preview\Generator->getPreviewFolder()
 4. /config/www/nextcloud/lib/private/Preview/Generator.php line 114
    OC\Preview\Generator->generatePreviews()
 5. /config/www/nextcloud/lib/private/PreviewManager.php line 185
    OC\Preview\Generator->getPreview()
 6. /config/www/nextcloud/apps/photos/lib/Controller/PreviewController.php line 162
    OC\PreviewManager->getPreview()
 7. /config/www/nextcloud/apps/photos/lib/Controller/PreviewController.php line 128
    OCA\Photos\Controller\PreviewController->fetchPreview()
 8. /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Photos\Controller\PreviewController->index()
 9. /config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
10. /config/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
11. /config/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
12. /config/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
13. /config/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /apps/photos/api/v1/preview/68165?x=512&y=512
Wizlonex commented 1 year ago

Hi: I too am seeing this error - in my case, I am trying to view the contents of folders created under "people" in Photos 2.0, and this error pops up occasionally. The only reason I notice is because the recognize feature as a whole is throwing multiple errors for me and I am trying to track the issues down. I have facial recognition DISABLED right now (since it just doesn't work reliably for me - it's slow and is freezing my browser), but rhe folders it did create are still visible and are changing as I try to access them. My logs are showing multiple entries of this:

{"reqId":"UYuxpuqE5waVjYHEmoRr","level":3,"time":"2022-11-06T19:50:57+00:00","remoteAddr":"10.25.231.101","user":"Andrew","app":"index","method":"GET","url":"/index.php/apps/photos/api/v1/preview/6741?x=512&y=512","message":"Could not create folder","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","version":"25.0.1.1","exception":{"Exception":"OCP\Files\NotPermittedException","Message":"Could not create folder","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/AppData/AppData.php","line":147,"function":"newFolder","class":"OC\Files\Node\Folder","type":"->"},{"file":"/var/www/html/lib/private/Preview/Storage/Root.php","line":74,"function":"newFolder","class":"OC\Files\AppData\AppData","type":"->"},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":581,"function":"newFolder","class":"OC\Preview\Storage\Root","type":"->"},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":137,"function":"getPreviewFolder","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":114,"function":"generatePreviews","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/html/lib/private/PreviewManager.php","line":185,"function":"getPreview","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/html/apps/photos/lib/Controller/PreviewController.php","line":162,"function":"getPreview","class":"OC\PreviewManager","type":"->"},{"file":"/var/www/html/apps/photos/lib/Controller/PreviewController.php","line":128,"function":"fetchPreview","class":"OCA\Photos\Controller\PreviewController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"index","class":"OCA\Photos\Controller\PreviewController","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":1047,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/lib/private/Files/Node/Folder.php","Line":165,"CustomMessage":"--"},"id":"6368106026c84"}

I have double checked www-data ownership of all my directories, and I have rescanned files.

Interestingly, in my case, when I click on the "people" folders (even though I have now turned the feature OFF in settings), the folders are shown but cliking on them does nothing in my browser. However, right-clicking and open-in-new-tab shows me contents, and from time to time, this is where I see these log entries appear.

I wish I could nail it down more and be more helpful, but I want to at least report it as I note I am not the only one seeing this error.

I have failed to get Recognize to work in any of my dev systems:

Ubuntu 20.04 / lxc container Ubintu 22.04 / lxc vm

THANK YOU for the awesome Nextcloud!

Andrew

DPF0 commented 1 year ago

Hi, I'm having the same issue. This is a Nextcloud VM running on Proxmox 7.3, recently updated to 25.0.1.

[index] Error: OCP\Files\NotPermittedException: Could not create folder at <>

  1. /var/www/nextcloud/lib/private/Files/AppData/AppData.php line 147 OC\Files\Node\Folder->newFolder()
  2. /var/www/nextcloud/lib/private/Preview/Storage/Root.php line 74 OC\Files\AppData\AppData->newFolder()
  3. /var/www/nextcloud/lib/private/Preview/Generator.php line 581 OC\Preview\Storage\Root->newFolder()
  4. /var/www/nextcloud/lib/private/Preview/Generator.php line 137 OC\Preview\Generator->getPreviewFolder()
  5. /var/www/nextcloud/lib/private/Preview/Generator.php line 114 OC\Preview\Generator->generatePreviews()
  6. /var/www/nextcloud/lib/private/PreviewManager.php line 185 OC\Preview\Generator->getPreview()
  7. /var/www/nextcloud/apps/photos/lib/Controller/PreviewController.php line 162 OC\PreviewManager->getPreview()
  8. /var/www/nextcloud/apps/photos/lib/Controller/PreviewController.php line 128 OCA\Photos\Controller\PreviewController->fetchPreview()
  9. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225 OCA\Photos\Controller\PreviewController->index()
  10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133 OC\AppFramework\Http\Dispatcher->executeController()
    1. /var/www/nextcloud/lib/private/AppFramework/App.php line 172 OC\AppFramework\Http\Dispatcher->dispatch()
    2. /var/www/nextcloud/lib/private/Route/Router.php line 298 OC\AppFramework\App::main()
    3. /var/www/nextcloud/lib/base.php line 1047 OC\Route\Router->match()
    4. /var/www/nextcloud/index.php line 36 OC::handleRequest()

GET /apps/photos/api/v1/preview/101921?x=512&y=512

Please let me know if there is any useful information I can provide, and thank you for the wonderful product Nextcloud is.

David

Ramalama2 commented 1 year ago

Same here:

[index] Fehler: OCP\Files\NotPermittedException: Could not create folder at <<closure>>

 0. /var/www/html/lib/private/Files/AppData/AppData.php line 147
    OC\Files\Node\Folder->newFolder("8/f/3/c/7/7/1/1002930")
 1. /var/www/html/lib/private/Preview/Storage/Root.php line 74
    OC\Files\AppData\AppData->newFolder("8/f/3/c/7/7/1/1002930")
 2. /var/www/html/lib/private/Preview/Generator.php line 581
    OC\Preview\Storage\Root->newFolder("1002930")
 3. /var/www/html/lib/private/Preview/Generator.php line 137
    OC\Preview\Generator->getPreviewFolder(OC\Files\Node\File {})
 4. /var/www/html/lib/private/Preview/Generator.php line 114
    OC\Preview\Generator->generatePreviews(OC\Files\Node\File {}, [[512,512,false,"fill"]], "image/jpeg")
 5. /var/www/html/lib/private/PreviewManager.php line 185
    OC\Preview\Generator->getPreview(OC\Files\Node\File {}, 512, 512, false, "fill", null)
 6. /var/www/html/apps/photos/lib/Controller/PreviewController.php line 162
    OC\PreviewManager->getPreview(OC\Files\Node\File {}, 512, 512)
 7. /var/www/html/apps/photos/lib/Controller/PreviewController.php line 128
    OCA\Photos\Controller\PreviewController->fetchPreview(OC\Files\Node\File {}, 512, 512)
 8. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Photos\Controller\PreviewController->index(1002930, 512, 512)
 9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Photos\Contr ... {}, "index")
10. /var/www/html/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Photos\Contr ... {}, "index")
11. /var/www/html/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main("OCA\\Photos\\Co ... r", "index", OC\AppFramework\ ... {}, ["1002930","photos.preview.index"])
12. /var/www/html/lib/base.php line 1047
    OC\Route\Router->match("/apps/photos/api/v1/preview/1002930")
13. /var/www/html/index.php line 36
    OC::handleRequest()

GET /apps/photos/api/v1/preview/1002930?x=512&y=512
from 79.261.282.22 by rama at 2022-11-29T17:26:11+00:00
Schmidtjanroman commented 1 year ago

Same issue on my NC, hava a clean and new instance with all new setutp, done with c-riegers installation script.

{"reqId":"fhoMtiZElgNRQB1cGTb6","level":3,"time":"2022-12-02T09:10:53+01:00","remoteAddr":"217.249.8.103","user":"jan","app":"index","method":"GET","url":"/apps/photos/api/v1/preview/66185?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/107.0.0.0 Safari/537.36","version":"25.0.1.1","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":581,"function":"newFolder","class":"OC\Preview\Storage\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":137,"function":"getPreviewFolder","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":114,"function":"generatePreviews","class":"OC\Preview\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":185,"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":225,"function":"index","class":"OCA\Photos\Controller\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"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":165,"CustomMessage":"--"},"id":"6389b45086970"}

dreua commented 1 year ago

I'm not sure more stacktraces is what this issue needs :thinking:

Shamar commented 1 year ago

I can add that after moving to phpcgi, disabling PHP-FPM and OPCache, everything worked fine.

I'm sorry, but I couldn't find the time to report this info here before or to further investigate it. :-( My insight was that during installation, some cache was saved too early and somewhat broken.

Basically good old root of all evils...

Hope this helps, anyway.

AndyXheli commented 1 year ago

Still an issue on NC 25.0.3

{"reqId":"3lGsUf8YPGTPUNqD7yoG","level":3,"time":"2023-01-17T11:11:34-06:00","remoteAddr":"1.1.1.1","user":"admin","app":"index","method":"GET","url":"/apps/photos/api/v1/preview/18439?x=64&y=64","message":"Could not create folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","version":"25.0.3.2","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":581,"function":"newFolder","class":"OC\\Preview\\Storage\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":137,"function":"getPreviewFolder","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":114,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":185,"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":225,"function":"index","class":"OCA\\Photos\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"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":"63c8643f56ec6"}

{"reqId":"WugXAANnIJgsizd1lxed","level":3,"time":"2023-01-17T11:11:33-06:00","remoteAddr":"1.1.1.1","user":"admin","app":"index","method":"GET","url":"/apps/photos/api/v1/preview/18664?x=64&y=64","message":"Could not create folder","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","version":"25.0.3.2","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":581,"function":"newFolder","class":"OC\\Preview\\Storage\\Root","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":137,"function":"getPreviewFolder","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":114,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":185,"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":225,"function":"index","class":"OCA\\Photos\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"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":"63c8643f56f0b"}
Tom60chat commented 1 year ago

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/manual_upgrade.html https://help.nextcloud.com/t/how-to-clean-up-nextcloud-data-appdata-and-updater/123746/7?u=tom60 Help me solve this problem.

Juste renew the Nextcloud installation, don't forget to renew permission (12. Adjust file ownership and permissions:) and upgrade command. And scan all file and appdata file

I did do a occ maintenance:repaire too

AndyXheli commented 1 year ago

Still present on 25.0.4 RC1

tim-gong commented 1 year ago

Anybody got solution for this issue?

adrhc commented 1 year ago
{
    "reqId": "YxQB0tnZ44LzGkZJV9ms",
    "level": 3,
    "time": "2023-03-28T20:38:27+03:00",
    "remoteAddr": "192.168.1.161",
    "user": "gigi",
    "app": "index",
    "method": "GET",
    "url": "/nextcloud/index.php/core/preview?forceIcon=0&a=0&x=250&y=250&c=313bae8135337b74df9c7f27b9630788&fileId=7280",
    "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": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Files/AppData/AppData.php",
                "line": 147,
                "function": "newFolder",
                "class": "OC\\Files\\Node\\Folder",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Preview/Storage/Root.php",
                "line": 74,
                "function": "newFolder",
                "class": "OC\\Files\\AppData\\AppData",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Preview/Generator.php",
                "line": 685,
                "function": "newFolder",
                "class": "OC\\Preview\\Storage\\Root",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Preview/Generator.php",
                "line": 139,
                "function": "getPreviewFolder",
                "class": "OC\\Preview\\Generator",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Preview/Generator.php",
                "line": 116,
                "function": "generatePreviews",
                "class": "OC\\Preview\\Generator",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/PreviewManager.php",
                "line": 192,
                "function": "getPreview",
                "class": "OC\\Preview\\Generator",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/core/Controller/PreviewController.php",
                "line": 144,
                "function": "getPreview",
                "class": "OC\\PreviewManager",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/core/Controller/PreviewController.php",
                "line": 113,
                "function": "fetchPreview",
                "class": "OC\\Core\\Controller\\PreviewController",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 230,
                "function": "getPreviewByFileId",
                "class": "OC\\Core\\Controller\\PreviewController",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "line": 137,
                "function": "executeController",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/AppFramework/App.php",
                "line": 183,
                "function": "dispatch",
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Route/Router.php",
                "line": 315,
                "function": "main",
                "class": "OC\\AppFramework\\App",
                "type": "::"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/lib/base.php",
                "line": 1055,
                "function": "match",
                "class": "OC\\Route\\Router",
                "type": "->"
            },
            {
                "file": "/home/gigi/apps/opt/php-pages/nextcloud/index.php",
                "line": 36,
                "function": "handleRequest",
                "class": "OC",
                "type": "::"
            }
        ],
        "File": "/home/gigi/apps/opt/php-pages/nextcloud/lib/private/Files/Node/Folder.php",
        "Line": 166,
        "CustomMessage": "--"
    }
}
$php occ status
  - installed: true
  - version: 26.0.0.11
  - versionstring: 26.0.0
  - edition:
  - maintenance: false
  - needsDbUpgrade: false
  - productname: Nextcloud
  - extendedSupport: false
Kurasami commented 1 year ago

Exact same problem. I can delete a folder and files only in the absolute top root directory of my installation. If I make a folder in that location I can delete it. If I make a folder or a file inside that top level folder, I cannot delete them.

So:

data/folder < can delete data/folder/folder < cannot delete data/folder/file1.txt < cannot delete

Checked my file permissions and everything is fine.

Does no one from Nextcloud know why this happens?

Nextcloud v26.0.1

PHP
Version: 8.1.18
Memory limit: 512 MB
Max execution time: 3600
Upload max size: 1 GB
Database:
Type: sqlite3
Version: 3.40.1
Size: 10.3 MB
<html>
<body>
<!--StartFragment-->

Error | index | OCP\Files\NotPermittedException: Could not create folder/config/www/nextcloud/lib/private/Files/AppData/AppData.php - line 147:OC\Files\Node\Folder->newFolder()/config/www/nextcloud/lib/private/Preview/Storage/Root.php - line 74:OC\Files\AppData\AppData->newFolder()/config/www/nextcloud/lib/private/Preview/Generator.php - line 685:OC\Preview\Storage\Root->newFolder()/config/www/nextcloud/lib/private/Preview/Generator.php - line 139:OC\Preview\Generator->getPreviewFolder()/config/www/nextcloud/lib/private/Preview/Generator.php - line 116:OC\Preview\Generator->generatePreviews()/config/www/nextcloud/lib/private/PreviewManager.php - line 192:OC\Preview\Generator->getPreview()/config/www/nextcloud/apps/photos/lib/Controller/PreviewController.php - line 162:OC\PreviewManager->getPreview()/config/www/nextcloud/apps/photos/lib/Controller/PreviewController.php - line 128:OCA\Photos\Controller\PreviewController->fetchPreview()/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:OCA\Photos\Controller\PreviewController->index()/config/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:OC\AppFramework\Http\Dispatcher->executeController()/config/www/nextcloud/lib/private/AppFramework/App.php - line 183:OC\AppFramework\Http\Dispatcher->dispatch()/config/www/nextcloud/lib/private/Route/Router.php - line 315:OC\AppFramework\App::main()/config/www/nextcloud/lib/base.php - line 1056:OC\Route\Router->match()/config/www/nextcloud/index.php - line 36:OC::handleRequest()
-- | -- | --

<!--EndFragment-->
</body>
</html>
lordraiden commented 1 year ago

I got this in a fresh install, first log entry

[index] Error: OCP\Files\NotPermittedException: Could not create folder at <>

  1. /var/www/html/lib/private/Files/AppData/AppData.php line 147 OC\Files\Node\Folder->newFolder("global")
  2. /var/www/html/apps/theming/lib/ImageManager.php line 383 OC\Files\AppData\AppData->newFolder("global")
  3. /var/www/html/apps/theming/lib/ImageManager.php line 118 OCA\Theming\ImageManager->getRootFolder()
  4. /var/www/html/apps/theming/lib/Controller/IconController.php line 155 OCA\Theming\ImageManager->getImage("favicon")
  5. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230 OCA\Theming\Controller\IconController->getTouchIcon("dashboard")
  6. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137 OC\AppFramework\Http\Dispatcher->executeController(["OCA\Theming\ ... "], "getTouchIcon")
  7. /var/www/html/lib/private/AppFramework/App.php line 183 OC\AppFramework\Http\Dispatcher->dispatch(["OCA\Theming\ ... "], "getTouchIcon")
  8. /var/www/html/lib/private/Route/Router.php line 315 OC\AppFramework\App::main("OCA\Theming\C ... r", "getTouchIcon", ["OC\AppFramewo ... "], ["dashboard","theming.Icon.getTouchIcon"])
  9. /var/www/html/lib/base.php line 1056 OC\Route\Router->match("/apps/theming/icon/dashboard")
  10. /var/www/html/index.php line 36 OC::handleRequest()

GET /apps/theming/icon/dashboard?v=b29670c2 from 10.10.10.23 by guillermo at 2023-05-17T15:21:04+00:00

###############################################################
# Nextcloud
###############################################################

version: '3.8'

# Networks ####################################################

networks:
  br1:
    driver: macvlan
    external: true
  nextcloud_network:
    internal: true

# Services ####################################################

services:

  db:
    image: postgres:alpine
    container_name: Nextcloud_postgres
    healthcheck:
      test: [ "CMD", "pg_isready", "-q", "-d", "nextcloud", "-U", "nextcloud" ]
      interval: 10s
      timeout: 5s
      retries: 10
    networks:
      - nextcloud_network
    environment:
      - TZ
      - POSTGRES_PASSWORD
      - POSTGRES_USER
      - POSTGRES_DB
      #- POSTGRES_INITDB_ARGS
      #- POSTGRES_INITDB_WALDIR
      #- POSTGRES_HOST_AUTH_METHOD
    volumes:
      - /mnt/user/Docker/Nextcloud/postgres/data:/var/lib/postgresql/data:z
    restart: unless-stopped
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  redis:
    image: redis:alpine
    container_name: NextCloud_Redis
    restart: unless-stopped
    command: redis-server --requirepass $REDIS_HOST_PASSWORD
    volumes:
      - /mnt/user/Docker/Nextcloud/redis:/data
    environment:
      - TZ
    networks:
      - nextcloud_network
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  app:
    image: nextcloud:fpm-alpine
    container_name: Nextcloud
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    volumes:
      - /mnt/user/Docker/Nextcloud/nextcloud:/var/www/html:z
      - /mnt/user/Personal/Nextcloud:/var/www/html/data
      - /mnt/user/Personal/Photos:/Albums
    environment:
      - TZ
      - POSTGRES_DB
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_HOST=db
      - REDIS_HOST=redis
      - REDIS_HOST_PASSWORD
    networks:
      nextcloud_network:
      br1:
        ipv4_address: 10.10.40.161
    dns:
      - 10.10.50.5
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  web:
    build: ./web
    container_name: NextCloud_Nginx-fpm
    restart: always
    networks:
      nextcloud_network:
      br1:
        ipv4_address: 10.10.40.160
    ports:
      - 8080:80
    dns:
      - 10.10.50.5
    volumes:
      - /mnt/user/Docker/Nextcloud/nextcloud:/var/www/html:z,ro
    environment:
      - TZ
      - PUID
      - PGID
    depends_on:
      - app

  cron:
    image: nextcloud:fpm-alpine
    container_name: NextCloud_Cron
    restart: unless-stopped
    depends_on:
      - db
      - redis
    networks:
      - nextcloud_network
    volumes:
      - /mnt/user/Docker/Nextcloud/nextcloud:/var/www/html:z
      - /mnt/user/Personal/Nextcloud:/var/www/html/data
    environment:
      - TZ
      - PUID
      - PGID
    entrypoint: /cron.sh
    labels:
      - "com.centurylinklabs.watchtower.enable=true"
jbarriojim commented 1 year ago

Hi,

I have the same issue here. But it is happening to me only from the mobile phone applications. in fact, at the application error column I can see webdav.

If I access to my Nextcloud instance from a browser, on my mobile phone, I can see and manage everything without problems.

If anyone has any clue about how to solve this error, it will be more than welcome 🌞

avsob commented 1 year ago

Hi,

I had the same issue.

My issue was with using php-imagick/imagemagick. In my case, I managed to solve it like this: Check what's in the file /etc/ImageMagick-6/policy.xml:

  1. Comment out the line (if not already done): <!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
  2. Rewrite the following line: <policy domain="coder" rights="none" pattern="PDF" /> to <policy domain="coder" rights="read|write" pattern="PDF" />
  3. Restart apache (sudo systemctl restart apache2)

Perhaps this solution will be useful to someone.

jbarriojim commented 1 year ago

As @avsob I found a solution, a different one but it is working to me.

My problem is related to the File Access Control. I think the problem was that over the folder I would like to list, it was a folder which I cannot access because the rules defined at access_control plugin. https://docs.nextcloud.com/server/latest/admin_manual/file_workflows/access_control.html

  1. Deactivate the rules.
  2. Access to the folder that wasn't able to be listed by you device ( in my case my mobile phone app).
  3. Activate again the rules.

After this I'm able to work with my folder without any problem. Hope it could help someone.

aghosh0605 commented 7 months ago

The exact same thing happens when I create an user in the admin panel and an error popup comes saying An error occurred during the request. Unable to proceed.

After that, all the subpages within the user page shows the same error when I refresh.

The only solution is to delete the user from commandline with sudo -u www-data php occ user:delete <username> from the nextcloud install directory.

Then if I refresh, the subpages of users are shown without error.

Still can't figure out the error nor I am finding the error in logs. Again if I try to create an user same things happens.,

dnv commented 5 months ago

Similar errors can be seen on a fresh Nextcloud 28.0.1 installation using the nextcloud:28-apache Docker image.

aghosh0605 commented 5 months ago

Similar errors can be seen on a fresh Nextcloud 28.0.1 installation using the nextcloud:28-apache Docker image.

For me, it's fixed now. I don't know the reason but it's fixed!! After updating I tested to create a new user from GUI and it's going fine. Before that, I used OCC to create users from the command line and then edit the user from GUI for extra information fields like email, full name, etc.

I was using the Debian 11 install script from NextcloudPi and still using the same.