Skip to content

Conversation

@solracsf
Copy link
Member

@solracsf solracsf commented Oct 26, 2025

Summary

⚠️ UNIFIED SEARCH STOPPED WORKING

  1. Try a search (search never returns results)
  2. Observe search console (and Nextcloud error log)
image

Regression from #55657
Cc @artonge

Fixes:

# occ config:app:get dav system_addressbook_exposed
no
"Exception": "OCP\\Exceptions\\AppConfigTypeConflictException",
    "Message": "conflict with value type from database",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/AppConfig.php",
        "line": 413,
        "function": "getTypedValue",
        "class": "OC\\AppConfig",
        "type": "->",
        "args": [
          "dav",
          "system_addressbook_exposed",
          "true",
          false,
          32
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CardDAV/ContactsManager.php",
        "line": 48,
        "function": "getValueBool",
        "class": "OC\\AppConfig",
        "type": "->",
        "args": [
          "dav",
          "system_addressbook_exposed",
          true
        ]
      },

Checklist

@solracsf solracsf added this to the Nextcloud 32.0.2 milestone Oct 26, 2025
@solracsf solracsf requested a review from artonge October 26, 2025 17:29
@solracsf solracsf self-assigned this Oct 26, 2025
@github-actions github-actions bot changed the title fix(ContactsManager): Fix conflict with value type from database [stable32] fix(ContactsManager): Fix conflict with value type from database Oct 26, 2025
@solracsf
Copy link
Member Author

solracsf commented Oct 26, 2025

If this get merged, should be backported until stable28 like original commit d14c96b

PS: #55657 should also be reviewed (for master, not same codebase)

@solracsf solracsf added the high label Oct 27, 2025
@solracsf solracsf requested review from a team, leftybournes, salmart-dev and yemkareems and removed request for a team October 27, 2025 07:14
@susnux
Copy link
Contributor

susnux commented Oct 27, 2025

But this wrongly writes a string? This sounds more like there is a place where it explicitly is written as string (legacy app config writes as mixed which should be ok?), no?

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks super wrong.
There is a lexicon for this application setting typing it to bool.

@come-nc
Copy link
Contributor

come-nc commented Nov 3, 2025

Ah, 32 does not have the lexicon, it was not backported. Maybe it’s related to the issue.

@solracsf Do you know how the value got typed to string? I check and occ config:app:set types to mixed by default, not string. So I do not see how this value could end up being typed as string in DB.

@artonge
Copy link
Contributor

artonge commented Nov 4, 2025

@ArtificialOwl shouldn't the config API handle the type conversion? Am I missing something?

EDIT: I think the missing lexicon is indeed necessary to enforce a new type on an already existing config.

Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed indeed 👍

@artonge
Copy link
Contributor

artonge commented Nov 4, 2025

/backport to stable31

@artonge
Copy link
Contributor

artonge commented Nov 4, 2025

/backport to stable30

@artonge
Copy link
Contributor

artonge commented Nov 4, 2025

/backport to stable29

@artonge
Copy link
Contributor

artonge commented Nov 4, 2025

/backport to stable28

@solracsf
Copy link
Member Author

solracsf commented Nov 4, 2025

@come-nc

Ah, 32 does not have the lexicon, it was not backported. Maybe it’s related to the issue.

@solracsf Do you know how the value got typed to string? I check and occ config:app:set types to mixed by default, not string. So I do not see how this value could end up being typed as string in DB.

I can't really tell, this is set since several major versions already, and it only broke on upgrade to 31 😿

@solracsf solracsf requested a review from come-nc November 4, 2025 14:05
@come-nc
Copy link
Contributor

come-nc commented Nov 6, 2025

@solracsf But that’s only on one instance right?
The getValueString will break on instances where the variable is typed as bool.
And there is at least one other getValueBool on the same setting.

So, this is not mergeable in my opinion, it should either migrate the setting to bool, or get it as untyped using the legacy API if needed. And it should fix all calls not only this one.

@solracsf
Copy link
Member Author

solracsf commented Nov 6, 2025

No problem, I can easily type it to bool on my side of course. I'll let you check with @artonge if this is needed or not. 👍🏼

@ArtificialOwl
Copy link
Member

would be nice to understand why the value type is set as string in the database. If this is a local issue only on a single instance:

./occ config:app:set --type boolean dav system_addressbook_exposed

if this needs to be applied to everyone, one of the solution would be a repair step using IAppConfig::updateType()

We could also add an option to Lexicon/Entry to enforce the updateType if conflict exists:
#56277

@SebastianKrupinski
Copy link
Contributor

@ArtificialOwl the original value was a string "yes" this probably did not get coverted properly

@ArtificialOwl
Copy link
Member

The value will always be stored in a string in the database, could it be 'yes', 'true', '1', 'on', but will be returned as boolean by getValueBool()
The exception here is because the value is marked as 'string' (value type) in the database while the method called expect the value to be stored as 'boolean'.

Copy link
Member

@ArtificialOwl ArtificialOwl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(should not be merged as it is)

@ArtificialOwl
Copy link
Member

No problem, I can easily type it to bool on my side of course. I'll let you check with @artonge if this is needed or not. 👍🏼

Hello @solracsf, does it means you changed the expected type of the config value yourself before ? We are trying to understand if the value was set to string (from mixed) by code or by human interaction

@solracsf
Copy link
Member Author

solracsf commented Nov 7, 2025

I can't tell, but there is high chance it has been set trough occ to 'no' value.

@ArtificialOwl
Copy link
Member

ArtificialOwl commented Nov 7, 2025

By default, value are stored as mixed in the database, unless using --type string when running ./occ config:app:set or value type is already defined in database

@solracsf
Copy link
Member Author

solracsf commented Nov 7, 2025

Yeah sure, but since this has been set years ago, I can't know for sure how it has been set, sorry.

I would say that, since there are no other reports since the release, maybe this isn't a big deal and PR can be closed. 👍🏼

@artonge artonge closed this Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants