Elasticsearch.Net.ElasticsearchClientException: BulkAll halted after failed product check

Unhandled exception. Elasticsearch.Net.ElasticsearchClientException: BulkAll halted after failed product check
   at Nest.BlockingSubscribeExtensions.WaitOnObservable[TObservable,TObserve,TObserver](TObservable observable, TimeSpan maximumRunTime, Func`3 factory)
   at Nest.BlockingSubscribeExtensions.Wait[T](BulkAllObservable`1 observable, TimeSpan maximumRunTime, Action`1 onNext)

I am getting this exception while trying to index a CSV to 3 node cluster.

here is my Code

using System;
using Elasticsearch.Net;
using Nest;
using Kuch_b;
using System.Security.Cryptography.X509Certificates;

namespace elasticsearch_client_example
    internal class Testing
        private const string Index_name = "data-v1";
        private static async Task Main(string[] args)
        var cert = new X509Certificate(@"PATH TO ca.pem FILE");
            var uris = Enumerable.Range(9200, 1).Select(port => new Uri($"https://<VM IP>:{port}"));
            var connectionPool = new StaticConnectionPool(uris);
            var settings = new ConnectionSettings(connectionPool)
                .BasicAuthentication("USER_NAME_FOR_ELASTIC", "PASSWORD_FOR_ELASTIC")
            var client1 = new ElasticClient(settings);
            var existResponse = await client1.Indices.ExistsAsync(Index_name);
                var createResponse = await client1.Indices.CreateAsync(Index_name, c => c 
                .Map(m => m.AutoMap<grades>()
                .Properties<grades>( p => p.Keyword(k => k.Name(s => s.sSN)))
                .Settings( s => s.NumberOfShards(4).NumberOfReplicas(1)));
                try {
                    if (!createResponse.IsValid && !createResponse.Acknowledged)
                        Console.WriteLine("I am working dude");
                catch (Exception ex )
            var bulkAll = client1.BulkAll(Read_Data(), r => r
            bulkAll.Wait(TimeSpan.FromMinutes(10), r => Console.WriteLine("HELLO "));
        public static IEnumerable<grades>Read_Data()
            var file = new StreamReader(@"PATH TO grades.csv");
            string line;
            while ((line = file.ReadLine())  != null)
                yield return new grades(line);

CSV model Class:

public class grades
    public string last { get; set; }
    public string first { get; set; }
    public string sSN { get; set; }
    public string g_rade { get; set; }

    public grades(string dataline)
        var columns = dataline.Split(',', StringSplitOptions.TrimEntries);
        last = columns[0];
        first = columns[1];
        sSN = columns[2];
        g_rade = columns[3];

Nest Version:7.17.4
Any Help will be much Appreciated:

Hi, @dawood_ahmad,

The code looks valid at first glance. This exception can sometimes be misleading and occur when the client cannot communicate with the server due to TLS misconfiguration. Are you sure that the certificate fingerprint matches the value from the Elasticsearch server? A secondary possibility is if you run through a proxy that may strip headers from the server response. We rely on the presence of a header to validate the server.

What is curious is that it appears you call to ExistsAsync is succeeding via the same client instance. The product check should only occur on the first request. Can you try enabling debug mode on the settings with .EnableDebugMode() and then capture the DebugInformation from the ExistsAsync response? The audit trail in particular could be helpful there.

To rule out TLS, you could temporarily replace the CertificateFingerprint configuration with .ServerCertificateValidationCallback((a,b,c,d) => true) which trusts any certificate. Of course, this should not be used in production. If the bulk request succeeds with the validation callback applied, it suggests an issue with the fingerprint.

1 Like

there was a issue with fingerprint ...You are awesome :revolving_hearts:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.