Invalid NEST response built from a unsuccessful () low level call on PUT:

I have this error "Invalid NEST response built from a unsuccessful () low level call on PUT:/ nameOfIndex". I use Elasticsearch.Net/7.1.0 and ElasticSearch Cloud 7.5

BadRequest: Node: https://f3bf622c3-----------------a99a39.europe-west1.gcp.cloud.es.io:9243/ Took: 00:00:00.0026775

OriginalException: System.Net.Http.HttpRequestException: An attempt was made to access a socket in a way forbidden by its access permissions ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions

at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken).
Is this problem from different version of elasticSearch?, because it worked with older version cloud elastic.

Do you have more detail about how you're constructing the client e.g. ConnectionSettings and IConnectionPool used?

You may want to update the client to 7.5.1, and use the CloudConnectionPool.

Reindexing data to elasticSearch cloud , I am so sorry but for this issue I already opened 2 question. You can find all details in link above.

I used GeoLocation for Elasticsearch Model. is any changes on GeoLocation for elasticSearch version 7.5?

namespace pz.Models
{
    public class ElasticSearchModel : Model<Building>
    {     
         public ElasticSearchModel()
        {
            BuildingRooms = new List<BuildingRoomViewModel>();
            BuildingPhotos = new List<BuildingPhotoViewModel>();
         
        }
        public GeoLocation Location { get; set;}
        public int Id { get; set; }
        public string BuildTitle { get; set; }
        public DateTime CreatedDate { get; set; }

        public int TotalRooms { get; set; }
        public string Description { get; set; }
        public decimal? OwnerPrice { get; set; }
        public double? Size { get; set; }
        public string SizeName { get; set; }
        public string MoneyType { get; set; }
        public int BuildAction { get; set; }
        public bool? Payed { get; set; }
        public int BuildType { get; set; }
        public string Address { get; set; }
        public string DistrictUz { get; set; }
        
        public string DistrictRu { get; set; }
        
        public IList<BuildingRoomViewModel> BuildingRooms { get; set; }
        public IList<BuildingPhotoViewModel> BuildingPhotos { get; set; }

         public override void LoadEntity(Building t)
        {
            base.LoadEntity(t);

            SizeName = t.SizeName?.Localizations?.GetSingleOrDefaultByCurrentCulture().Name;
            MoneyType = t.MoneyType?.Localizations?.GetSingleOrDefaultByCurrentCulture().Name;
            BuildAction = t.BuildAction.Id;//.Localizations.GetSingleOrDefaultByCurrentCulture().Id;
            BuildType = t.BuildType.Id;//Localizations.GetSingleOrDefaultByCurrentCulture().Name;
            DistrictUz = t.District?.Localizations?.GetByCulture(1).Name;
            DistrictRu = t.District?.Localizations?.GetByCulture(2).Name;
        }
     

    }
}

After using CloudConnectionPool elastingsearch works,Thank you. But still have problem with search, sometime it return invalid status.

[Warning] Invalid NEST response built from a unsuccessful (400) low level call on POST: /honadonz12/_search?typed_keys=true

Audit trail of this API call:

OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 400 from: POST /honadonz12/_search?typed_keys=true. ServerError: Type: search_phase_execution_exception Reason: "all shards failed"

The response is a 400 HTTP response, which implies that there is something wrong with the request being sent. What is the exception and error that comes back from Elasticsearch? All these details should be on the response

reason":{"type":"query_shard_exception","reason":"failed to find geo_point field [location]","index_uuid":"uSLE-------M218wZKnHsEYg","index":"honadonz12"}}]},"status":400

The error message indicates that there is no geo_point field called location in the mapping in index "honadonz12". There may be a location field, but it's not mapped as a geo_point data type.

 public class ElasticSearchModel : Model<Building>
    {     
         public ElasticSearchModel()
        {
            BuildingRooms = new List<BuildingRoomViewModel>();
            BuildingPhotos = new List<BuildingPhotoViewModel>();
         
        }
        public int Id { get; set; }
        public string BuildTitle { get; set; }
        public DateTime CreatedDate { get; set; }

        public GeoLocation Location { get; set;}
        public DateTime EndTopAdsDate { get; set; }
        public bool TopAds { get; set; }
        public int TotalRooms { get; set; }
        public string Description { get; set; }
        public decimal? OwnerPrice { get; set; }
        public double? Size { get; set; }
        public string SizeName { get; set; }
        public string MoneyType { get; set; }
        public int BuildAction { get; set; }
        public int BuildType { get; set; }
        public string Address { get; set; }
        public string DistrictUz { get; set; }
        
        public string DistrictRu { get; set; }
        
        public IList<BuildingRoomViewModel> BuildingRooms { get; set; }
        public IList<BuildingPhotoViewModel> BuildingPhotos { get; set; }

         public override void LoadEntity(Building t)
        {
            base.LoadEntity(t);

            SizeName = t.SizeName?.Localizations?.GetSingleOrDefaultByCurrentCulture().Name;
            MoneyType = t.MoneyType?.Localizations?.GetSingleOrDefaultByCurrentCulture().Name;
            BuildAction = t.BuildAction.Id;//.Localizations.GetSingleOrDefaultByCurrentCulture().Id;
            BuildType = t.BuildType.Id;//Localizations.GetSingleOrDefaultByCurrentCulture().Name;
            DistrictUz = t.District?.Localizations?.GetByCulture(1).Name;
            DistrictRu = t.District?.Localizations?.GetByCulture(2).Name;
            
        }
     
    }

This is my elasticsearch model, I use GeoLocation for location, but it worked older version of elasticsearch , now when I use version 7.5 I have this kind of error

Is it possible that a document has been indexed before a mapping with a geo_point has been created? In its default configuration, Elasticsearch will infer the mapping for a new index from the first document it sees. this inferred mapping will not infer a geo_point mapping for a JSON object with lat and lon properties however, but will infer an object mapping, so you need to explicitly create the mapping, either

  1. whilst creating the index

or

  1. after the index is created and before any documents have been indexed.

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