Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetObjectAsync(request) Failure ETAG #555

Open
kevin-miller-13 opened this issue Sep 29, 2023 · 2 comments
Open

GetObjectAsync(request) Failure ETAG #555

kevin-miller-13 opened this issue Sep 29, 2023 · 2 comments
Labels

Comments

@kevin-miller-13
Copy link

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
Copy link
Owner

gaul commented Sep 29, 2023

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

@gaul gaul added the needinfo label Sep 29, 2023
@kevin-miller-13
Copy link
Author

kevin-miller-13 commented Oct 2, 2023

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.<>c__DisplayClass33_0.b__0(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.g__Awaited|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.g__Awaited|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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants