nextcloud / nextcloud/server

[Bug]: Declarative settings: TypeError when saving a checkbox field value

Open Beginner friendly
#60,903 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 33-feedback bug
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

When a declarative settings form contains a checkbox field with storage_type: internal, saving the value triggers a fatal TypeError:

OC\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given,
called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343

Root cause: DeclarativeManager::saveInternalValue() unconditionally calls AppConfig::setValueString() regardless of the field type. A checkbox field sends 0 or 1 (integer) from the frontend, but setValueString() enforces a strict string type, which raises a TypeError.

Steps to reproduce
  1. Create a declarative settings form in an app with a checkbox field, storage_type: internal, section_type: admin:
[
	'id' => 'checkbox_form',
	'priority' => 1,
	'section_type' => DeclarativeSettingsTypes::SECTION_TYPE_ADMIN,
	'section_id' => Application::APP_ID,
	'storage_type' => DeclarativeSettingsTypes::STORAGE_TYPE_INTERNAL,
	'title' => 'Enable feature',
	'fields' => [
		[
			'id' => 'my_checkbox',
			'title' => 'My checkbox',
			'type' => DeclarativeSettingsTypes::CHECKBOX,
			'label' => 'Enable',
			'default' => false,
		],
	],
]
  1. Open the admin settings page where the form is registered.
  2. Click the checkbox to toggle its value.
  3. Observe a 500 Internal Server Error on POST /ocs/v2.php/settings/api/declarative/value.
Expected behavior

The checkbox value (true/false or 1/0) should be saved without error. The DeclarativeManager should cast the value appropriately (e.g. call setValueBool() for CHECKBOX) or at minimum cast to (string) before calling setValueString().

Nextcloud Server version

33

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MySQL

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

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "debug": true,
        "profiler": true,
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-extra",
                "url": "\/apps-extra",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-shared",
                "url": "\/apps-shared",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/apps-writable",
                "url": "\/apps-writable",
                "writable": true
            }
        ],
        "allow_local_remote_servers": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "1025",
        "skeletondirectory": "\/skeleton",
        "setup_create_db_user": false,
        "loglevel": 0,
        "log_query": true,
        "query_log_file": "\/shared\/log\/querylog-stable33.log",
        "query_log_file_requestid": "yes",
        "diagnostics.logging": false,
        "diagnostics.logging.threshold": 0,
        "log.condition": {
            "apps": [
                "diagnostics",
                "admin_audit"
            ]
        },
        "sharing.federation.allowSelfSignedCertificates": true,
        "gss.selfsigned.allow": true,
        "default_language": "fr",
        "default_locale": "fr_FR",
        "reduce_to_languages": [
            "fr",
            "en"
        ],
        "default_phone_region": "FR",
        "default_timezone": "Europe\/Paris",
        "knowledgebaseenabled": true,
        "knowledgebase.embedded": false,
        "allow_user_to_change_display_name": true,
        "has_internet_connection": true,
        "loglevel_frontend": 0,
        "logtimezone": "Europe\/Paris",
        "defaultapp": "dashboard,files",
        "appstoreenabled": false,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "nextcloud",
            "stable33.local",
            "192.168.21.7",
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "33.0.5.0",
        "overwrite.cli.url": "https:\/\/stable33.local",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "git",
        "installed": true,
        "lookup_server": "",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "demo"
        ]
    }
}
List of activated Apps
Enabled:
  - cloud_federation_api: 1.17.0
  - comments: 1.23.0
  - contactsinteraction: 1.14.1
  - dashboard: 7.13.0
  - dav: 1.36.0
  - demo: 1.0.0
  - federatedfilesharing: 1.23.0
  - federation: 1.23.0
  - files: 2.5.0
  - files_reminders: 1.6.0
  - files_sharing: 1.25.2
  - files_trashbin: 1.23.0
  - files_versions: 1.26.0
  - lookup_server_connector: 1.21.0
  - oauth2: 1.21.0
  - profile: 1.2.0
  - provisioning_api: 1.23.0
  - settings: 1.16.0
  - sharebymail: 1.23.0
  - systemtags: 1.23.0
  - theming: 2.8.0
  - twofactor_backupcodes: 1.22.0
  - updatenotification: 1.23.0
  - user_status: 1.13.0
  - weather_status: 1.13.0
  - webhook_listeners: 1.5.0
  - workflowengine: 2.15.0
Disabled:
  - admin_audit: 1.23.0
  - encryption: 2.21.0
  - files_external: 1.25.1
  - testing: 1.23.0
  - user_ldap: 1.24.0
Nextcloud Signing status
Integrity checker has been disabled. Integrity cannot be verified.
Nextcloud Logs
2026-06-01 16:55:39.549 | 192.168.21.5 - - [01/Jun/2026:14:55:39 +0000] "POST /ocs/v2.php/settings/api/declarative/value HTTP/1.1" 500 1053 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0"
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type` FROM `*PREFIX*appconfig` WHERE `lazy` = :dcValue1' with parameters: dcValue1 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type` FROM `*PREFIX*appconfig` WHERE `lazy` = :dcValue1' with parameters: dcValue1 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type` FROM `*PREFIX*appconfig` WHERE `lazy` = :dcValue1' with parameters: dcValue1 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type` FROM `*PREFIX*appconfig` WHERE `lazy` = :dcValue1' with parameters: dcValue1 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type` FROM `*PREFIX*appconfig` WHERE `lazy` = :dcValue1' with parameters: dcValue1 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type` FROM `*PREFIX*appconfig` WHERE `lazy` = :dcValue1' with parameters: dcValue1 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"serverDI","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"The requested alias \"OCP\\IServerContainer\" is deprecated. Please request \"Psr\\Container\\ContainerInterface\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"serverDI"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"--","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/lib/base.php","line":760,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["session"]]},{"file":"/var/www/html/lib/base.php","line":1288,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/ocs/v1.php","line":12,"args":["/var/www/html/lib/base.php"],"function":"require_once"},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/lib/base.php(760): OC\\App\\AppManager->loadApps(Array)\\n#2 /var/www/html/lib/base.php(1288): OC::init()\\n#3 /var/www/html/ocs/v1.php(12): require_once('/var/www/html/l...')\\n#4 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#5 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `uid`, `displayname`, `password` FROM `*PREFIX*users` WHERE `uid_lower` = :dcValue1' with parameters: dcValue1 => 'admin'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"serverDI","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"The requested alias \"OCP\\IServerContainer\" is deprecated. Please request \"Psr\\Container\\ContainerInterface\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"serverDI"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT * FROM `*PREFIX*authtoken` WHERE (`token` = :dcValue1) AND (`version` = :dcValue2)' with parameters: dcValue1 => 'c2e571506e0551e60475d52a9f26b43a0219082da1da3733533700cb555d8c1e21b658831391cecfa4216ff2f9e5c6e90f24379ebacc01017ee97ccbec3c5a5b', dcValue2 => '2'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/lib/private/legacy/OC_App.php","line":80,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["prelogin"]]},{"file":"/var/www/html/lib/private/legacy/OC_User.php","line":100,"function":"loadApps","class":"OC_App","type":"::","args":[["prelogin"]]},{"file":"/var/www/html/lib/base.php","line":831,"function":"setupBackends","class":"OC_User","type":"::","args":[]},{"file":"/var/www/html/lib/base.php","line":1288,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/ocs/v1.php","line":12,"args":["/var/www/html/lib/base.php"],"function":"require_once"},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/lib/private/legacy/OC_App.php(80): OC\\App\\AppManager->loadApps(Array)\\n#2 /var/www/html/lib/private/legacy/OC_User.php(100): OC_App::loadApps(Array)\\n#3 /var/www/html/lib/base.php(831): OC_User::setupBackends()\\n#4 /var/www/html/lib/base.php(1288): OC::init()\\n#5 /var/www/html/ocs/v1.php(12): require_once('/var/www/html/l...')\\n#6 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#7 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"serverDI","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"The requested alias \"OCP\\IServerContainer\" is deprecated. Please request \"Psr\\Container\\ContainerInterface\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"serverDI"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/ocs/v1.php","line":45,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["session"]]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/ocs/v1.php(45): OC\\App\\AppManager->loadApps(Array)\\n#2 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#3 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/ocs/v1.php","line":46,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["authentication"]]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/ocs/v1.php(46): OC\\App\\AppManager->loadApps(Array)\\n#2 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#3 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/ocs/v1.php","line":47,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["extended_authentication"]]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/ocs/v1.php(47): OC\\App\\AppManager->loadApps(Array)\\n#2 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#3 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/ocs/v1.php","line":52,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/ocs/v1.php(52): OC\\App\\AppManager->loadApps()\\n#2 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#3 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"serverDI","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"The requested alias \"OCP\\IServerContainer\" is deprecated. Please request \"Psr\\Container\\ContainerInterface\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"serverDI"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":257,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/apps/dav/lib/AppInfo/Application.php","line":240,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[["dav"]]},{"file":"/var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php","line":170,"function":"boot","class":"OCA\\DAV\\AppInfo\\Application","type":"->","args":[{"__class__":"OC\\AppFramework\\Bootstrap\\BootContext"}]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":481,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->","args":["dav"]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":273,"function":"loadApp","class":"OC\\App\\AppManager","type":"->","args":["dav"]},{"file":"/var/www/html/ocs/v1.php","line":52,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(257): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/apps/dav/lib/AppInfo/Application.php(240): OC\\App\\AppManager->loadApps(Array)\\n#2 /var/www/html/lib/private/AppFramework/Bootstrap/Coordinator.php(170): OCA\\DAV\\AppInfo\\Application->boot(Object(OC\\AppFramework\\Bootstrap\\BootContext))\\n#3 /var/www/html/lib/private/App/AppManager.php(481): OC\\AppFramework\\Bootstrap\\Coordinator->bootApp('dav')\\n#4 /var/www/html/lib/private/App/AppManager.php(273): OC\\App\\AppManager->loadApp('dav')\\n#5 /var/www/html/ocs/v1.php(52): OC\\App\\AppManager->loadApps()\\n#6 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#7 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `gu`.`gid`, `g`.`displayname` FROM `*PREFIX*group_user` `gu` LEFT JOIN `*PREFIX*groups` `g` ON `gu`.`gid` = `g`.`gid` WHERE `uid` = :dcValue1' with parameters: dcValue1 => 'admin'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":1,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"viewer","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"Error during app loading: Could not find path for viewer","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"OCP\\App\\AppPathNotFoundException","Message":"Could not find path for viewer","Code":0,"Trace":[{"file":"/var/www/html/lib/private/App/AppManager.php","line":460,"function":"getAppPath","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/lib/private/App/AppManager.php","line":273,"function":"loadApp","class":"OC\\App\\AppManager","type":"->","args":["viewer"]},{"file":"/var/www/html/ocs/v1.php","line":52,"function":"loadApps","class":"OC\\App\\AppManager","type":"->","args":[]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/App/AppManager.php","Line":717,"message":"Error during app loading: Could not find path for viewer","exception":"{\"class\":\"OCP\\App\\AppPathNotFoundException\",\"message\":\"Could not find path for viewer\",\"code\":0,\"file\":\"/var/www/html/lib/private/App/AppManager.php:717\",\"trace\":\"#0 /var/www/html/lib/private/App/AppManager.php(460): OC\\App\\AppManager->getAppPath('viewer')\\n#1 /var/www/html/lib/private/App/AppManager.php(273): OC\\App\\AppManager->loadApp('viewer')\\n#2 /var/www/html/ocs/v1.php(52): OC\\App\\AppManager->loadApps()\\n#3 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#4 {main}\"}","CustomMessage":"Error during app loading: Could not find path for viewer"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `appid`, `configkey`, `configvalue`, `type`, `flags` FROM `*PREFIX*preferences` WHERE (`userid` = :dcValue1) AND (`lazy` = :dcValue2)' with parameters: dcValue1 => 'admin', dcValue2 => '0'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":0,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"core","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"DB QueryBuilder: 'SELECT `provider_id`, `enabled` FROM `*PREFIX*twofactor_providers` WHERE `uid` = :dcValue1' with parameters: dcValue1 => 'admin'","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","data":{"app":"core"}}
2026-06-01 16:55:39.691 | {"reqId":"tFVVLsakkDjEoTBcYwNf","level":3,"time":"2026-06-01T16:55:39+02:00","remoteAddr":"192.168.21.5","user":"admin","app":"no app in context","method":"POST","url":"/ocs/v2.php/settings/api/declarative/value","scriptName":"/ocs/v2.php","message":"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343 in file '/var/www/html/lib/private/AppConfig.php' line 637","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:151.0) Gecko/20100101 Firefox/151.0","version":"33.0.5.0","exception":{"Exception":"Exception","Message":"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343 in file '/var/www/html/lib/private/AppConfig.php' line 637","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\DeclarativeSettingsController"},"setValue"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\DeclarativeSettingsController","setValue",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.settings.declarativesettings.setvalue"}]},{"file":"/var/www/html/ocs/v1.php","line":61,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/settings/api/declarative/value"]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":150,"Previous":{"Exception":"TypeError","Message":"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Settings/DeclarativeManager.php","line":343,"function":"setValueString","class":"OC\\AppConfig","type":"->","args":["demo","checkbox",1]},{"file":"/var/www/html/lib/private/Settings/DeclarativeManager.php","line":271,"function":"saveInternalValue","class":"OC\\Settings\\DeclarativeManager","type":"->","args":[{"__class__":"OC\\User\\User"},"demo","checkbox_form","checkbox",1]},{"file":"/var/www/html/apps/settings/lib/Controller/DeclarativeSettingsController.php","line":103,"function":"setValue","class":"OC\\Settings\\DeclarativeManager","type":"->","args":[{"__class__":"OC\\User\\User"},"demo","checkbox_form","checkbox",1]},{"file":"/var/www/html/apps/settings/lib/Controller/DeclarativeSettingsController.php","line":57,"function":"saveValue","class":"OCA\\Settings\\Controller\\DeclarativeSettingsController","type":"->","args":["demo","checkbox_form","checkbox",1]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":205,"function":"setValue","class":"OCA\\Settings\\Controller\\DeclarativeSettingsController","type":"->","args":["demo","checkbox_form","checkbox",1]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":118,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\DeclarativeSettingsController"},"setValue"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":153,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\DeclarativeSettingsController"},"setValue"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":321,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\DeclarativeSettingsController","setValue",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.settings.declarativesettings.setvalue"}]},{"file":"/var/www/html/ocs/v1.php","line":61,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/settings/api/declarative/value"]},{"file":"/var/www/html/ocs/v2.php","line":8,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/AppConfig.php","Line":637},"message":"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343 in file '/var/www/html/lib/private/AppConfig.php' line 637","exception":"{\"class\":\"Exception\",\"message\":\"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343 in file '/var/www/html/lib/private/AppConfig.php' line 637\",\"code\":0,\"file\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php:150\",\"trace\":\"#0 /var/www/html/lib/private/AppFramework/App.php(153): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Settings\\Controller\\DeclarativeSettingsController), 'setValue')\\n#1 /var/www/html/lib/private/Route/Router.php(321): OC\\AppFramework\\App::main('OCA\\\\Settings\\\\Co...', 'setValue', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#2 /var/www/html/ocs/v1.php(61): OC\\Route\\Router->match('/ocsapp/setting...')\\n#3 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#4 {main}\",\"previous\":{\"class\":\"TypeError\",\"message\":\"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343\",\"code\":0,\"file\":\"/var/www/html/lib/private/AppConfig.php:637\",\"trace\":\"#0 /var/www/html/lib/private/Settings/DeclarativeManager.php(343): OC\\AppConfig->setValueString('demo', 'checkbox', 1)\\n#1 /var/www/html/lib/private/Settings/DeclarativeManager.php(271): OC\\Settings\\DeclarativeManager->saveInternalValue(Object(OC\\User\\User), 'demo', 'checkbox_form', 'checkbox', 1)\\n#2 /var/www/html/apps/settings/lib/Controller/DeclarativeSettingsController.php(103): OC\\Settings\\DeclarativeManager->setValue(Object(OC\\User\\User), 'demo', 'checkbox_form', 'checkbox', 1)\\n#3 /var/www/html/apps/settings/lib/Controller/DeclarativeSettingsController.php(57): OCA\\Settings\\Controller\\DeclarativeSettingsController->saveValue('demo', 'checkbox_form', 'checkbox', 1)\\n#4 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(205): OCA\\Settings\\Controller\\DeclarativeSettingsController->setValue('demo', 'checkbox_form', 'checkbox', 1)\\n#5 /var/www/html/lib/private/AppFramework/Http/Dispatcher.php(118): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OCA\\Settings\\Controller\\DeclarativeSettingsController), 'setValue')\\n#6 /var/www/html/lib/private/AppFramework/App.php(153): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OCA\\Settings\\Controller\\DeclarativeSettingsController), 'setValue')\\n#7 /var/www/html/lib/private/Route/Router.php(321): OC\\AppFramework\\App::main('OCA\\\\Settings\\\\Co...', 'setValue', Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\\n#8 /var/www/html/ocs/v1.php(61): OC\\Route\\Router->match('/ocsapp/setting...')\\n#9 /var/www/html/ocs/v2.php(8): require_once('/var/www/html/o...')\\n#10 {main}\"}}","CustomMessage":"OC\\AppConfig::setValueString(): Argument #3 ($value) must be of type string, int given, called in /var/www/html/lib/private/Settings/DeclarativeManager.php on line 343 in file '/var/www/html/lib/private/AppConfig.php' line 637"}}
Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/private/Settings/DeclarativeManager.php around line 343 and trace the POST /ocs/v2.php/settings/api/declarative/value path for internal checkbox values. Confirm that saving both checkbox states completes without a TypeError and that the value is persisted appropriately; add or update regression coverage if the relevant test location is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.