Open Closed

Error when running Blazor WASM in deployed environment #8456


User avatar
0
Spospisil created
  • ABP Framework version: v7.3.0
  • UI Type: Blazor WASM
  • Database System: EF Core (PostgreSQL
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

We are running a Blazor WASM app hosed in the public MVC app generated by ABP Suite. In our local docker environment we don't have any issues running the Blazor WASM environment but when we deploy it to our Azure, Kubernetes environment we get the below error. While we won't be able to re-produce the issue for you, my question is really on how best to troubleshoot this error. What are the things we can look at? We're already look at the logs and various other things in the debug tools of the browser.

The error appears to be happening api/abp/applicatioon-configuration* https endpoint as the screenshot at the end of this post if from when we run locally but when we run in the deployed environment it never gets that far as shown in the 2nd screenshot

System.AggregateException: AggregateException\_ctor\_DefaultMessage (An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo.Abp.AspNetCore.Components.WebAssembly.AbpAspNetCoreComponentsWebAssemblyModule, Volo.Abp.AspNetCore.Components.WebAssembly, Version=7.3.0.0, Culture=neutral, PublicKeyToken=null: Remote service 'AbpMvcClient' was not found and there is no default configuration.. See the inner exception for details.)
\-\-\-\> Volo\.Abp\.AbpInitializationException: An error occurred during the initialize Volo\.Abp\.Modularity\.OnApplicationInitializationModuleLifecycleContributor phase of the module Volo\.Abp\.AspNetCore\.Components\.WebAssembly\.AbpAspNetCoreComponentsWebAssemblyModule\, Volo\.Abp\.AspNetCore\.Components\.WebAssembly\, Version=7\.3\.0\.0\, Culture=neutral\, PublicKeyToken=null: Remote service 'AbpMvcClient' was not found and there is no default configuration\.\. See the inner exception for details\.
\-\-\-\> Volo\.Abp\.AbpException: Remote service 'AbpMvcClient' was not found and there is no default configuration\.
at Volo.Abp.Http.Client.RemoteServiceConfigurationDictionary.GetConfigurationOrDefault(String name)
at Volo.Abp.Http.Client.RemoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync(String name)
at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.<RequestAsync>d__36[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=7.3.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.d\_\_35`1[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=7.3.0.0, Culture=neutral, PublicKeyToken=null],[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto, Volo.Abp.AspNetCore.Mvc.Contracts, Version=7.3.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext() at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase`1.d\_\_33\`1[[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.IAbpApplicationConfigurationAppService, Volo.Abp.AspNetCore.Mvc.Contracts, Version=7.3.0.0, Culture=neutral, PublicKeyToken=null],[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto, Volo.Abp.AspNetCore.Mvc.Contracts, Version=7.3.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies.AbpApplicationConfigurationClientProxy.GetAsync(ApplicationConfigurationRequestOptions options)
at Volo.Abp.AspNetCore.Components.WebAssembly.WebAssemblyCachedApplicationConfigurationClient.InitializeAsync()
at Volo.Abp.AspNetCore.Components.WebAssembly.AbpAspNetCoreComponentsWebAssemblyModule.OnApplicationInitializationAsync(ApplicationInitializationContext context)
at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.InitializeAsync(ApplicationInitializationContext context, IAbpModule module)
at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
Exception\_EndOfInnerExceptionStack
at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
at Volo.Abp.AbpApplicationBase.InitializeModulesAsync()
at Volo.Abp.AbpApplicationWithExternalServiceProvider.InitializeAsync(IServiceProvider serviceProvider)
at Microsoft.AspNetCore.Components.WebAssembly.Hosting.AbpWebAssemblyHostBuilderExtensions.InitializeApplicationAsync(IAbpApplicationWithExternalServiceProvider application, IServiceProvider serviceProvider)
at CFDataSystems.StructureCloud.Blazor.Program.Main(String[] args) in /src/StructureCloud.NET/aspnet-core/src/CFDataSystems.StructureCloud.Blazor/Program.cs:line 19
Exception\_EndOfInnerExceptionStack
callEntryPoint @ global.js?\_v=638653629455785961:1
await in callEntryPoint
Vt @ global.js?\_v=638653629455785961:1
await in Vt
(anonymous) @ global.js?\_v=638653629455785961:1
(anonymous) @ global.js?\_v=638653629455785961:1

Screenshot from our local deployment

Screenshot from our deployed environment


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

    hi

    Please check the appsettings.jons content in different environments.

    Also can you share your website URL? so I can check the error online.

    Thanks. liming.ma@volosoft.com

  • User Avatar
    0
    Spospisil created

    Can you be more specific as to which appsettings.json file I should be checking, since I've indicated in the original ticket that we are using a tiered solution?

    The url is https://demo2.structurecloud.com/

  • User Avatar
    0
    Spospisil created

    Here's what the appsettings.json file looks like in the for the /Blazor app for the deployed environment and below that is the one for our local environment which locally everything works.

    { "App": { "SelfUrl": "https://demo2.structurecloud.com/Blazor" }, "AuthServer": { "Authority": "https://demo2.structurecloud.com/Auth", "ClientId": "StructureCloud_Blazor", "ResponseType": "code" }, "RemoteServices": { "Default": { "BaseUrl": "https://demo2.structurecloud.com" }, "AbpAccountPublic": { "BaseUrl": "https://demo2.structurecloud.com" } }, "AbpCli": { "Bundle": { "Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */ "Name": "global", "Parameters": { "LeptonXTheme.Layout": "side-menu" } } } }

    Local appsettings.json { "AuthServer": { "Authority": "https://localhost.structurecloud.com/Auth", "ClientId": "StructureCloud_Blazor", "ResponseType": "code" }, "RemoteServices": { "Default": { "BaseUrl": "https://localhost.structurecloud.com" }, "AbpAccountPublic": { "BaseUrl": "https://localhost.structurecloud.com" } }, "AbpCli": { "Bundle": { "Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */ "Name": "global", "Parameters": { "LeptonXTheme.Layout": "side-menu"

      }
    }
    

    } }

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have checked your https://demo2.structurecloud.com/Blazor

    The blazor wasm app can't get the appsettings.json file.

    Below are requests of your Blazor app. If you check the docker environment. you should see appsettings.json request.

    Do you have appsettings.json file in the wwwroot folder?

    You have to have this file during build process.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 30, 2024, 14:53