gaul / s3proxy

Access other storage backends via the S3 API
Apache License 2.0
1.78k stars 231 forks source link

GetObjectAsync(request) Failure ETAG #555

Open kevin-miller-13 opened 1 year ago

kevin-miller-13 commented 1 year ago

When I make a call to retrieve an Azure blob I get : "Specified argument was out of the range of valid values. (Parameter 'hex') at Amazon.Util.AWSSDKUtils.HexStringToBytes(String hex)"

Upon investigation I traced it to the amazons3client checking for an Etag that should have an even number of hex digits.

Help???

gaul commented 1 year ago

Can you be more specific about how this error occurs, e.g., which SDK you use and the full stack trace?

kevin-miller-13 commented 1 year ago

Sure, sorry should have done so already:

CODE I RAN: GetObjectRequest request = new GetObjectRequest { BucketName = "frombucket",//frombucketName, Key = "customfilename111" }; var response = _s3ProxyClient.S3Proxyclient.GetObjectAsync(request).GetAwaiter().GetResult();

SDK : AWSSDK.S3 (3.7.205.3)

ERROR IS HERE (Think it's thrown because of the non even ETAG (17hex chars) returned by Azure): image

image

STACK TRACE (from postman) : System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'hex') at Amazon.Util.AWSSDKUtils.HexStringToBytes(String hex) at Amazon.S3.Internal.AmazonS3ResponseHandler.ProcessResponseHandlers(IExecutionContext executionContext) at Amazon.S3.Internal.AmazonS3ResponseHandler.PostInvoke(IExecutionContext executionContext) at Amazon.S3.Internal.AmazonS3ResponseHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.Signer.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.S3.Internal.AmazonS3ExceptionHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext) at MyWebApp.Classes.CloudService.DownloadDocumentByNameAsync(String name, Boolean shouldThrow) in C:\Temp\Kubernetes3\KubernetesTestApp\Classes\CloudService.cs:line 59 at TestStorageApp.Controllers.S3ProxyController.Download() in C:\Temp\Kubernetes3\KubernetesTestApp\S3ProxyController.cs:line 36 at Microsoft.Extensions.Internal.ObjectMethodExecutor.<>cDisplayClass33_0.b0(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.VoidResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.gAwaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

HEADERS

Accept: / Host: localhost:5226 User-Agent: PostmanRuntime/7.32.3 Accept-Encoding: gzip, deflate, br Cache-Control: no-cache Content-Type: multipart/form-data; boundary=--------------------------681190203900673980201566 Content-Length: 175 Postman-Token: c95945f4-c08f-49f8-8d87-cfee5b9efc91

ZHAO-SHI-HAO commented 2 days ago

@gaul I have same exception occur, and when I try azureblob-sdk, it behaves the same. Will it be repaired in the future?