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

Invalid serialization of reindex request when using op type #8006

Closed
gpetrou opened this issue Dec 22, 2023 · 2 comments · Fixed by #8105
Closed

Invalid serialization of reindex request when using op type #8006

gpetrou opened this issue Dec 22, 2023 · 2 comments · Fixed by #8105
Labels
8.x Relates to 8.x client version Category: Bug

Comments

@gpetrou
Copy link
Contributor

gpetrou commented Dec 22, 2023

Elastic.Clients.Elasticsearch version: 8.11.0

Elasticsearch version: 8.2.2

.NET runtime version: net8.0

Operating system version: Windows 11

Description of the problem including expected versus actual behavior:
Trying to use ReindexAsync with OpType results in an invalid request.

Steps to reproduce:

Elastic.Clients.Elasticsearch.ReindexRequest request = new()
{
    Source = new Elastic.Clients.Elasticsearch.Core.Reindex.Source()
    {
         Index = Elastic.Clients.Elasticsearch.Indices.Parse("test-src")
    },
    Dest = new Elastic.Clients.Elasticsearch.Core.Reindex.Destination()
    {
         Index = "test-dest",
         OpType = Elastic.Clients.Elasticsearch.OpType.Create
    }
};

var response = await _elasticsearchClient.ReindexAsync(request);
{
  "dest": {
    "index": "test-dest",
    "op_type": {
      "value": "create"
    }
  },
  "source": {
    "index": "test-src"
  }
}

ServerError: Type: x_content_parse_exception Reason: "[4:16] [reindex] failed to parse field [dest]" CausedBy: "Type: x_content_parse_exception Reason: "[4:16] [dest] op_type doesn't support values of type: START_OBJECT""

Expected behavior
The request works.

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

@gpetrou gpetrou added the 8.x Relates to 8.x client version label Dec 22, 2023
@flobernd flobernd added the bug label Dec 22, 2023
@flobernd flobernd added Category: Bug and removed bug labels Apr 4, 2024
@gpetrou
Copy link
Contributor Author

gpetrou commented Apr 8, 2024

@flobernd this is still not working in 8.13.3.

@flobernd
Copy link
Member

flobernd commented Apr 8, 2024

@gpetrou Yes, that is expected. The manually crafted OpType type needs a specialized JSON converter. Thanks for re-testing with the latest version! This saves me some time. I'm soon going through all the open issues to check, which of them can be closed after the 8.13.* release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to 8.x client version Category: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants