System.Exception: Unable to load bundles (HTTP 500 on initial load web UI)
See original GitHub issueAfter successful installation and startup of BTCPay server, an error occurs the first time I try to access the web UI on port 23001. HTTP 500 is returned to the web client and a System Exception occurs in the btcpay logs (logs at the end of this issue)
- Version of BTCPay Server: v1.0.3.88 (also failing for several other 1.0.3.xx versions tested)
- Deployment method: Manual Build
- Other relevant environment details: Ubuntu 16.04
To Reproduce
- Build and run BTCPay from systemctl startup script
- BTCPay uccessfully connects to NBXplorer and sees new blocks
- BTCPay starts HTTP server on 23001
- On initial HTTP get of localhost:23001, HTTP500 is returned.
- Logs show system exception in LoadBundles()
Additional details:
- BTCPay server is running as a non-administrative user.
- daemon user and group have full access to the btcpayserver build and launch directory
- It worked before “bundles”
- Crash happens even when bundlejscss is set to false
- Additional logging added to the code shows that bundlejscss is correctly read as “false” in the daemon execution.
- Daemon user has full file access to bundleconfig.json
- Even when setting 777 permisions on bundleconfig.json, it still crashes
System.Exception: Unable to load bundles.
at Meziantou.AspNetCore.BundleTagHelpers.BundleProvider.LoadBundles()
at Meziantou.AspNetCore.BundleTagHelpers.BundleProvider.GetBundle(String name)
at Meziantou.AspNetCore.BundleTagHelpers.BundleTagHelper.Process(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.TagHelpers.TagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.RunAsync(TagHelperExecutionContext executionContext)
at AspNetCore.Views_Shared__Layout.<ExecuteAsync>b__44_0() in /usr/local/src/BTCPayServer/btcpayserver/BTCPayServer/Views/Shared/_Layout.cshtml:line 27
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
at AspNetCore.Views_Shared__Layout.ExecuteAsync()
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.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResultFilterAsync[TFilter,TFilterAsync]()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at BTCPayServer.Hosting.BTCPayMiddleware.Invoke(HttpContext httpContext) in /usr/local/src/BTCPayServer/btcpayserver/BTCPayServer/Hosting/BTCpayMiddleware.cs:line 55
at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:23 (19 by maintainers)
Top Results From Across the Web
HTTP Error 500: localhost is currently unable to handle this ...
I got the following error hosing an ASP.NET Core 3.1 application on IIS 10.0 after following this guide:.
Read more >Site fails to load with HTTP 500 error
Web interface site fails to load with one of the the following HTTP 500 Exceptions: System.InvalidCastException: Unable 4245358.
Read more >What is “HTTP 500 Internal Server Error” and How to Fix It?
Error 500, also known as the Internal Server Error, is a common HTTP status code that indicates an issue on the web server's...
Read more >Server Error (500) Occurs
When working with Telerik UI for ASP.NET AJAX, a 500 server error occurs. Find other useful information in the Knowledgebase section of the...
Read more >HTTP 500 Internal Server Error: What It Means & How to Fix It
A 500 internal server error is, as the name implies, a general problem with the website's server. More than likely, this means there's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed to isolate the problem to the systemd start script. I copied from the run.sh contents and this command line worked:
The problem was all in how I launched BTCPay from systemd. I had copied the systemd from one of the tutorials, and it didn’t work.
Yep, I confirm it works for me now. 😃 @aantonop if you use
bundlejscss
totrue
(as it should be normally), you won’t have permission issue as I read the bundle.config directly from the resources of the assembly.