Skip to content

Elastic.Transport.UnexpectedTransportException: 'The JSON value could not be converted to Elastic.Clients.Elasticsearch.Ingest.InferenceConfig' #7913

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

Closed
AntonDambrouski opened this issue Aug 29, 2023 · 2 comments · Fixed by #8485
Labels
8.x Relates to a 8.x client version Category: Bug

Comments

@AntonDambrouski
Copy link

Elastic.Clients.Elasticsearch version: 8.9.2

Elasticsearch version: 8.9.1

.NET runtime version: net6.0

Operating system version: Windows 10

Description of the problem including expected versus actual behavior: The problem is that I'm trying to get info about the specific pipeline. If it dosn't exist - everything works fine, it returns 404 response. But if I have pipeline with 'inference_config', it throws the exception that it could not parse the json.

Steps to reproduce:

  1. Create pipeline with 'inference_config' set;
{
 "example-pipeline": {
   "description": "Text embedding pipeline",
   "processors": [
     {
       "inference": {
         "model_id": ".elser_model_1",
         "target_field": "ml",
         "field_map": {
           "name": "text_field"
         },
         "inference_config": {
           "text_expansion": {
             "results_field": "tokens"
           }
         }
       }
     }
   ]
 }
}
  1. Request this pipeline using .Net;
    var response = client.Ingest.GetPipeline(p => p.Id("example_pipeline"));

Expected behavior
The client returns info about pipeline (if exists) without throwing any errors.

Provide DebugInformation (if relevant):
Elastic.Transport.UnexpectedTransportException
HResult=0x80131500
Message=The JSON value could not be converted to Elastic.Clients.Elasticsearch.Ingest.InferenceConfig. Path: $.inference_config | LineNumber: 0 | BytePositionInLine: 179.
Source=Elastic.Transport
StackTrace:
at Elastic.Transport.DefaultHttpTransport1.ThrowUnexpectedTransportException[TResponse](Exception killerException, List1 seenExceptions, RequestData requestData, TResponse response, RequestPipeline pipeline)
at Elastic.Transport.DefaultHttpTransport1.Request[TResponse](HttpMethod method, String path, PostData data, RequestParameters requestParameters) at Elastic.Clients.Elasticsearch.ElasticsearchClient.DoRequest[TRequest,TResponse,TRequestParameters](TRequest request, Action1 forceConfiguration)
at Program.

$(String[] args) in ...\Program.cs:line 11

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
JsonException: The JSON value could not be converted to Elastic.Clients.Elasticsearch.Ingest.InferenceConfig. Path: $.inference_config | LineNumber: 0 | BytePositionInLine: 179.

@AntonDambrouski AntonDambrouski added the 8.x Relates to a 8.x client version label Aug 29, 2023
@flobernd flobernd added the bug label Sep 7, 2023
@flobernd flobernd added Category: Bug and removed bug labels Apr 4, 2024
@flobernd
Copy link
Member

Hi @AntonDambrouski, does this issue still exist in 8.13.x?

@AntonDambrouski
Copy link
Author

Hello @flobernd, the issue still persists, but the method GetPipeline() is marked as obsolete. BTW I solved my task without this method, so if it is obsolete I guess we can close this issue. What do you think?

Here is the error details:

Elastic.Transport.UnexpectedTransportException
HResult=0x80131500
Message=Unknown property name 'text_expansion' received while deserializing the 'InferenceConfig' from the response.
Source=Elastic.Transport
StackTrace:
at Elastic.Transport.DistributedTransport1.ThrowUnexpectedTransportException[TResponse](Exception killerException, List1 seenExceptions, RequestData requestData, TResponse response, RequestPipeline pipeline)
at Elastic.Transport.DistributedTransport1.<RequestCoreAsync>d__161.MoveNext()
at System.Threading.Tasks.ValueTask1.get_Result() at System.Runtime.CompilerServices.ValueTaskAwaiter1.GetResult()
at Elastic.Transport.TaskExtensions.EnsureCompleted[T](ValueTask1 task) at Elastic.Transport.DistributedTransport1.Request[TResponse](HttpMethod method, String path, PostData data, RequestParameters requestParameters, OpenTelemetryData& openTelemetryData)
at Elastic.Clients.Elasticsearch.ElasticsearchClient.<>c__DisplayClass28_03.<<DoRequestCoreAsync>g__SendRequest|0>d.MoveNext() at Elastic.Clients.Elasticsearch.Ingest.IngestNamespacedClient.GetPipeline(Action1 configureRequest)
at Program.

$(String[] args) in..\Program.cs:line 8

This exception was originally thrown at this call stack:
[External Code]

Inner Exception 1:
JsonException: Unknown property name 'text_expansion' received while deserializing the 'InferenceConfig' from the response.

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

Successfully merging a pull request may close this issue.

2 participants