# I recieve error on test environment but it works fine from my local machine

**URL:** <https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883>\
**Category:** Elasticsearch\
**Created:** [September 10, 2021, 1:10pm UTC](https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883 "2021-09-10T13:10:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayat\_Elshazly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayat_elshazly/32/94418_2.png) [@Ayat\_Elshazly](https://discuss.elastic.co/u/Ayat_Elshazly)\
**Post date:** [September 10, 2021, 1:10pm UTC](https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883/1 "2021-09-10T13:10:06Z")

</div>

Hi ,  
I am implementing Web job hosted on Azure , this web job migrate data from Sql to Elastic

My Elatic URL is = "[https://vpc-dev-platform-elasticsearch-bag4d33ftqb3srzritdymf4d5m.eu-west-1.es.amazonaws.com](https://vpc-dev-platform-elasticsearch-bag4d33ftqb3srzritdymf4d5m.eu-west-1.es.amazonaws.com)"

and by the way we did not use authentication in this URL

this is my code

```auto

var connectionSettings = new ConnectionSettings(new Uri(ConfigurationManager.AppSettings["elasticUrl"]));
 			connectionSettings.DefaultMappingFor<BoardChannelDoc>(s => s.RoutingProperty(p => p.BoardId));

var createIndexRequest = new CreateIndexDescriptor(_indexName)
		   .Aliases(s => s.Alias(createIndexSettings.Alias))
		   .Settings(s => s.Setting(UpdatableIndexSettings.MaxNGramDiff, 3)
		   .NumberOfReplicas(createIndexSettings.NumberOfReplicas)
			   .NumberOfShards(createIndexSettings.NumberOfShards)
			   .RoutingPartitionSize(createIndexSettings?.RoutingPartitionSize)
			   .Analysis(a => a
				   .TokenFilters(d => d.NGram("1_4_Gram", t => t.MaxGram(4).MinGram(1)))
				   .Analyzers(d => d
					   .Custom("lowercase_keyword", t => t.Tokenizer("keyword").Filters("lowercase"))
					   .Custom("1_4_Ngram_lowercase_analyzer",
						   t => t.Tokenizer("standard").Filters("lowercase", "1_4_Gram")))))
		   .Mappings(ma => ma.Map<BoardChannelDoc>(m => m.AutoMap()
			   .Properties(p => p.Text(x => x.Name(n => n.Name).Analyzer("1_4_Ngram_lowercase_analyzer")))
			   .RoutingField(p => p.Required())));

var response = _elasticClient.CreateIndex(createIndexRequest, _indexName);

```

# and the error is

```auto
can not create an index because this debug info. Invalid NEST response built from a unsuccessful () low level call on PUT: /boardchannels0_test
# Audit trail of this API call:
 - [1] BadRequest: Node: https://vpc-dev-platform-elasticsearch-bag4d33ftqb3srzritdymf4d5m.eu-west-1.es.amazonaws.com/ Took: 00:00:00.0156247
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Unable to connect to the remote server. Call: Status code unknown from: PUT /boardchannels0_test ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 10.111.113.195:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData)
   --- End of inner exception stack trace ---
# 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.>

```

i tried also DisableDirectStreaming() but the same error , any help ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 10, 2021, 1:31pm UTC](https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883/2 "2021-09-10T13:31:36Z")

</div>

Welcome!

This service is not supported as it's not official.

Did you look at [Cloud by Elastic](https://www.elastic.co/cloud), also available if needed from [AWS Marketplace](https://aws.amazon.com/marketplace/pp/Elasticsearch-Inc-Elasticsearch-Service-on-Elastic/B01N6YCISK), [Azure Marketplace](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/elastic.ec-azure?tab=Overview) and [Google Cloud Marketplace](https://console.cloud.google.com/marketplace/details/endpoints/elasticsearch-service.gcpmarketplace.elastic.co)?

Cloud by elastic is one way to have access to **all features** , all managed by us. Think about what is there yet like Security, Monitoring, Reporting, SQL, Canvas, Maps UI, Alerting and built-in solutions named [Observability](https://www.elastic.co/observability), [Security](https://www.elastic.co/security), [Enterprise Search](https://www.elastic.co/enterprise-search) and what is coming next 🙂 ...

---

<div class="post-metadata">

**Author:** ![Ayat\_Elshazly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ayat_elshazly/32/94418_2.png) [@Ayat\_Elshazly](https://discuss.elastic.co/u/Ayat_Elshazly)\
**Post date:** [September 13, 2021, 11:19am UTC](https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883/3 "2021-09-13T11:19:13Z")

</div>

What does that mean, which service is not supported ?? and what's not official ? can you explain more

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 13, 2021, 5:52pm UTC](https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883/4 "2021-09-13T17:52:36Z")

</div>

Elasticsearch AWS Service which is now OpenSearch AWS Service is not built and ran by Elastic the company which built 99% of the Elastic Stack.

[cloud.elastic.co](http://cloud.elastic.co) is fully supported and can run on many cloud providers including AWS.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 11, 2021, 5:53pm UTC](https://discuss.elastic.co/t/i-recieve-error-on-test-environment-but-it-works-fine-from-my-local-machine/283883/5 "2021-10-11T17:53:22Z")

</div>

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