TheAxelander / OpenBudgeteer

OpenBudgeteer is a budgeting app based on the Bucket Budgeting Principle
https://theaxelander.github.io
MIT License
759 stars 43 forks source link

Report exceptions #166

Closed andyvandesand closed 3 months ago

andyvandesand commented 1 year ago

A couple more things to add to the list.. consistent fail when opening reports page.

Cheers!

fail: Microsoft.AspNetCore.Server.Kestrel[13] Connection id "0HMT6H18NLF97", Request id "0HMT6H18NLF97:00000006": An unhandled exception was thrown by the application. System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'months') at System.DateTime.ThrowDateArithmetic(Int32 param) at System.DateTime.AddMonths(Int32 months) at OpenBudgeteer.Core.ViewModels.ReportViewModel.<>cDisplayClass6_0.b0() in /src/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs:line 286 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at OpenBudgeteer.Core.ViewModels.ReportViewModel.LoadMonthExpensesBucketAsync(Int32 month) in /src/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs:line 224 at OpenBudgeteer.Blazor.ViewModels.BlazorReportViewModel.LoadMonthExpensesBucketReportAsync() in /src/OpenBudgeteer.Blazor/ViewModels/BlazorReportViewModel.cs:line 314 at OpenBudgeteer.Blazor.ViewModels.BlazorReportViewModel.LoadDataAsync() in /src/OpenBudgeteer.Blazor/ViewModels/BlazorReportViewModel.cs:line 168 at OpenBudgeteer.Blazor.Pages.Report.OnInitializedAsync() in /src/OpenBudgeteer.Blazor/Pages/Report.razor:line 65 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) at Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.HandleException(Exception exception) at Microsoft.AspNetCore.Components.RenderTree.Renderer.HandleExceptionViaErrorBoundary(Exception error, ComponentState errorSourceOrNull) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) at Microsoft.AspNetCore.Components.RenderTree.Renderer.gProcessAsynchronousWork|43_0() at Microsoft.AspNetCore.Components.RenderTree.Renderer.WaitForQuiescence() at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderRootComponentAsync(Int32 componentId, ParameterView initialParameters) at Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.CreateInitialRenderAsync(Type componentType, ParameterView initialParameters) at Microsoft.AspNetCore.Components.Rendering.HtmlRenderer.RenderComponentAsync(Type componentType, ParameterView initialParameters) at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c111.<<InvokeAsync>b__11_0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.ViewFeatures.StaticComponentRenderer.PrerenderComponentAsync(ParameterView parameters, HttpContext httpContext, Type componentType) at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.PrerenderedServerComponentAsync(HttpContext context, ServerComponentInvocationSequence invocationId, Type type, ParameterView parametersCollection) at Microsoft.AspNetCore.Mvc.ViewFeatures.ComponentRenderer.RenderComponentAsync(ViewContext viewContext, Type componentType, RenderMode renderMode, Object parameters) at Microsoft.AspNetCore.Mvc.TagHelpers.ComponentTagHelper.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 OpenBudgeteer.Blazor.Pages.Pages__Host.ExecuteAsync() in /src/OpenBudgeteer.Blazor/Pages/_Host.cshtml:line 8 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, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100] Unhandled exception rendering component: The added or subtracted value results in an un-representable DateTime. (Parameter 'months') System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'months') at System.DateTime.ThrowDateArithmetic(Int32 param) at System.DateTime.AddMonths(Int32 months) at OpenBudgeteer.Core.ViewModels.ReportViewModel.<>cDisplayClass6_0.b__0() in /src/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs:line 286 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at OpenBudgeteer.Core.ViewModels.ReportViewModel.LoadMonthExpensesBucketAsync(Int32 month) in /src/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs:line 224 at OpenBudgeteer.Blazor.ViewModels.BlazorReportViewModel.LoadMonthExpensesBucketReportAsync() in /src/OpenBudgeteer.Blazor/ViewModels/BlazorReportViewModel.cs:line 314 at OpenBudgeteer.Blazor.ViewModels.BlazorReportViewModel.LoadDataAsync() in /src/OpenBudgeteer.Blazor/ViewModels/BlazorReportViewModel.cs:line 168 at OpenBudgeteer.Blazor.Pages.Report.OnInitializedAsync() in /src/OpenBudgeteer.Blazor/Pages/Report.razor:line 65 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111] Unhandled exception in circuit 'L4b_TRdCjk48VkUivmzXVZvDM6DA9x6AvCFItFEkGG4'. System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime. (Parameter 'months') at System.DateTime.ThrowDateArithmetic(Int32 param) at System.DateTime.AddMonths(Int32 months) at OpenBudgeteer.Core.ViewModels.ReportViewModel.<>cDisplayClass6_0.b__0() in /src/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs:line 286 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at OpenBudgeteer.Core.ViewModels.ReportViewModel.LoadMonthExpensesBucketAsync(Int32 month) in /src/OpenBudgeteer.Core/ViewModels/ReportViewModel.cs:line 224 at OpenBudgeteer.Blazor.ViewModels.BlazorReportViewModel.LoadMonthExpensesBucketReportAsync() in /src/OpenBudgeteer.Blazor/ViewModels/BlazorReportViewModel.cs:line 314 at OpenBudgeteer.Blazor.ViewModels.BlazorReportViewModel.LoadDataAsync() in /src/OpenBudgeteer.Blazor/ViewModels/BlazorReportViewModel.cs:line 168 at OpenBudgeteer.Blazor.Pages.Report.OnInitializedAsync() in /src/OpenBudgeteer.Blazor/Pages/Report.razor:line 65 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

TheAxelander commented 1 year ago

Looks like the Transaction dates create some issues. Can you share how these look like on Transaction Page? How does your first Bank Transaction look like?

andyvandesand commented 1 year ago

Is this what you're after? image

TheAxelander commented 1 year ago

Yes. Just what I noticed: Could it be that all you Transactions are positive, even the expenses? Only the Income Transaction should be positive, everything else should have negative numbers. Like below:

image

TheAxelander commented 1 year ago

BTW: For the next version there will be an improvement on the Bucket Selection on the Transaction Page. That might help you also from what I see how you name your Buckets.

This was implemented with #112

andyvandesand commented 1 year ago

Awesome, looking forward to it. Once you finalise the database changes I’m keen to give it a shot.

From: Alexander Preibisch @.> Sent: Sunday, August 27, 2023 4:34 PM To: TheAxelander/OpenBudgeteer @.> Cc: andyvandesand @.>; Author @.> Subject: Re: [TheAxelander/OpenBudgeteer] Report exceptions (Issue #166)

BTW: For the next version there will be an improvement on the Bucket Selection on the Transaction Page. That might help you also from what I see how you name your Buckets.

This was implemented with #112 https://github.com/TheAxelander/OpenBudgeteer/issues/112

— Reply to this email directly, view it on GitHub https://github.com/TheAxelander/OpenBudgeteer/issues/166#issuecomment-1694606848 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APK7D3MDQIHK7M6GVSON743XXMBARANCNFSM6AAAAAA4ADLO4U . You are receiving this because you authored the thread. https://github.com/notifications/beacon/APK7D3I3JUP7CPANCQX443LXXMBARA5CNFSM6AAAAAA4ADLO4WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFAGTAA.gif Message ID: @. @.> >

andyvandesand commented 1 year ago

No, but apparently opposite – income is negative, everything else positive. I assume that should then work out fine? That’s just how it imports from my bank statements.

From: Alexander Preibisch @.> Sent: Sunday, August 27, 2023 4:31 PM To: TheAxelander/OpenBudgeteer @.> Cc: andyvandesand @.>; Author @.> Subject: Re: [TheAxelander/OpenBudgeteer] Report exceptions (Issue #166)

Yes. Just what I noticed: Could it be that all you Transactions are positive, even the expenses? Only the Income Transaction should be positive, everything else should have negative numbers. Like below:

https://user-images.githubusercontent.com/17849665/263516797-e0ba8852-a72f-4aef-b3ba-07c8ffae97eb.png

— Reply to this email directly, view it on GitHub https://github.com/TheAxelander/OpenBudgeteer/issues/166#issuecomment-1694606028 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APK7D3KQQSBUTFOWKALA76TXXMASNANCNFSM6AAAAAA4ADLO4U . You are receiving this because you authored the thread. https://github.com/notifications/beacon/APK7D3JIMIKMQHLBNDYGDKDXXMASNA5CNFSM6AAAAAA4ADLO4WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFAGRMY.gif Message ID: @. @.> >

TheAxelander commented 1 year ago

That's weired from your bank, would the first time seeing this. I didn't tested such a case but you will definitely run into issued as some consistency checks and other calculations will fail

andyvandesand commented 1 year ago

Oh ok. Just thinking I may have selected the wrong fields for debit & credit, I just matched them to the same labels from my bank statements but maybe the other way might make more sense.

Consistency wise though, it shouldn’t matter if everything is just multiplied by -1?

From: Alexander Preibisch @.> Sent: Sunday, August 27, 2023 4:45 PM To: TheAxelander/OpenBudgeteer @.> Cc: andyvandesand @.>; Author @.> Subject: Re: [TheAxelander/OpenBudgeteer] Report exceptions (Issue #166)

That's weired from your bank, would the first time seeing this. I didn't tested such a case but you will definitely run into issued as some consistency checks and other calculations will fail

— Reply to this email directly, view it on GitHub https://github.com/TheAxelander/OpenBudgeteer/issues/166#issuecomment-1694608815 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APK7D3NFJQENYXQ742N4Z53XXMCJJANCNFSM6AAAAAA4ADLO4U . You are receiving this because you authored the thread. https://github.com/notifications/beacon/APK7D3OIOMQKFV7BEBTB3UDXXMCJJA5CNFSM6AAAAAA4ADLO4WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFAGW26.gif Message ID: @. @.> >

TheAxelander commented 1 year ago

As I said there are various checks and calculations happening in the background which expect certain data constellations. To give an example:

There is a Bucket Type called "Expenses every X months". The idea is so save money every month and once the target month comes all of the money in the Bucket can be consumed by the respective expense. The assumption is that the balance of this Bucket is increasing month by month. If you now calculate everything with -1 then you will never reach the target.

And such kind of things you have in various areas in the application.

andyvandesand commented 1 year ago

Yeah right, fair enough. Just seeing how I can change that, should be easy enough to change.

From: Alexander Preibisch @.> Sent: Sunday, August 27, 2023 5:01 PM To: TheAxelander/OpenBudgeteer @.> Cc: andyvandesand @.>; Author @.> Subject: Re: [TheAxelander/OpenBudgeteer] Report exceptions (Issue #166)

As I said there are various checks and calculations happening in the background which expect certain data constellations. To give an example:

There is a Bucket Type called "Expenses every X months". The idea is so save money every month and once the target month comes all of the money in the Bucket can be consumed by the respective expense. The assumption is that the balance of this Bucket is increasing month by month. If you now calculate everything with -1 then you will never reach the target.

And such kind of things you have in various areas in the application.

— Reply to this email directly, view it on GitHub https://github.com/TheAxelander/OpenBudgeteer/issues/166#issuecomment-1694611949 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APK7D3OBABVJR6JCHCCWAM3XXMED5ANCNFSM6AAAAAA4ADLO4U . You are receiving this because you authored the thread. https://github.com/notifications/beacon/APK7D3J5LBJFDHA3QFOM56DXXMED5A5CNFSM6AAAAAA4ADLO4WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFAG462.gif Message ID: @. @.> >

TheAxelander commented 1 year ago

As you are using MySql I think the easiest way is to open the database e.g. via pypMyAdmin and write a SQL Query to multiply everything in BankTransaction and BucketMovement with -1 instead of changing everything within the UI

andyvandesand commented 1 year ago

Yep just done that. Thanks for all your support!

From: Alexander Preibisch @.> Sent: Sunday, August 27, 2023 5:08 PM To: TheAxelander/OpenBudgeteer @.> Cc: andyvandesand @.>; Author @.> Subject: Re: [TheAxelander/OpenBudgeteer] Report exceptions (Issue #166)

As you are using MySql I think the easiest way is to open the database e.g. via pypMyAdmin and write a SQL Query to multiply everything in BankTransaction and BucketMovement with -1 instead of changing everything within the UI

— Reply to this email directly, view it on GitHub https://github.com/TheAxelander/OpenBudgeteer/issues/166#issuecomment-1694613686 , or unsubscribe https://github.com/notifications/unsubscribe-auth/APK7D3N4HDRDJ3A3VQBN543XXME5VANCNFSM6AAAAAA4ADLO4U . You are receiving this because you authored the thread. https://github.com/notifications/beacon/APK7D3IU6Q465RSROXLTX7LXXME5VA5CNFSM6AAAAAA4ADLO4WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFAHALM.gif Message ID: @. @.> >