Could not create folder "/appdata_oc8cx6pd41te/theming/global"

Just did a clean install of Nextcloud Hub 7, version 28.0.0. The operating system is Ubuntu 22.04.

The log contains an error (see below for details of the error) about not being able to create the folder “/appdata_oc8cx6pd41te/theming/global”. I looked, the folder, /var/www/nextcloud/data/appdata_oc8cx6pd41te/theming/global, does exists. It also contains a subfolder “0”, which contains two files, “favIcon-settings#0082c9” and “touchIcon-settings#0082c9”.

The owner:group of the folders/files are all www-data:www-data.

It appears to be an incorrect error message. Like the code didn’t check for the existence of the folder before actually trying to create the folder.

 NotPermittedException Could not create folder "/appdata_oc8cx6pd41te/theming/global"

 1. /var/www/nextcloud/lib/private/Files/AppData/AppData.phpline 147

    OC\Files\Node\Folder->newFolder()

 2. /var/www/nextcloud/apps/theming/lib/ImageManager.phpline 367

    OC\Files\AppData\AppData->newFolder()

 3. /var/www/nextcloud/apps/theming/lib/ImageManager.phpline 101

    OCA\Theming\ImageManager->getRootFolder()

 4. /var/www/nextcloud/apps/theming/lib/Controller/IconController.phpline 127

    OCA\Theming\ImageManager->getImage()

 5. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.phpline 230

    OCA\Theming\Controller\IconController->getFavicon()

 6. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.phpline 137

    OC\AppFramework\Http\Dispatcher->executeController()

 7. /var/www/nextcloud/lib/private/AppFramework/App.phpline 184

    OC\AppFramework\Http\Dispatcher->dispatch()

 8. /var/www/nextcloud/lib/private/Route/Router.phpline 315

    OC\AppFramework\App::main()

 9. /var/www/nextcloud/lib/base.phpline 1069

    OC\Route\Router->match()

10. /var/www/nextcloud/index.phpline 39

    OC::handleRequest()



  "reqId": "47VIjPNHlT1oplqj77Jc",
  "level": 3,
  "time": "2023-12-20T17:03:40+00:00",
  "remoteAddr": "24.120.45.84",
  "user": "richard",
  "app": "index",
  "method": "GET",
  "url": "/apps/theming/favicon/settings?v=be06caec",
  "message": "Could not create folder \"/appdata_oc8cx6pd41te/theming/global\"",
  "userAgent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0",
  "version": "28.0.0.11",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "Could not create folder \"/appdata_oc8cx6pd41te/theming/global\"",
    "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/apps/theming/lib/ImageManager.php",
        "line": 367,
        "function": "newFolder",
        "class": "OC\\Files\\AppData\\AppData",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/theming/lib/ImageManager.php",
        "line": 101,
        "function": "getRootFolder",
        "class": "OCA\\Theming\\ImageManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/theming/lib/Controller/IconController.php",
        "line": 127,
        "function": "getImage",
        "class": "OCA\\Theming\\ImageManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "getFavicon",
        "class": "OCA\\Theming\\Controller\\IconController",
        "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": 184,
        "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": 1069,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 39,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Files/Node/Folder.php",
    "Line": 162,
    "message": "Could not create folder \"/appdata_oc8cx6pd41te/theming/global\"",
    "exception": [],
    "CustomMessage": "Could not create folder \"/appdata_oc8cx6pd41te/theming/global\""
  },
  "id": "65831f209a950"
}

@RichardR Did you ever find a solution to this? I am receiving the same error on a new install and I’ve never seen this before (this is my fifth install for a new client). Obviously, my folder name is slightly different as they’re unique to each install, but the rest is identical. The owner is www-data for me as well and permissions are 755 for the existing directory.

Edit: For what it’s worth, I deleted the error log to see if it would trigger a new error and the error never reappeared. Not sure what this was about.

Nope. As you can see, you are the only other person to post to this thread.

As best as I can tell, it’s a meaningless error (ie., no side-effect or ramifications) so I haven’t put any additional time into looking for an answer.

Since I originally posted this thread, I actually have reinstalled my installation of Nextcloud, and I didn’t get the error message when I did so.

1 Like

I just hit the same problem on a fresh Docker install:

[index] Error: Could not create folder "/appdata_ocxxxxxxxxxx/theming/global"
	GET /apps/theming/favicon?v=yyyyyyyy
	from zz.zz.zz.zz by admin at Jan xx, 2024, yy:yy:yy PM

tmo1,

I’m guessing (hoping for your sake), that if you actually do a directory listing, you will find (like I did) that the folder actually exists.

You might wish to post whether or not that is indeed the case for anyone else reading this thread.

Just for the record, I’ve seen the same error in my logs. New install based on the Docker image.

As others have reported, the folder (incl. all sub-folders) was actually there when I checked. I found it inside my Nextcloud data directory.

I’m new to Nextcloud and I found the error message rather confusing. Since the folder name started with a slash, I thought that Nextcloud was trying to write into the root directory of the container. Obviously, that should have failed.

I see this log message also, NC28, fresh install

Im getting these aswell, but for appdata/blabla/preview/blabla…

Im really confused as the folders seem to exist, with all correct permissions as you guys have found aswell.

I have slowlog enabled in my mariadb config, and im getting some slow queries about oc_filecache that maybe (?) could be related:

...
# Query_time: 1.013529  Lock_time: 0.000044  Rows_sent: 0  Rows_examined: 3
# Rows_affected: 3  Bytes_sent: 52
SET timestamp=1708038662;
UPDATE `oc_filecache` SET `mtime` = GREATEST(`mtime`, 1708038661), `etag` = '65ce9a05ecbd2', `size` = CASE WHEN `size` > '-1' THEN GREATEST(`size` + '10485760', -1) ELSE `size` END WHERE (`storage` = 1) AND (`path_hash` IN ('d41d8cd98f00b204e9801998ecf8427e', '5128f45c9b4be13788ba41bdb6d1fc1f', '3c60ae6b081407862g1aa8f22a2b7214'));
...
...
Query_time: 1.130459  Lock_time: 0.000026  Rows_sent: 0  Rows_examined: 0
# Rows_affected: 1  Bytes_sent: 13
SET timestamp=1708038563;
INSERT INTO `oc_filecache` (`mimepart`, `mimetype`, `mtime`, `size`, `etag`, `storage_mtime`, `permissions`, `name`, `parent`, `checksum`, `path_hash`, `path`, `storage`) VALUES('5', '16', '1708038562', '10485760', 'c4e51654e2461b241a0d4f7722715eb4', '1708038562', '27', '342', '1150', '', 'aedeaa70c87b143d09f39a203e3916a9', 'uploads/web-file-upload-93ae1996bdfb2456/342', '1');
...

Isnt a 1s query absurd for such a small change/lookup? I mean 0 rows examined one affected = 1 sec???

I was joking that its because imaginary is too fast that nc does not manage to even create the folders in time but on a more serious note I have no clue what causes this… :sweat_smile:

EDIT: I’m fairly confident that I found the reason for the slow database, fixed it and haven’t gotten any mariadb slow.log yet - however I still managed to get the error. It seems to have happened at the same time as my php-fpm pool got exhausted. My current belief is that this error appears when either the database or php-fpm pool get exhausted/busy.