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

7.0.0 - code not being signed #48

Closed scdba closed 4 years ago

scdba commented 4 years ago

Hi Brendan

I'm trying es 7.0.0 with Elastisearch.net and nest with no success. Here's the code I'm using. Am I leaving something out? It looks like the request is going through unsigned, indeed untouched. Result is {Invalid NEST response built from a unsuccessful (403) low level call on GET: /events/_doc/565540}

            var awsCreds = new Amazon.Runtime.BasicAWSCredentials("myaccess", "mysecret");
            var AWSHttpConnection = new Elasticsearch.Net.Aws.AwsHttpConnection(awsCreds, Amazon.RegionEndpoint.EUWest1);

            var AWSURI = new Uri("my url");
            var pool = new SingleNodeConnectionPool(AWSURI);

            var esAWSConfig = new ConnectionSettings(pool, AWSHttpConnection);

            Nest.ElasticClient client = new ElasticClient(esAWSConfig);

            var eventCMS = client.Get<EventCMS>(565540, g => g.Index("events"));
bcuff commented 4 years ago

That looks like it should work. Can you look at the outgoing to request and see if there is a x-amz-security-token HTTP header set?

scdba commented 4 years ago

Hi Brandon

To try and do what you ask, I've run this against a fake server nc -l 9200

This is what I get in the request sent

GET /events/_doc/565540 HTTP/1.1 Accept: application/json Content-Type: application/json User-Agent: elasticsearch-net/7.0.0 (Microsoft Windows 6.3.9600; .NET Framework 4.7.3460.0; Nest) Host: 10.0.2.2:9200 Connection: Keep-Alive

On Mon, 7 Oct 2019 at 22:58, Brandon notifications@github.com wrote:

That looks like it should work. Can you look at the outgoing to request and see if there is a x-amz-security-token HTTP header set?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bcuff/elasticsearch-net-aws/issues/48?email_source=notifications&email_token=ABUXC3VVXXAVQV7RYFHGH2TQNOWGVA5CNFSM4I6FLJ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAR6AKI#issuecomment-539222057, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUXC3XVVT3BZYPRFSBHYQDQNOWGVANCNFSM4I6FLJ2A .

-- Aryaguna Watson Database Development Manager www.southbankcentre.co.uk

Belvedere Road London SE1 8XX

-- Southbank Centre Belvedere Road London SE1 8XX southbankcentre.co.uk http://southbankcentre.co.uk

Registered Charity No. 298909

scdba commented 4 years ago

Hi again Brandon

Furthermore, I have cloned the source and tried to build but without success

I'm getting Severity Code Description Project File Line Suppression State Error CS0115 'AwsHttpConnection.CreateHttpRequestMessage(RequestData)': no suitable method found to override Elasticsearch.Net.Aws C:\Users\aglocal\Documents\GitHub\vs2017\aryaguna-development-vs2013\elasticsearch-net-aws\src\Elasticsearch.Net.Aws\Elasticsearch.Net.Aws\AwsHttpConnection.cs 46 N/A


BTW The dependencies I've pulled in are

Id Versions ProjectName


Elasticsearch.Net {7.0.0} ElasticSearch.Net.Aws.IntegrationTests
System.Buffers {4.5.0} ElasticSearch.Net.Aws.IntegrationTests
System.Diagnostics.DiagnosticSource {4.5.1} ElasticSearch.Net.Aws.IntegrationTests
AWSSDK.Core {3.3.103.45} ElasticSearch.Net.Aws.Tests
Elasticsearch.Net {7.0.0} ElasticSearch.Net.Aws.Tests
Microsoft.AspNetCore.WebUtilities {2.2.0} ElasticSearch.Net.Aws.Tests
Microsoft.Extensions.Primitives {2.2.0} ElasticSearch.Net.Aws.Tests
Microsoft.Net.Http.Headers {2.2.0} ElasticSearch.Net.Aws.Tests
System.Buffers {4.5.0} ElasticSearch.Net.Aws.Tests
System.Diagnostics.DiagnosticSource {4.5.1} ElasticSearch.Net.Aws.Tests
System.Memory {4.5.1} ElasticSearch.Net.Aws.Tests
System.Numerics.Vectors {4.4.0} ElasticSearch.Net.Aws.Tests
System.Runtime.CompilerServices.... {4.5.1} ElasticSearch.Net.Aws.Tests
System.Text.Encodings.Web {4.5.0} ElasticSearch.Net.Aws.Tests
AWSSDK.Core {3.3.103.45} Elasticsearch.Net.Aws
Elasticsearch.Net {7.0.0} Elasticsearch.Net.Aws
Microsoft.AspNetCore.WebUtilities {2.2.0} Elasticsearch.Net.Aws
Microsoft.Extensions.Primitives {2.2.0} Elasticsearch.Net.Aws
Microsoft.Net.Http.Headers {2.2.0} Elasticsearch.Net.Aws
System.Buffers {4.5.0} Elasticsearch.Net.Aws
System.Diagnostics.DiagnosticSource {4.5.1} Elasticsearch.Net.Aws
System.Memory {4.5.1} Elasticsearch.Net.Aws
System.Numerics.Vectors {4.4.0} Elasticsearch.Net.Aws
System.Runtime.CompilerServices.... {4.5.1} Elasticsearch.Net.Aws
System.Text.Encodings.Web {4.5.0} Elasticsearch.Net.Aws

bcuff commented 4 years ago

Ahh.. I think you might be having an issue because the current package doesn't support NET Framework. I added support for NET Framework 4.6.1 and released it on nuget here

Here's the change if you want to take a look.

Thanks for reporting the issue. If you still have problems after updating to 7.0.1 feel free to re-open this issue.

scdba commented 4 years ago

Ahh.. Ok that makes sense Thanks for the 7.0.1 release. Works a treat against our cluster on that trivial 'hello es world' get If I find anything else I will let you know

This is a bit of a life-saver. ES on AWS makes so many other things easier for us than rolling our own docker cluster or whatnot. I am indebted

Aryaguna

On Wed, 9 Oct 2019 at 02:48, Brandon notifications@github.com wrote:

Ahh.. I think you might be having an issue because the current package doesn't support NET Framework. I added support for NET Framework 4.6.1 and released it on nuget here https://www.nuget.org/packages/Elasticsearch.Net.Aws/7.0.1

Here's https://github.com/bcuff/elasticsearch-net-aws/pull/49 the change if you want to take a look.

Thanks for reporting the issue. If you still have problems after updating to 7.0.1 feel free to re-open this issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bcuff/elasticsearch-net-aws/issues/48?email_source=notifications&email_token=ABUXC3RDUNPX6KR4B4WCCHLQNUZ6NA5CNFSM4I6FLJ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAWHACA#issuecomment-539783176, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUXC3XFZRQHNBBEKZSCLL3QNUZ6NANCNFSM4I6FLJ2A .

-- Aryaguna Watson Database Development Manager www.southbankcentre.co.uk

Belvedere Road London SE1 8XX

-- Southbank Centre Belvedere Road London SE1 8XX southbankcentre.co.uk http://southbankcentre.co.uk

Registered Charity No. 298909

bcuff commented 4 years ago

You're welcome. I'm glad you found it useful :)

bcuff commented 4 years ago

@scdba FYI - I fixed a bug in 7.0.2 that is probably relevant to you. I recommend upgrading.

https://github.com/bcuff/elasticsearch-net-aws/releases/tag/7.0.2

scdba commented 4 years ago

Hi Brandon

Ah - thanks very much for the heads up !

On Wed, 23 Oct 2019 at 23:55, Brandon notifications@github.com wrote:

@scdba https://github.com/scdba FYI - I fixed a bug in 7.0.2 that is probably relevant to you. I recommend upgrading.

https://github.com/bcuff/elasticsearch-net-aws/releases/tag/7.0.2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bcuff/elasticsearch-net-aws/issues/48?email_source=notifications&email_token=ABUXC3QECLVBY2MRVAK6LK3QQDI6LA5CNFSM4I6FLJ2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECDEFYI#issuecomment-545669857, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUXC3WS6S3FLIJ5IQH6NUTQQDI6LANCNFSM4I6FLJ2A .

-- Aryaguna Watson Database Development Manager www.southbankcentre.co.uk

Belvedere Road London SE1 8XX

-- Southbank Centre Belvedere Road London SE1 8XX southbankcentre.co.uk http://southbankcentre.co.uk

Registered Charity No. 298909