nextcloud / nextcloud/server

[Bug]: Unable to update configuration: conflict between new type (mixed) and old type (array)

Open
#47,898 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 29-feedback bug feature: occ
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

I have normally made configuration changes on nextcloud via the occ config:import command i.e.
sudo -u www-data php occ config:import config.json
However after upgrading from 29.0.0 and above, the command keeps failing with the following error

In AppConfig.php line 823:
                                                          
  conflict between new type (mixed) and old type (array)  
                                                          

config:import [<file>]

At first the issue looked similar to this but it did not get fixed by upgrading to the latest version.
I am currently running 29.0.6
I also attempted to debug the issue by exporting the current configuration and re-importing it i.e.

sudo -u www-data php occ config:list > /tmp/config_all.json
sudo -u www-data php occ config:import /tmp/config_all.json

This produced un-ending value type errors like:

Invalid app config value for "core":"files_metadata". Only integers, strings and null (delete) are allowed.
Invalid app config value for "core":"metadataGenerationDone". Only integers, strings and null (delete) are allowed.

Based on some comments on the Nextcloud forum, using the config:import command was mentioned as deprecated but could not find it explicitly mentioned in the release notes.
Any help would be much appreciated

Steps to reproduce

1.Define configuration in a json file and grant necessary permissions
2. Go to the the nextcloud config directory
3.Try to import your configuration as defined in the json file using the occ command

Expected behavior

I was trying to persist preview_* configuration settings since preview_max_(y/x) defaults to null. wanted to set this at 2048
Adding the preview setting to my configuration file and running the command should be sufficient

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

PostgreSQL

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

Updated from a MINOR version (ex. 28.0.1 to 28.0.2)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "29.0.6.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "log_type": "file",
        "loglevel": 0,
        "logdateformat": "F d, Y H:i:s",
        "maintenance": false,
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpauth": "0",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance_window_start": 1,
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "ldapUserCleanupInterval": "51"
    }
}
List of activated Apps
Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - checksum: 1.2.4
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contactsinteraction: 1.10.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - event_update_notification: 2.4.0
  - federatedfilesharing: 1.19.0
  - files: 2.1.1
  - files_accesscontrol: 1.19.1
  - files_automatedtagging: 1.19.0
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_retention: 1.18.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - groupfolders: 17.0.3
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - nextcloud_announcements: 1.18.0
  - notifications: 2.17.0
  - oauth2: 1.17.0
  - password_policy: 1.19.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - quota_warning: 1.20.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - richdocuments: 8.4.6
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - text: 3.10.1
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - twofactor_webauthn: 1.4.0
  - updatenotification: 1.19.1
  - user_ldap: 1.20.0
  - user_saml: 6.2.0
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - bruteforcesettings: 2.9.0
  - calendar: 4.7.16 (installed 4.7.16)
  - circles: 29.0.0-dev (installed 24.0.0)
  - collectives: 2.14.3 (installed 2.14.3)
  - contacts: 6.0.0 (installed 6.0.0)
  - deck: 1.13.1 (installed 1.13.1)
  - encryption: 2.17.0
  - federation: 1.19.0 (installed 1.13.0)
  - impersonate: 1.16.0 (installed 1.16.0)
  - metadata: 0.20.0 (installed 0.20.0)
  - notes: 4.10.1 (installed 4.10.1)
  - oidc_login: 3.1.1 (installed 3.1.1)
  - photos: 2.5.0 (installed 1.5.0)
  - richdocumentscode: 24.4.502 (installed 24.4.502)
  - sharelisting: 1.2.0 (installed 1.2.0)
  - support: 1.12.0 (installed 1.9.0)
  - suspicious_login: 7.0.0
Nextcloud Signing status
No errors have been found.
Nextcloud Logs

No response

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 at AppConfig.php line 823 and trace the occ config:import entry point that reports the mixed-versus-array conflict. Reproduce the import with the configuration examples in the issue, including preview_max_x and preview_max_y, and determine what behavior should allow the configuration import to complete without the reported type errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.