Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Server: OpenSearch Version=“1.3”
Client: .Net OpenSearch.Client Version=“1.3.0”
.Net version: .Net 6.0
Describe the issue:
Hi, I have faced issue while following the startup guide for AWS SigV4 support for OpenSearch.
Console.WriteLine("Os client");
var connection = new AwsSigV4HttpConnection();
var config = new ConnectionSettings(new SingleNodeConnectionPool(uri), connection)
.DefaultIndex("people")
.DisableDirectStreaming();
var client = new OpenSearchClient(config);
Console.WriteLine("Start requests");
var response = client.Index(person, i => i.Index("persons"));
On client.Index() line i receive this error:
Method not found: 'System.String Amazon.Util.AWSSDKUtils.CanonicalizeResourcePathV2(System.Uri, System.String, Boolean, System.Collections.Generic.IDictionary`2<System.String,System.String>)'.
I have tried to change versions of OpenSearch.Client and OpenSearch.Net.Auth.AwsSigV4 but it didn’t fix the issue.
Configuration:
I’m running this code in AWS Lambda with such packages:
<ItemGroup>
<PackageReference Include="Amazon.Lambda.Core" Version="2.1.0" />
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.1" />
<PackageReference Include="OpenSearch.Client" Version="1.3.0" />
<PackageReference Include="OpenSearch.Net.Auth.AwsSigV4" Version="1.3.0" />
</ItemGroup>
Relevant Logs or Screenshots:
Error log:
OpenSearch.Net.UnexpectedOpenSearchClientException: Method not found: 'System.String Amazon.Util.AWSSDKUtils.CanonicalizeResourcePathV2(System.Uri, System.String, Boolean, System.Collections.Generic.IDictionary`2<System.String,System.String>)'.
---> System.MissingMethodException: Method not found: 'System.String Amazon.Util.AWSSDKUtils.CanonicalizeResourcePathV2(System.Uri, System.String, Boolean, System.Collections.Generic.IDictionary`2<System.String,System.String>)'.
at OpenSearch.Net.Auth.AwsSigV4.CanonicalRequest.From(HttpRequestMessage request, ImmutableCredentials credentials, DateTime signingTime)
at OpenSearch.Net.Auth.AwsSigV4.AwsSigV4Util.SignRequest(HttpRequestMessage request, ImmutableCredentials credentials, RegionEndpoint region, DateTime signingTime, String service)
at OpenSearch.Net.Auth.AwsSigV4.AwsSigV4HttpClientHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
(i can add full log on request)