bcuff / elasticsearch-net-aws

Add-on to Elasticsearch.Net & NEST for using AWS's elasticsearch service.
Apache License 2.0
72 stars 27 forks source link

Just updating from Elasticsearch.Net.Aws 7.2.1 to 7.2.2, causes 403 from AWS OpenSearch cluster #73

Open lorenh opened 1 year ago

lorenh commented 1 year ago

Just updating from Elasticsearch.Net.Aws 7.2.1 to 7.2.2 and we start receiving a 403 from our AWS OpenSearch cluster (running in elastisearch compatibility mode)

Elasticsearch.Net.ElasticsearchClientException: The remote server returned an error: (403) Forbidden. Call: Status code 403

Reverting to 7.2.1, and it starts working again. Any idea what could be going on?

bcuff commented 1 year ago

That's odd. Nothing changed related to signing. Here's the diff for 7.2.1 -> 7.2.2

https://github.com/bcuff/elasticsearch-net-aws/commit/1c71ad16e7aacddb43903cfae87197d45c624473

lorenh commented 1 year ago

That is strange. This happens to be running under an older WebAPI REST service with TargetFrameworkVersion=v4.7.2, I wonder if the framework target changes altered something? That and Newtonsoft is about it... really weird.

bcuff commented 1 year ago

Did the endpoint change? There's another reported issue related to the URL changing due to the open search service domain changing.

If it's not that, it could be .NET Framework. There are a few weird things the Uri class does to change certain characters. I've run into that in the past. My memory is fuzzy on exactly what the issue was around that though.

lorenh commented 1 year ago

To isolate the problem, the only thing I did was update this one single NuGet package 7.2.1 -> 7.2.2 and it broke, then rolled back to 7.2.1 and it started working (no changes to our AWS-side at all). I went back and forth a few times to make sure I was seeing it right. As a workaround for now we'll have to stick with Elasticsearch.Net.Aws 7.2.1 and just remember we can't update it, but I thought I'd ask to see what could be going on. Very strange indeed.

bcuff commented 1 year ago

Definitely strange. Maybe it was the target framework change from 461 to 481?

https://github.com/bcuff/elasticsearch-net-aws/commit/1c71ad16e7aacddb43903cfae87197d45c624473#diff-3625fd895652561b68373f0741d92727c2e6b1cc8302e8e4cda724e71e7d2536L4

That line is the only thing that changed in the released package. The rest of the changes were to tests.

mattbeatty commented 1 year ago

We are experiencing this issue as well. Downgrading to 7.2.1 worked.