NotPermitted error when editing theme setting, but folder are created correctly

Nextcloud version (eg, 20.0.5): 27.1.2
Operating system and version (eg, Ubuntu 20.04): Debian 12
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.57
PHP version (eg, 7.4): 8.2.7
Data store type: NFS

The issue you are facing:

Is this the first time you’ve seen this error? (Y):

Steps to replicate it:

  1. Editing theme setting in admin theme tab

The output of your Nextcloud log in Admin > Logging:

OCP\Files\NotPermittedException: Could not create folder "/appdata_[instanceid]/theming/global/61"

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '1',
    1 => '2',
    2 => '3',
  ),
  'trusted_proxies' => 
  array (
    0 => '1',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '27.1.2.1',
  'overwrite.cli.url' => 'https://example.com',
  'dbname' => 'nextcloud',
  'dbhost' => '1',
  'dbport' => '3306',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'a',
  'dbpassword' => '',
  'installed' => true,
  'default_locale' => 'en_US',
  'default_phone_region' => 'US',
  'knowledgebaseenabled' => false,
  'allow_user_to_change_display_name' => true,
  'skeletondirectory' => '/var/www/html/nextcloud/core/skeleton',
  'templatedirectory' => '',
  'remember_login_cookie_lifetime' => 2592000,
  'session_lifetime' => 86400,
  'davstorage.request_timeout' => 60,
  'session_relaxed_expiry' => false,
  'session_keepalive' => true,
  'auto_logout' => false,
  'token_auth_activity_update' => 60,
  'auth.bruteforce.protection.enabled' => true,
  'auth.bruteforce.protection.testing' => false,
  'ratelimit.protection.enabled' => true,
  'auth.webauthn.enabled' => true,
  'auth.storeCryptedPassword' => true,
  'hide_login_form' => false,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'example.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.office365.com',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'example.com',
  'mail_smtppassword' => '',
  'mail_from_address' => 'a',
  'allow_local_remote_servers' => false,
  'trashbin_retention_obligation' => 'auto',
  'versions_retention_obligation' => 'auto',
  'appcodechecker' => true,
  'updatechecker' => true,
  'updater.server.url' => 'https://updates.nextcloud.com/updater_server/',
  'updater.release.channel' => 'stable',
  'has_internet_connection' => true,
  'connectivity_check_domains' => 
  array (
    0 => 'www.nextcloud.com',
  ),
  'check_for_working_htaccess' => true,
  'check_for_working_wellknown_setup' => true,
  'check_data_directory_permissions' => true,
  'config_is_read_only' => false,
  'log_type' => 'file',
  'log_type_audit' => 'file',
  'logfilemode' => 416,
  'loglevel' => 2,
  'loglevel_frontend' => 2,
  'syslog_tag' => 'NC',
  'logdateformat' => 'F d, Y H:i:s',
  'logtimezone' => 'Asia/Tokyo',
  'log_query' => false,
  'log_rotate_size' => 104857600,
  'profiler' => false,
  'customclient_desktop' => NULL,
  'customclient_android' => NULL,
  'customclient_ios' => NULL,
  'customclient_ios_appid' => NULL,
  'defaultapp' => 'dashboard,files',
  'appstoreenabled' => true,
  'enable_previews' => true,
  'preview_max_x' => 4096,
  'preview_max_y' => 4096,
  'preview_max_filesize_image' => 50,
  'preview_max_memory' => 512,
  'preview_imaginary_url' => 'http://127.0.0.1:9000/',
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\MP3',
    6 => 'OC\\Preview\\TXT',
    7 => 'OC\\Preview\\MarkDown',
    8 => 'OC\\Preview\\OpenDocument',
    9 => 'OC\\Preview\\Krita',
    10 => 'OC\\Preview\\Imaginary',
  ),
  'ldapUserCleanupInterval' => 51,
  'sort_groups_by_name' => true,
  'comments.managerFactory' => '\\OC\\Comments\\ManagerFactory',
  'systemtags.managerFactory' => '\\OC\\SystemTag\\ManagerFactory',
  'maintenance' => false,
  'maintenance_window_start' => 100,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '1',
    'port' => 1,
    'password' => '',
    'dbindex' => 1,
    'timeout' => 1.5,
    'read_timeout' => 1.5,
  ),
  'cache_chunk_gc_ttl' => 86400,
  'hashingCost' => 15,
  'max_filesize_animated_gifs_public_sharing' => 15,
  'filelocking.enabled' => true,
  'upgrade.disable-web' => false,
  'lookup_server' => '',
  'gs.enabled' => false,
  'gs.federation' => 'internal',
  'csrf.optout' => 
  array (
  ),
  'simpleSignUpLink.shown' => false,
  'login_form_autocomplete' => true,
  'no_unsupported_browser_warning' => false,
  'files_no_background_scan' => false,
  'diagnostics.logging' => true,
  'diagnostics.logging.threshold' => 0,
  'profile.enabled' => true,
  'enable_file_metadata' => true,
  'bulkupload.enabled' => true,
  'reference_opengraph' => true,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
);

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{
    "app": "index",
    "exception": {
        "Code": 0,
        "CustomMessage": "--",
        "Exception": "OCP\\Files\\NotPermittedException",
        "File": "/var/www/html/nextcloud/lib/private/Files/Node/Folder.php",
        "Line": 162,
        "Message": "Could not create folder \"/appdata_[instance_id]/theming/global/61\"",
        "Trace": [
            {
                "class": "OC\\Files\\Node\\Folder",
                "file": "/var/www/html/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php",
                "function": "newFolder",
                "line": 105,
                "type": "->"
            },
            {
                "class": "OC\\Files\\SimpleFS\\SimpleFolder",
                "file": "/var/www/html/nextcloud/apps/theming/lib/ImageManager.php",
                "function": "newFolder",
                "line": 175,
                "type": "->"
            },
            {
                "class": "OCA\\Theming\\ImageManager",
                "file": "/var/www/html/nextcloud/apps/theming/lib/ImageManager.php",
                "function": "getCacheFolder",
                "line": 190,
                "type": "->"
            },
            {
                "class": "OCA\\Theming\\ImageManager",
                "file": "/var/www/html/nextcloud/apps/theming/lib/Controller/IconController.php",
                "function": "getCachedImage",
                "line": 163,
                "type": "->"
            },
            {
                "class": "OCA\\Theming\\Controller\\IconController",
                "file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "function": "getTouchIcon",
                "line": 230,
                "type": "->"
            },
            {
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
                "function": "executeController",
                "line": 137,
                "type": "->"
            },
            {
                "class": "OC\\AppFramework\\Http\\Dispatcher",
                "file": "/var/www/html/nextcloud/lib/private/AppFramework/App.php",
                "function": "dispatch",
                "line": 183,
                "type": "->"
            },
            {
                "class": "OC\\AppFramework\\App",
                "file": "/var/www/html/nextcloud/lib/private/Route/Router.php",
                "function": "main",
                "line": 315,
                "type": "::"
            },
            {
                "class": "OC\\Route\\Router",
                "file": "/var/www/html/nextcloud/lib/base.php",
                "function": "match",
                "line": 1068,
                "type": "->"
            },
            {
                "class": "OC",
                "file": "/var/www/html/nextcloud/index.php",
                "function": "handleRequest",
                "line": 36,
                "type": "::"
            }
        ]
    },
    "level": 3,
    "message": "Could not create folder \"/appdata_[instance_id]/theming/global/61\"",
    "method": "GET",
    "remoteAddr": "",
    "reqId": "ALt2ZUMaaT9otHidoIhi",
    "time": "October 22, 2023 12:50:32",
    "url": "/index.php/apps/theming/icon/settings?v=d3f968fa",
    "user": "",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0",
    "version": "27.1.2.1"
}




I have no idea why this error pops up when editing the theme settings.
The folder was appended correctly. And everything are showing correctly in web and directory view.
The weird thing is whole folder has permission set to 0755 but the folder created by nextcloud has permission 0770.
1

The whole data directory was running on NFS mount via fstab.

Just curious if anyone have same issue… whether if it is normal or how to fix this error?

Many thanks.

1 Like

https://www.reddit.com/r/NextCloud/comments/piewqw/need_some_help_please_change_the_permissions_to/ just turn it off

Not really helped. still showing same error after restarting apache.
This error is harmless but it keeps spamming your logging when theming config modified.