Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES create_mapping() fails for graphs that used the concept->reference node migration #61

Open
johnatawnclementawn opened this issue Feb 12, 2025 · 0 comments

Comments

@johnatawnclementawn
Copy link
Member

  1. Create an example model with n >=1 concept nodes
  2. Ensure collections used in those concept nodes have been migrated to controlled lists (migrate_collections_to_controlled_lists)
  3. Use migrate_concept_nodes_to_reference_datatype to migrate those nodes to the reference datatype
  4. Export the graph through the graph designer
  5. Delete the graph
  6. Use the graph designer UI to import the graph & observe error:
> /Users/johnathanclementi/Documents/Arches/Projects/rdm/arches/arches/app/search/search.py(178)create_mapping()
-> breakpoint()
(Pdb) c
2025-02-12 12:26:20,921 arches.app.utils.data_management.resource_graphs.importer ERROR    BadRequestError(400, 'illegal_argument_exception', "can't merge a non object mapping [tiles.data.599a34f4-e94e-11ef-a306-0aa766c61b64] with an object mapping")
Traceback (most recent call last):
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/arches/arches/app/utils/data_management/resource_graphs/importer.py", line 149, in import_graph
    graph.save()
    ~~~~~~~~~~^^
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/arches/arches/app/models/graph.py", line 639, in save
    self.update_es_node_mapping(node, datatype_factory, se)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/arches/arches/app/models/graph.py", line 586, in update_es_node_mapping
    se.create_mapping("resources", body=datatype_mapping)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/arches/arches/app/search/search.py", line 179, in create_mapping
    self.es.indices.put_mapping(index=index, **body)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/ENV80/lib/python3.13/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped
    return api(*args, **kwargs)
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/ENV80/lib/python3.13/site-packages/elasticsearch/_sync/client/indices.py", line 3133, in put_mapping
    return self.perform_request(  # type: ignore[return-value]
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        "PUT",
        ^^^^^^
    ...<5 lines>...
        path_parts=__path_parts,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/ENV80/lib/python3.13/site-packages/elasticsearch/_sync/client/_base.py", line 423, in perform_request
    return self._client.perform_request(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        method,
        ^^^^^^^
    ...<5 lines>...
        path_parts=path_parts,
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/ENV80/lib/python3.13/site-packages/elasticsearch/_sync/client/_base.py", line 271, in perform_request
    response = self._perform_request(
        method,
    ...<4 lines>...
        otel_span=otel_span,
    )
  File "/Users/johnathanclementi/Documents/Arches/Projects/rdm/ENV80/lib/python3.13/site-packages/elasticsearch/_sync/client/_base.py", line 352, in _perform_request
    raise HTTP_EXCEPTIONS.get(meta.status, ApiError)(
        message=message, meta=meta, body=resp_body
    )
elasticsearch.BadRequestError: BadRequestError(400, 'illegal_argument_exception', "can't merge a non object mapping [tiles.data.599a34f4-e94e-11ef-a306-0aa766c61b64] with an object mapping")

note: this does not happen for graphs that have reference datatype nodes initially configured as reference nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant