Overridden `config.php` variables via `NC_*` cannot be arrays (or anything else than strings)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
PR #3966 introduced the possibility to override values in config.php via environment variables (a feature frequently used in container setups).
However, they are always interpreted as raw strings so it doesn't work when e.g. arrays are expected for a given config key.
Steps to reproduce
- Setup a NextCloud instance and define the environment variable
NC_app_install_overwritetohtmlviewer epubviewer ncdownloaderinstead ofconfig.php - Run
occ config:system:get app_install_overwrite - The string
htmlviewer epubviewer ncdownloaderis returned and it's effectless because Nextcloud expects an array there when checking the app overrides.
Expected behavior
An array containing the values htmlviewer, epubviewer, and ncdownloader is returned.
Installation method
Community Docker image
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?
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": {
+-- 97 lines: "version": "30.0.0.2",······························································································································································································································································································································································································································································································
}
}
List of activated Apps
Enabled:
- activity: 2.17.0
- admin_audit: 1.15.0
- audioplayer: 3.3.1
- bookmarks: 12.0.0
- bruteforcesettings: 2.5.0
- calendar: 4.2.1
- camerarawpreviews: 0.8.0
- circles: 25.0.0
- cloud_federation_api: 1.8.0
- cloud_py_api: 0.1.1
- comments: 1.15.0
- contacts: 5.0.2
- contactsinteraction: 1.6.0
- cookbook: 0.10.1
- cospend: 1.5.5
- dashboard: 7.5.0
- dav: 1.24.0
- deck: 1.8.3
- epubivewer: 1.6.7
- external: 5.0.0
- facerecognition: 0.9.11
- federatedfilesharing: 1.15.0
- federation: 1.15.0
- files: 1.20.1
- files_automatedtagging: 1.15.0
- files_downloadactivity: 1.15.0
- files_external: 1.17.0
- files_fulltextsearch: 25.0.0
- files_fulltextsearch_tesseract: 25.0.0
- files_linkeditor: 1.1.13
- files_mindmap: 0.0.27
- files_pdfviewer: 2.6.0
- files_rightclick: 1.4.0
- files_sharing: 1.17.0
- files_trashbin: 1.15.0
- files_versions: 1.18.0
- firstrunwizard: 2.14.0
- forms: 3.0.3
- fulltextsearch: 25.0.0
- fulltextsearch_elasticsearch: 25.0.0
- gpxpod: 5.0.4
- groupfolders: 13.1.0
- guests: 2.3.0
- health: 1.6.1
- htmlviewer: 29.2.0
- impersonate: 1.11.0
- logreader: 2.10.0
- lookup_server_connector: 1.13.0
- mail: 2.2.2
- maps: 0.2.4
- mediadc: 0.3.2
- metadata: 0.17.0
- music: 1.8.1
- ncdownloader: 1.0.21
- news: 20.0.0
- nextcloud_announcements: 1.14.0
- notes: 4.6.0
- notifications: 2.13.1
- notify_push: 0.5.0
- oauth2: 1.13.0
- onlyoffice: 7.6.8
- password_policy: 1.15.0
- phonetrack: 0.7.2
- photos: 2.0.1
- polls: 4.0.0
- previewgenerator: 5.1.1
- privacy: 1.9.0
- provisioning_api: 1.15.0
- quota_warning: 1.15.0
- recognize: 3.3.4
- recommendations: 1.4.0
- related_resources: 1.0.3
- serverinfo: 1.15.0
- settings: 1.7.0
- sharebymail: 1.15.0
- side_menu: 3.5.1
- socialsharing_email: 2.5.0
- spreed: 15.0.2
- support: 1.8.0
- survey_client: 1.13.0
- suspicious_login: 4.3.0
- systemtags: 1.15.0
- tasks: 0.14.5
- text: 3.6.0
- theming: 2.0.1
- twofactor_backupcodes: 1.14.0
- twofactor_email: 2.7.1
- twofactor_gateway: 0.20.0
- twofactor_totp: 7.0.0
- twofactor_webauthn: 1.0.0
- unsplash: 2.1.1
- updatenotification: 1.15.0
- user_status: 1.5.0
- viewer: 1.9.0
- weather_status: 1.5.0
- workflowengine: 2.7.0
Disabled: - encryption: 2.2.0
- files_accesscontrol: 1.15.1
- files_markdown: 2.3.6
- user_ldap: 1.14.1
- user_saml: 5.1.2
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the environment-variable override introduced in PR #3966 and the occ config:system:get entry point. Reproduce the NC_app_install_overwrite case and verify that the command returns htmlviewer, epubviewer, and ncdownloader as an array while string-valued overrides continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100