question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception thrown when navigating to Pull Payments in menu

See original GitHub issue

Describe the bug Navigating to pull payments menu item generates a blank page even when a wallet is fully setup for a store.

To Reproduce the bug Steps to reproduce the reported bug:

  1. On a device running EmbassyOS v0.3.0.2, install BTC Pay Server and it’s dependencies from the Marketplace at v1.4.7
  2. Wait until the “Explorer Synced” health check passes to ensure NBXplorer is fully synced with the Bitcoin Core node.
  3. Launch the UI from the EmbassyOS Services Dashboard
  4. Create an account and login
  5. Create a store
  6. Set up a wallet for that store
  7. Navigate to the Menu > Payments > Pull Payments
  8. See screen is blank with a 500 Internal Server Error failed GET request (screenshot)

Expected behavior

If a wallet is setup for a store, accessing the pull payments section should display, notifying the user if any additional setup needs to occur rather than the page crashing.

Screenshots Screen Shot 2022-04-14 at 11 32 53 AM

Your BTCPay Environment (please complete the following information):

Logs

2022-04-14T17:29:56.728669Z fail: Microsoft.AspNetCore.Server.Kestrel: Connection id "0HMGU7FQGUPEV", Request id "0HMGU7FQGUPEV:00000002": An unhandled exception was thrown by the application.
2022-04-14T17:29:56.729215Z System.InvalidOperationException: The LINQ expression 'DbSet()
2022-04-14T17:29:56.729667Z     .Where(p => p.StoreId == __storeId_0)
2022-04-14T17:29:56.729974Z     .OrderByDescending(p => p.StartDate)
2022-04-14T17:29:56.730193Z     .Where(p => !(p.Archived) && p.EndDate != null ? p.EndDate > (DateTimeOffset?)DateTimeOffset.UtcNow : True && p.StartDate <= DateTimeOffset.UtcNow)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
2022-04-14T17:29:56.730380Z    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.g__CheckTranslated|15_0(ShapedQueryExpression translated, <>c__DisplayClass15_0& )
2022-04-14T17:29:56.730509Z    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
2022-04-14T17:29:56.730641Z    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
2022-04-14T17:29:56.730769Z    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
2022-04-14T17:29:56.730934Z    at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
2022-04-14T17:29:56.731163Z    at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
2022-04-14T17:29:56.731421Z    at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
2022-04-14T17:29:56.731599Z    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
2022-04-14T17:29:56.731722Z    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass12_0`1.b__0()
2022-04-14T17:29:56.731880Z    at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
2022-04-14T17:29:56.732585Z    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query, CancellationToken cancellationToken)
2022-04-14T17:29:56.732927Z    at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression, CancellationToken cancellationToken)
2022-04-14T17:29:56.733212Z    at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.GetAsyncEnumerator(CancellationToken cancellationToken)
2022-04-14T17:29:56.733428Z    at System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable`1.GetAsyncEnumerator()
2022-04-14T17:29:56.733616Z    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
2022-04-14T17:29:56.733755Z    at BTCPayServer.Controllers.UIStorePullPaymentsController.PullPayments(String storeId, PullPaymentState pullPaymentState, Int32 skip, Int32 count, String sortOrder) in /source/BTCPayServer/Controllers/UIStorePullPaymentsController.PullPayments.cs:line 218
2022-04-14T17:29:56.733883Z    at BTCPayServer.Controllers.UIStorePullPaymentsController.PullPayments(String storeId, PullPaymentState pullPaymentState, Int32 skip, Int32 count, String sortOrder) in /source/BTCPayServer/Controllers/UIStorePullPaymentsController.PullPayments.cs:line 255
2022-04-14T17:29:56.733996Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
2022-04-14T17:29:56.734189Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
2022-04-14T17:29:56.734369Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2022-04-14T17:29:56.734491Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
2022-04-14T17:29:56.734597Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2022-04-14T17:29:56.734689Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
2022-04-14T17:29:56.734790Z --- End of stack trace from previous location ---
2022-04-14T17:29:56.734990Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2022-04-14T17:29:56.735140Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
2022-04-14T17:29:56.735259Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2022-04-14T17:29:56.735350Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter()
2022-04-14T17:29:56.735444Z --- End of stack trace from previous location ---
2022-04-14T17:29:56.735549Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
2022-04-14T17:29:56.735655Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2022-04-14T17:29:56.735746Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
2022-04-14T17:29:56.735873Z --- End of stack trace from previous location ---
2022-04-14T17:29:56.736072Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2022-04-14T17:29:56.736237Z    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
2022-04-14T17:29:56.736348Z    at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
2022-04-14T17:29:56.736463Z    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
2022-04-14T17:29:56.736579Z    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
2022-04-14T17:29:56.736692Z    at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
2022-04-14T17:29:56.736831Z    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
2022-04-14T17:29:56.736938Z    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
2022-04-14T17:29:56.737051Z    at BTCPayServer.Hosting.BTCPayMiddleware.Invoke(HttpContext httpContext) in /source/BTCPayServer/Hosting/BTCpayMiddleware.cs:line 100
2022-04-14T17:29:56.737180Z    at BTCPayServer.Hosting.GreenfieldMiddleware.Invoke(HttpContext httpContext) in /source/BTCPayServer/Hosting/GreenfieldMiddleware.cs:line 50
2022-04-14T17:29:56.737291Z    at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
2022-04-14T17:29:56.737391Z    at BTCPayServer.Hosting.HeadersOverrideMiddleware.Invoke(HttpContext httpContext) in /source/BTCPayServer/Hosting/HeadersOverrideMiddleware.cs:line 30
2022-04-14T17:29:56.737512Z    at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Additional context

Somewhat related, but different error message and condition: https://github.com/btcpayserver/btcpayserver/issues/3084

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
elvececommented, May 5, 2022

@elvece can you ask them to update? I cannot replicate this on our official deployment methods.

Sure, will test with latest version release and provide more info.

0reactions
elvececommented, Sep 5, 2022

@leesalminen Yes, this instance is running with sqlite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cash and Loss Management Reports Overview
Navigate to Exception Reports; Voided Orders; Removed Items ... a receipt of a voided payment via text or email by selecting the Receipt...
Read more >
Router Exception Handling
This blog discusses Router Exception handling, Error Resolving, a brief idea about custom exception handlers, and how we handle when a ...
Read more >
Find where rethrown exception was originally thrown using ...
1) Click on the 'Debug' menu item 2) Click 'Exceptions. ... let the built-in code line parser in Visual Studio to provide the...
Read more >
Exception Handling Mechanism
Learn about exception handling in OutSystems. ... Handler in your application flow to inform and allow the end user to continue to navigate....
Read more >
Handle Exceptions - OutSystems 11 Documentation
When an exception is raised, the execution of the application flow is interrupted. In OutSystems you can handle exceptions in your application ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found