inveniosoftware / invenio-app-rdm

Turn-key research data management platform.
https://inveniordm.docs.cern.ch
MIT License
96 stars 140 forks source link

Invenio indexer task `process_bulk_queue` fails with extended user profile #2198

Open f-osorio opened 1 year ago

f-osorio commented 1 year ago

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.

github-actions[bot] commented 1 year ago

This issue was automatically marked as stale.

daglueck commented 10 months ago

This issue still prevents us from customizing user profiles on our platform. Is there anything we can do to help resolve it?

github-actions[bot] commented 6 months ago

This issue was automatically marked as stale.

github-actions[bot] commented 4 months ago

This issue was automatically marked as stale.

github-actions[bot] commented 1 month ago

This issue was automatically marked as stale.