Open Closed

File Downlead Not working as a When users switches the Account using Linked Accounts - File Management in Microservice #4653


User avatar
0
raju.thinnaluri@gmail.com created

Hi,

We are using Microservice Modal.

Added File Management module to the one of custom service. File upload and download working fine as a SaaS. But as a Tenant user uploading working fine. Data inserting properly in Database with TenantId and disapplying list in UI properly. But unable to download the file as a Tenant User.

This issue occurs when saas user switching as tenant user using "Linked Accounts"

This File downloads working only with initially logged in user. for all other switching users not working.

To which account the user logged in initially it's working only for that account subsequent switching account file downloading not working.

ABP Framework version: v5.3.4

UI type: Blazor

DB provider: EF Core

Tiered (MVC): yes

Exception message and stack trace:

Steps to reproduce the issue:"


11 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will confirm that.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the error request logs. Thanks

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    This File downloads working only with initially logged in user. for all other switching users not working. when ever i switching the accounts using linked accounts.

    To which account the user logged in initially it's working only for that account subsequent switching account file downloading not working.

    {"EventId":{"Id":1,"Name":"ActionMethodExecuting"},"SourceContext":"Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker","ActionId":"191112e8-6da4-4542-a101-9d0d11a9a276","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","CorrelationId":"8d1a1b4c4b3e4990bc47749542ef9403","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    [Version: 1.0.0.0] 2023-03-08 16:35:22.224 +08:00 [ERR] ---------- RemoteServiceErrorInfo ----------
    {
      "code": null,
      "message": "There is no entity FileDescriptor with id = 24dec07d-fa37-53cb-c5d4-3a09ccc2f489!",
      "details": null,
      "data": null,
      "validationErrors": null
    }
    
    {"SourceContext":"Volo.Abp.AspNetCore.Mvc.ExceptionHandling.AbpExceptionFilter","ActionId":"191112e8-6da4-4542-a101-9d0d11a9a276","ActionName":"Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","CorrelationId":"8d1a1b4c4b3e4990bc47749542ef9403","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    [Version: 1.0.0.0] 2023-03-08 16:35:22.224 +08:00 [ERR] There is no such an entity. Entity type: Volo.FileManagement.Files.FileDescriptor, id: 24dec07d-fa37-53cb-c5d4-3a09ccc2f489
    {"SourceContext":"Volo.Abp.AspNetCore.Mvc.ExceptionHandling.AbpExceptionFilter","ActionId":"191112e8-6da4-4542-a101-9d0d11a9a276","ActionName":"Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","CorrelationId":"8d1a1b4c4b3e4990bc47749542ef9403","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    Volo.Abp.Domain.Entities.EntityNotFoundException: There is no such an entity. Entity type: Volo.FileManagement.Files.FileDescriptor, id: 24dec07d-fa37-53cb-c5d4-3a09ccc2f489
       at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository`3.GetAsync(TKey id, Boolean includeDetails, CancellationToken cancellationToken)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Volo.FileManagement.Files.FileDescriptorAppService.GetAsync(Guid id)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
       at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
       at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
       at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
       at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
       at Volo.FileManagement.Files.FileDescriptorController.DownloadAsync(Guid id, String token)
       at lambda_method1594(Closure , Object )
       at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    [Version: 1.0.0.0] 2023-03-08 16:35:22.233 +08:00 [INF] Executing "ObjectResult", writing value of type '"Volo.Abp.Http.RemoteServiceErrorResponse"'.
    {"EventId":{"Id":1,"Name":"ObjectResultExecuting"},"SourceContext":"Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor","ActionId":"191112e8-6da4-4542-a101-9d0d11a9a276","ActionName":"Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","CorrelationId":"8d1a1b4c4b3e4990bc47749542ef9403","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    [Version: 1.0.0.0] 2023-03-08 16:35:22.234 +08:00 [INF] Executed action "Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)" in 56.0374ms
    {"EventId":{"Id":2,"Name":"ActionExecuted"},"SourceContext":"Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","CorrelationId":"8d1a1b4c4b3e4990bc47749542ef9403","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    [Version: 1.0.0.0] 2023-03-08 16:35:22.234 +08:00 [INF] Executed endpoint '"Volo.FileManagement.Files.FileDescriptorController.DownloadAsync (Volo.FileManagement.HttpApi)"'
    {"EventId":{"Id":1,"Name":"ExecutedEndpoint"},"SourceContext":"Microsoft.AspNetCore.Routing.EndpointMiddleware","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","CorrelationId":"8d1a1b4c4b3e4990bc47749542ef9403","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    [Version: 1.0.0.0] 2023-03-08 16:35:22.490 +08:00 [INF] Request finished HTTP/1.1 GET https://localhost:44478/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489?token=504d1a88-ac28-4402-b8ed-6152903c3ff2 - 0 - 404 - application/json;+charset=utf-8 317.1533ms
    {"ElapsedMilliseconds":317.1533,"StatusCode":404,"ContentType":"application/json; charset=utf-8","ContentLength":null,"Protocol":"HTTP/1.1","Method":"GET","Scheme":"https","Host":"localhost:44478","PathBase":"","Path":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","QueryString":"?token=504d1a88-ac28-4402-b8ed-6152903c3ff2","EventId":{"Id":2},"SourceContext":"Microsoft.AspNetCore.Hosting.Diagnostics","RequestId":"0HMOVLRVKST1R:0000000A","RequestPath":"/api/file-management/file-descriptor/download/24dec07d-fa37-53cb-c5d4-3a09ccc2f489","ConnectionId":"0HMOVLRVKST1R","Application":"NaviX.UnifiedDigitalPlatform.DocumentService.HttpApi.Host"}
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will share a solution asap.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please override the DownloadAsync method of FileDescriptorAppService.

    [AllowAnonymous]
    public virtual async Task<IRemoteStreamContent> DownloadAsync(Guid id, string token)
    {
        var downloadToken = await DownloadTokenCache.GetAsync(token);
        if (downloadToken == null || downloadToken.FileDescriptorId != id)
        {
            throw new AbpAuthorizationException("Invalid download token: " + token);
        }
    
        FileDescriptor fileDescriptor;
        using (DataFilter.Disable<IMultiTenant>())
        {
            fileDescriptor = await FileDescriptorRepository.GetAsync(id);
        }
        var stream = await BlobContainer.GetAsync(id.ToString());
        return new RemoteStreamContent(stream, fileDescriptor?.Name);
    }
    
  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    I Override the method. but still not working, might be it's not taking the override method.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Is this id exists in the database?

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    Hi,

    Yes available in Database.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Let's check it remotely..

    https://us05web.zoom.us/j/86811482500?pwd=SW0zYzNpNFFqZnllbnJOb1JLM2xmQT09

  • User Avatar
    0
    raju.thinnaluri@gmail.com created

    hi

    Let's check it remotely..

    https://us05web.zoom.us/j/86811482500?pwd=SW0zYzNpNFFqZnllbnJOb1JLM2xmQT09

    I joined the call

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://us05web.zoom.us/j/83439435626?pwd=bXRleVd0SVF5LzM3YlVZdjhrK0VnQT09

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11