Open Closed

Runtime issue with 500 Internal Server Error after the application starts #7839


User avatar
0
Sergei.Gorlovetsky created
  • ABP Framework version: v8.0.0
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: An unhandled exception has occurred while executing the request. Volo.Abp.AbpException: Could not find file '/_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js'
  • Steps to reproduce the issue:

We are trying to deploy our application on Azure, the build was succeeded and the application was able to start up. But it shows a 500 internal server server and blocking the log in UI after the application starts.

The Runtime error exception is below: 2024-09-05 19:45:25.561 +00:00 [ERR] An unhandled exception has occurred while executing the request. Volo.Abp.AbpException: Could not find file '/_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js' at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.GetFileInfo(IBundlerContext context, String file) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.GetAndMinifyFileContent(IBundlerContext context, String fileName) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.GetFileContentConsideringMinification(IBundlerContext context, String fileName) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.AddFileToBundle(IBundlerContext context, StringBuilder bundleContentBuilder, String fileName) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.Bundle(IBundlerContext context) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.<>c__DisplayClass17_0.<AddToBundleCache>b__0() at System.Collections.Generic.AbpDictionaryExtensions.<>c__DisplayClass7_02.<GetOrAdd>b__0(TKey k) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at System.Collections.Generic.AbpDictionaryExtensions.GetOrAdd[TKey,TValue](ConcurrentDictionary2 dictionary, TKey key, Func1 factory) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleCache.GetOrAdd(String bundleName, Func1 factory) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.AddToBundleCache(String bundleName, IBundler bundler, List1 bundleFiles) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.GetBundleFilesAsync(BundleConfigurationCollection bundles, String bundleName, IBundler bundler) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.GetScriptBundleFilesAsync(String bundleName) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperScriptService.GetBundleFilesAsync(String bundleName) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List1 bundleItems, String bundleName) at Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpBundleTagHelperService2.ProcessAsync(TagHelperContext context, TagHelperOutput output) at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count) at AboveGoal.Blazor.Pages.Pages__Host.<ExecuteAsync>b__18_1() at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at AboveGoal.Blazor.Pages.Pages__Host.ExecuteAsync() in /home/vsts/work/1/s/src/AboveGoal.Blazor/Pages/_Host.cshtml:line 9 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)

After investigation, It seems like it can not find three files at the following path: "/_content/Volo.Saas.Host.Blazor/libs/chart/chart.min.js /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/authority-delegation.js

and we replace the Account Module with the source code.

After commenting out the lines in AbpAccountBlazorBundleContributor, we were able to get away from this issue. public override void ConfigureBundle(BundleConfigurationContext context) { //context.Files.AddIfNotContains("/_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js"); if (context.ServiceProvider.GetRequiredService<IOptions


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

    hi

    You are right. We have removed them in the new version.

    I have refunded your ticket.

    Sorry for that.

  • User Avatar
    0
    Sergei.Gorlovetsky created

    Hi, after some testing, we figure out that we are not able to access to these two pages after commenting out those two lines

    so these two files are sitting under here(this is my local env and i don't know how they are being generated)

    I am pretty sure these files are generated by abp install-libs command right? but we are not able to run it in the Account.Pro project

  • User Avatar
    0
    Sergei.Gorlovetsky created

    If you say they are removed in the newer version, does that mean these two pages are no longer available? Do you think we should upgrade our project abp version again?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will confirm this again.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    If you are using the 8.0.0 account module. These files should exist.

    /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js
    /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/authority-delegation.js
    

  • User Avatar
    0
    Sergei.Gorlovetsky created

    Seems like I added this line into my .gitignore file a while back, that's why those js files are never committed to my remote repository.

    What do you recommend on this? Should I commit them? Or is there a command I can generate them instead

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can keep it.

    You should run the abp install-libs command to restore libs. This is the default setting of an abp template project.

  • User Avatar
    0
    Sergei.Gorlovetsky created

    The thing is that the files are not able to be generated even though we already ran this command(both locally and on the pipeline). Let's say we run this command in our root folder, can it detect the module itself and install the corresponding library for them as well? If not where should we run the command for the modules? Any suggestion?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    This command generates the file from node_modules.

    https://abp.io/docs/latest/CLI#install-libs

    But these files are from the package. you don't need to run install-libs for them.

    /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js
    /_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/authority-delegation.js
    

    which mean you can reach it with below link https://localhiost:1234/_content/Volo.Abp.Account.Pro.Public.Blazor.Shared/libs/account/link-user.js

  • User Avatar
    0
    Sergei.Gorlovetsky created

    Yes indeed I am able to reach it with a get request locally, that is because i do have the files under the wwwroot folder which it is referencing to? In this case, I guess the solution is to commit these files into our repository

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok, You can commit these to your repos.

    but you can still access it if it isn't in the wwwroot folder folder.

  • User Avatar
    0
    Sergei.Gorlovetsky created

    It returns 404 once I remove them from the wwwroot folder . Did I miss something here?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Can you share a project to reproduce this?

    liming.ma@volosoft.com

    Thanks

Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13