btcpayserver: System.Exception: Unable to load bundles (HTTP 500 on initial load web UI)
After 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)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 23 (19 by maintainers)
Commits related to this issue
- Update bundle minifier, trying to fix (#710 with bundle on) — committed to btcpayserver/btcpayserver by NicolasDorier 5 years ago
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
bundlejscsstotrue(as it should be normally), you won’t have permission issue as I read the bundle.config directly from the resources of the assembly.So are you now:https://i.giphy.com/media/Ae7SI3LoPYj8Q/giphy.webp ?
@aantonop I tried brand new VM, manual install and it just worked.
Install Bitcoin Core 0.17.0
Install .NET Core SDK 2.1: On my ubuntu 16.04: (See those instructions for different OS).
Install NBXplorer
Install BTCPayServer
Run bitcoind:
Run nbxplorer:
Run BTCPayServer:
Now you can browse your server on port 8080.
Can you repro this?
OK, missing reference to
BundlerMinifier.Corewas what was causing the problem in some cases I guess:https://github.com/btcpayserver/btcpayserver/commit/0578a692db119a4297ff168009fb46a77664382b#diff-6a9de8749b532027dc48bb5be3e83b03R39
If you pull and build with this latest commit @aantonop - it should work. Plus with fix @NicolasDorier has provided, we are now good with upgrading to .NET Core 2.2 when it’s time. ❤️