pimcore / generic-data-index-bundle

Other
3 stars 2 forks source link

Index Updating should figure that an index already exists #165

Closed dpfaffenbauer closed 1 month ago

dpfaffenbauer commented 3 months ago

When I run generic-data-index:update:index I run into the following issue:

18:38:11 WARNING   [pimcore.opensearch.default] Response ["{"error":{"root_cause":[{"type":"invalid_alias_name_exception","reason":"Invalid alias name [pimcore_asset], an index exists with the same name as the alias","index":"pimcore_asset","index_uuid":"5Pps5u8oSV2MgY2NaIeKww"}],"type":"invalid_alias_name_exception","reason":"Invalid alias name [pimcore_asset], an index exists with the same name as the alias","index":"pimcore_asset","index_uuid":"5Pps5u8oSV2MgY2NaIeKww"},"status":400}"]

When an index already exists, there should be an option to delete it or that the bundle uses that index and updates it. Or is there already and I just missed it?

github-actions[bot] commented 2 months ago

Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.

markus-moser commented 2 months ago

I had the same problem several times. The problem there is the auto_create_index feature of OpenSearch. When you already save elements and run the queue before the index is created (so the bin/console generic-data-index:update:index command was executed OpenSearch will implicitly create the index with the default detected automatic mapping. The problem then is that in the case of the generic data index pimcore_asset is an index alias and no real index, therefore the command will not recreate it.

The best way to avoid this is to disable the auto mapping feature - see: https://github.com/pimcore/demo-enterprise/blob/2024.x/docker-compose.yaml#L81

But I agree that we should somehow automatically detect this case and provide a option to delete this index automatically.

dpfaffenbauer commented 1 month ago

I don't have access to that docker compose file and that repo. can you paste the config for opensearch here please?

markus-moser commented 1 month ago

- action.auto_create_index=false

image