Open Closed

Unable to save file on S3 bucket with dots in the name and no acceleration #1362


User avatar
0
andreasimeonegroovejones created
  • ABP Framework version: v4.2.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:

2021-05-19 16:20:49.979 +00:00 [ERR] The specified bucket does not exist Amazon.S3.AmazonS3Exception: The specified bucket does not exist ---> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown. at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken) at Amazon.Runtime.Internal.HttpHandler1.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.RedirectHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext) at Amazon.S3.Internal.AmazonS3ResponseHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) --- End of inner exception stack trace --- at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception) at Amazon.Runtime.Internal.ExceptionHandler1.Handle(IExecutionContext executionContext, Exception exception) at Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext executionContext, Exception exception) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.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 Volo.Abp.BlobStoring.Aws.AwsBlobProvider.SaveAsync(BlobProviderSaveArgs args) at Volo.Abp.BlobStoring.BlobContainer.SaveAsync(String name, Stream stream, Boolean overrideExisting, CancellationToken cancellationToken) at WindfallServer.CustomBlobContainer.CustomBlobContainer1.SaveAndGetUrlAsync(String name, Stream stream, Boolean overrideExisting, CancellationToken cancellationToken) in D:\Git\BI Worldwide\Server\Solution\src\WindfallServer.Application\CustomBlobContainer\CustomBlobContainer.cs:line 39 at WindfallServer.Awards.AwardAppService.UploadImage(String name, IFormFile file) in D:\Git\BI Worldwide\Server\Solution\src\WindfallServer.Application\Awards\AwardAppService.cs:line 89 at WindfallServer.Awards.AwardAppService.UpdateAsync(Guid id, AwardUpdateDto input) in D:\Git\BI Worldwide\Server\Solution\src\WindfallServer.Application\Awards\AwardAppService.cs:line 80 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at WindfallServer.Web.Pages.Awards.EditModalModel.OnPostAsync() in D:\Git\BI Worldwide\Server\Solution\src\WindfallServer.Web\Pages\Awards\EditModal.cshtml.cs:line 37 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()

  • Steps to reproduce the issue:

  • Create a new project

  • configure BlobContainer as follow:

Configure<AbpBlobStoringOptions>(options =>
            {
                options.Containers.ConfigureDefault(container =>
                {
                    container.UseAws(Aws =>
                    {
                        Aws.UseCredentials = true;
                        Aws.Region = "us-east-1";
                        //Aws.ContainerName = "file-storage"; // This is not working: must define name on container implementation
                    });
                });
            });
  • create an implementation of the Container to bind the S3 bucket name
    [BlobContainerName("images.dev.domainname.com")]
    public class ServerS3Container
    {  }
  • try to save a file

NOTE:

The module seems unable to find a bucket with dots in it's name. I saw in the documentation that dots in the name are not supported ONLY if the bucket uses the Amazon S3 Transfer Acceleration, but my buckets doesn't use it.

It is important for us to have dots in the name of our buckes as it is a mandatory requirement for AWS to be able to attach a custom domain for static hosting.

This is a blocking issue that we need to fix as soon as possible as this is preventing us to deploy the server.

Thanks

A


5 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    See https://docs.abp.io/en/abp/latest/Blob-Storing-Aws#configuration

    try:

    options.Containers.ConfigureDefault(container =>
    {
        container.UseAws(Aws =>
        {
            //...
            Aws.CreateContainerIfNotExists = true;
        });
    });
    
  • User Avatar
    0
    andreasimeonegroovejones created

    Hello Liang,

    Yes, if I let it create a container, it creates one on my AWS without any dots, which is not ok since all the configurations (from hosting to CDN) are made on the bucket with the dots in the name.

  • User Avatar
    0
    andreasimeonegroovejones created

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    See: https://github.com/abpframework/abp/pull/9117

    For now, you can create MyAwsBlobNamingNormalizer to replace the AwsBlobNamingNormalizer

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 05, 2024, 12:19