Skip to content

Invenio indexer task process_bulk_queue fails with extended user profile #2198

@f-osorio

Description

@f-osorio

Package version (if known): v.10

Describe the bug

Invenio indexer fails when a user with custom profile belongs to a community. If a user with a custom profile is part of a community, further editing of the profile will cause the following:

ERROR/ForkPoolWorker-3] Task invenio_indexer.tasks.process_bulk_queue[d45d5785-3dea-45f1-9239-81b2f9c39c73] raised unexpected: BulkIndexError('4 document(s) failed to index.', [{'index': {'_index': 'berd-nfdi-communitymembers-members-member-v1.0.0-1681215677', '_id': '889b6c03-2021-4e20-83d7-63eca830dd80', 'status': 400, 'error': {'type': 'strict_dynamic_mapping_exception', 'reason': 'mapping set to strict, dynamic introduction of [...] within [user.profile] is not allowed'}

Steps to Reproduce

  1. Create a custom user profile
  2. Create a user with that profile
  3. Add the account to a community / create a community with the account
  4. Update the profile from /account/settings/profile
  5. See error

Expected behavior

The indexer works without issue.

Additional context

We are adding some custom fields for the user profile. Everything seems to be working great except when the indexer tries to run. It only happens with accounts that belong to a community. If there is no community, there is no problem.

It looks like the schema for users and the schema for community members are at odds. The user schema has the a dynamic profile and the community member does not. At least, this is a best guess about what is happening

There is a test for a custom profile but it only checks that the new field is added.

Everything else seems to be working fine with the expanded profile.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstaleNo activity for more than 60 days.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions