NEST Brings down the whole Webserver

Does anyone realize that the NEST Library brings down a whole web server?
Does anyone even care about such a Humongous bug!

Gone Warkolm - Close this thread to save EMBARRASSMENT(as you unusually do) instead of acknowledging and fixing the problem. - PRAT!

If you're having issues, then providing some more context will allow us to help you.

Unfortunately there's very information here on what the problem was, logs, technical details, etc etc

You seem to be in COMA if you think that. How much more info do you need to be spoon fed before understanding the problem?!

While I can appreciate your frustrations, this sort of behaviour does nothing but encourage people to ignore your requests, as all they get are attacks.

In your OP you have no information about how your webserver crashed. What webserver are you using? What do the webserver logs show? If there's no logs, how do you know it crashed? What do the Elasticsearch and client logs show?

1 Like

Why not ask me to design the whole bloody thing for you. You are RIDICULOUS.

You know. We had some respect for Elasticsearch before we started dealing with it. But once involved especially that CRAP library you call NEST the way things are going - man you are not worth the time!

It would just be decent of you to tell people upfront that your offering is CRAP so that they don't invest a whole lot of time and resources before they find out themselves.

INTEGRITY - believe it or not - is still VALID even in your world!

Until we can move our infrastructure away from ES and the nightmare NEST library, are you capable of addressing this problem or do we just have to take this crashing of applications as a feature of Elasticsearch?

Could you share Elasticsearch logs? If Elasticsearch crashes, we would love to understand what is causing that and what would be needed to fix it.

Sorry you guys have to put up with people like this.

We use the elastic cloud - which logs do you need as the ones that are available ad we looked at show nothing.

We also host our app on Azure and elasticsearch shuts down the application if a nested object is included in the document.

Your lack of appreciation is probably due to the fact that you are not using NEST.

So you meant that Elasticsearch is still running and does not crash but your application crashes?
Got it.

Are you able to identify which part of the code is doing that? If so, that'd be extremely useful if you could share a sample piece of code that reproduces this behavior. That way, we can investigate where the exception is coming from and how we can fix it.

Could you do that?

Yes, We have an Index which works perfectly. We added an additional property to that index - a nested object. If we leave that null it also works perfectly.
But if you create a document and set that nested field with a value say a LIST of emplyee objects

and try to index the document, then the whole thing just crashes.

P.S. In the code where the indexing is done using NEST, as soon as the line :slight_smile:
var result = await ElasticSearchConfig.GetClient().IndexAsync(dest, idx => idx.Index($"properties-{dest.Country.ToLower()}"));

is executed, no exception or nothing is thrown in order to investigate. Just Crash.

Great. Is there a way to share a sample project which reproduces that? Including the mapping you are using?

I cant share the code but the only moving parts relevant to this issue is the index mapping:
.Nested(n=>n.Name(c=>c.Beds).IncludeInParent(true).Properties(pp=>pp
.Number(d => d.Name(c => c.BedId).Type(NumberType.Long))
.Number(d => d.Name(c => c.PropertyId).Type(NumberType.Long))
.Number(d => d.Name(c => c.SingleDoubleShared).Type(NumberType.Integer))
.Number(d => d.Name(c => c.Price).Type(NumberType.Integer))
.Number(d => d.Name(c => c.RentFrequency).Type(NumberType.Integer))
.Boolean(d => d.Name(c => c.Ensuite))
.Date(d => d.Name(c => c.AvailableFrom))

The code is just that one line to index a document - there is no other peripheral environmental interactions to take into account.

We have an index with this mapping and we just create a document and index and Bang!

As I mentioned, with the nested object property set to null, everything works. So obviously something wrong with the nested object.

Here is the mapping of the document in es:

{
  "properties-ie" : {
    "mappings" : {
      "properties" : {
        "ams" : {
          "type" : "keyword"
        },
        "assets" : {
          "type" : "integer"
        },
        "auctionDate" : {
          "type" : "date"
        },
        "auctionNotice" : {
          "type" : "text"
        },
        "bathrooms" : {
          "type" : "short"
        },
        "bedrooms" : {
          "type" : "short"
        },
        **"beds" : {**

** "type" : "nested",**
** "include_in_parent" : true,**
** "properties" : {**
** "availableFrom" : {**
** "type" : "date"**
** },**
** "bedId" : {**
** "type" : "long"**
** },**
** "ensuite" : {**
** "type" : "boolean"**
** },**
** "price" : {**
** "type" : "integer"**
** },**
** "propertyId" : {**
** "type" : "long"**
** },**
** "rentFrequency" : {**
** "type" : "integer"**
** },**
** "singleDoubleShared" : {**
** "type" : "integer"**
** }**
** }**
** },**
"buildArea" : {
"type" : "integer"
},
"buildAreaUnit" : {
"type" : "short"
},
"buildingId" : {
"type" : "integer"
},
"category" : {
"type" : "byte"
},
"cityId" : {
"type" : "integer"
},
"cmc" : {
"type" : "keyword"
},
"cmcp" : {
"type" : "keyword"
},
"cmct" : {
"type" : "keyword"
},
"combinedAddress" : {
"type" : "text"
},
"condition" : {
"type" : "byte",
"null_value" : 0
},
"corner" : {
"type" : "byte"
},
"country" : {
"type" : "keyword"
},
"countyId" : {
"type" : "integer"
},
"currency" : {
"type" : "keyword"
},
"currencySymbol" : {
"type" : "keyword"
},
"dateListed" : {
"type" : "date"
},
"defaultCulture" : {
"type" : "keyword"
},
"displayAddress" : {
"type" : "text"
},
"energy" : {
"type" : "integer"
},
"furnished" : {
"type" : "byte"
},
"gender" : {
"type" : "integer",
"null_value" : 0
},
"id" : {
"type" : "keyword"
},
"landArea" : {
"type" : "integer"
},
"landAreaUnit" : {
"type" : "byte"
},
"latitude" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"listImage" : {
"type" : "keyword"
},
"livingrooms" : {
"type" : "short"
},
"localPropertyId" : {
"type" : "integer"
},
"locality" : {
"type" : "keyword"
},
"localityId" : {
"type" : "integer"
},
"location" : {
"type" : "geo_point"
},
"locationShape" : {
"type" : "geo_shape"
},
"longitude" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"major" : {
"type" : "byte"
},
"paidTill" : {
"type" : "date"
},
"postCode1" : {
"type" : "keyword"
},
"postCode2" : {
"type" : "keyword"
},
"price" : {
"type" : "long"
},
"priceNorm" : {
"type" : "long"
},
"pricequalifier" : {
"type" : "byte"
},
"promoterDisplayAddress" : {
"type" : "text"
},
"promoterId" : {
"type" : "integer"
},
"promoterLocality" : {
"type" : "keyword"
},
"promoterName" : {
"type" : "text"
},
"promoterPhone" : {
"type" : "keyword"
},
"promoterPropertyId" : {
"type" : "long"
},
"propertyCat" : {
"type" : "integer"
},
"rentAvailablefrom" : {
"type" : "date"
},
"rentDeposit" : {
"type" : "long"
},
"rentFrequency" : {
"type" : "short"
},
"rentIncludes" : {
"type" : "keyword"
},
"rentMin" : {
"type" : "short"
},
"retirement" : {
"type" : "boolean",
"null_value" : false
},
"saleType" : {
"type" : "short"
},
"searchLocalities" : {
"type" : "keyword"
},
"searchLocality" : {
"type" : "keyword"
},
"searchLocalityId" : {
"type" : "keyword"
},
"secondaryLocality" : {
"type" : "keyword"
},
"secondaryLocalityId" : {
"type" : "integer"
},
"specialRegion" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"ssc" : {
"type" : "integer",
"null_value" : 0
},
"sscBeds" : {
"type" : "integer",
"null_value" : 0
},
"sscPrice" : {
"type" : "integer",
"null_value" : 0
},
"standing" : {
"type" : "byte"
},
"state" : {
"type" : "keyword"
},
"status" : {
"type" : "byte"
},
"subscription" : {
"type" : "byte"
},
"suitable" : {
"type" : "byte",
"null_value" : 0
},
"summary" : {
"type" : "text"
},
"tenure" : {
"type" : "short"
},
"typeId" : {
"type" : "integer"
},
"viaPlan" : {
"type" : "boolean"
}
}
}
}
}

So basically we new up a document without setting the nested field and everything works.
We new up another document and this time set the nested field and everything crashes.

Our code is as simple as
var doc = new des{prop1=1, prop2=2}
var result = await ElasticSearchConfig.GetClient().IndexAsync(doc, idx => idx.Index($"properties-{dest.Country.ToLower()}"));

perfect - then set the nested property:

var doc = new des{prop1=1, prop2=2, nestedFiled=so sn so}
var result = await ElasticSearchConfig.GetClient().IndexAsync(doc, idx => idx.Index($"properties-{dest.Country.ToLower()}"));

Crash

Hi @han1 developer of NEST here. Can assure you we very much care. Your experience is very much not one we would like you to have.

You say you run on cloud

  • What version of Elasticsearch are your running?
  • What version of the client are you using?

What version of .NET do you run and under what context? (mvc/ISS/ operating system).

What does your ElasticsearchConfig.GetClient() look like? Obviously redacting the cloud url and credentials.

We have a lot of integration tests that index a nested field and I can not reproduce this locally against a local instance or cloud.

Here's how I attempted to reproduce using client version 7.5.1 and cloud running elasticsearch 7.4.2:

var cloudUrl = "https://<redacted>.westeurope.azure.elastic-cloud.com:9243";
var connectionSettings = new ConnectionSettings(new Uri(cloudUrl))
    .EnableDebugMode()
    .BasicAuthentication("elastic", "<redacted>");
var client = new ElasticClient(connectionSettings);

Setup an index with a nested mapping

const string index = "nested-test";
if (client.Indices.Exists(index).Exists)
    client.Indices.Delete(index);

var createIndex = client.Indices.Create(index, c => c
    .Map<Company>(m => m
        .Properties(p => p
                .Nested<Person>(n => n
                    .Name(e => e.People)
                    .IncludeInParent()
                )
            )
        )
    );
var healthy = client.Cluster.Health(index, h => h.WaitForStatus(WaitForStatus.Green));

I then index that document

var indexDoc = client.Index(new Company
{
    Name = "zip", 
    People = new List<Person> {new Person {Name = "zap"}}
}, i => i.Index(index));
                
Console.WriteLine(indexDoc.DebugInformation);

Console.WriteLine(new string('-', 8));
var mapping = client.Indices.GetMapping<Company>(m=>m.Index(index));
Console.WriteLine(mapping.DebugInformation);

Which yields the following on the console's output:

Valid NEST response built from a successful (201) low level call on POST: /nested-test/_doc?pretty=true&error_trace=true
# Audit trail of this API call:
 - [1] HealthyResponse: Node: https://<redacted>.westeurope.azure.elastic-cloud.com:9243/ Took: 00:00:00.2229475
# Request:
{"name":"zip","people":[{"name":"zap"}]}
# Response:
{
  "_index" : "nested-test",
  "_type" : "_doc",
  "_id" : "3v7iFnAB5LcvOBOaJbvN",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "_seq_no" : 0,
  "_primary_term" : 1
}

And the mapping

Valid NEST response built from a successful (200) low level call on GET: /nested-test/_mapping?pretty=true&error_trace=true
# Audit trail of this API call:
 - [1] HealthyResponse: Node: https://<redacted>.westeurope.azure.elastic-cloud.com:9243/ Took: 00:00:00.1138590
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
{
  "nested-test" : {
    "mappings" : {
      "properties" : {
        "name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "people" : {
          "type" : "nested",
          "include_in_parent" : true,
          "properties" : {
            "name" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
          }
        }
      }
    }
  }
}

So somewhere in between my setup and yours something seems to not go right, any thing that sticks out to you or more that you can share about your setup?

1 Like