Base solution for your next web application
Open Closed

Xamarin App crashes after 24-48hrs #9680


User avatar
0
Jorahealth created

Please answer the following questions before submitting an issue.

  • What is your product version?
  • 8.9.2
  • What is your product type (Angular or MVC)?
  • Angular
  • What is product framework type (.net framework or .net core)? .net core

Xamanrin App: Hi we have an issue with our Xamarin Android App, We have enabled push notification on this and the user stays logged in all the time. The App stops working after about 24-48hrs it just crashes when we click on the icon. We have to clear data in mobile and then it works, but then have to re-enter trenancy and log back in.

Could you advice how to debug this issue, is there a mobile application log? Is it due to Auth token expiring??


31 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Jorahealth

    Do you have any error log for this problem ?

    Thanks,

  • User Avatar
    0
    Jorahealth created

    Hi @ismcagdas Exception Log from Mobile

    {Flurl.Http.FlurlHttpException: Call failed with status code 500 (Internal Server Error): POST http://10.0.2.2:22742/api/TokenAuth/RefreshToken at Flurl.Http.FlurlRequest.HandleExceptionAsync (Flurl.Http.HttpCall call, System.Exception ex, System.Threading.CancellationToken token) [0x00105] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x003a1] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x004bb] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.HttpResponseMessageExtensions.ReceiveJson[T] (System.Threading.Tasks.Task1[TResult] response) [0x0006e] in <7be22aadf26d4808b35d54cc18db202b>:0 at Decisively.ApiClient.AccessTokenManager.RefreshTokenAsync () [0x000a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\ApiClient\AccessTokenManager.cs:93 at Decisively.Configuration.UserConfigurationService.RefreshAccessTokenAndSendRequestAgain () [0x0003e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:63 at Decisively.Configuration.UserConfigurationService.GetAuthenticatedUserConfig () [0x00178] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:46 at Decisively.Configuration.UserConfigurationService.GetAsync (System.Boolean isUserLoggedIn) [0x00036] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:27 at Decisively.ViewModels.Base.UserConfigurationManager+<>c__DisplayClass4_0.<GetAsync>b__0 () [0x0002e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\ViewModels\Base\UserConfigurationManager.cs:41 at Decisively.Core.Threading.WebRequestExecuter.Execute[TResult] (System.Func1[TResult] func, System.Func2[T,TResult] successCallback, System.Func2[T,TResult] failCallback, System.Action finallyCallback) [0x002a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\Core\Threading\WebRequestExecuter.cs:53 }


    API Error Log

    INFO 2020-09-25 14:59:19,169 [94 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST http://localhost:22742/api/TokenAuth/RefreshToken?refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aX.IVAwaBWY5IGKkSxHo_pnl4LHlcMFbAvgTW0RkfkIciE application/json 247 INFO 2020-09-25 14:59:19,170 [94 ] uthentication.JwtBearer.JwtBearerHandler - Bearer was not authenticated. Failure message: No SecurityTokenValidator available for token: AIzaSyBd_YpujEtRhFD1cTA9zL9FcWyEV0qACJo INFO 2020-09-25 14:59:19,170 [94 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Decisively.Web.Controllers.TokenAuthController.RefreshToken (Decisively.Web.Core)' INFO 2020-09-25 14:59:19,191 [94 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "RefreshToken", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Decisively.Authorization.Accounts.Dto.RefreshTokenResult] RefreshToken(System.String) on controller Decisively.Web.Controllers.TokenAuthController (Decisively.Web.Core). ERROR 2020-09-25 14:59:19,271 [9 ] Mvc.ExceptionHandling.AbpExceptionFilter - Refresh token is not valid! System.ComponentModel.DataAnnotations.ValidationException: Refresh token is not valid! ---> System.InvalidOperationException: Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities. at Microsoft.EntityFrameworkCore.Internal.EntityFinder1.LoadAsync(INavigation navigation, InternalEntityEntry entry, CancellationToken cancellationToken) at Abp.Domain.Repositories.RepositoryExtensions.EnsureCollectionLoadedAsync[TEntity,TPrimaryKey,TProperty](IRepository2 repository, TEntity entity, Expression1 collectionExpression, CancellationToken cancellationToken) at Abp.Authorization.Users.AbpUserStore2.GetClaimsAsync(TUser user, CancellationToken cancellationToken) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserManager1.GetClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.GenerateClaimsAsync(TUser user) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory2.GenerateClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.CreateAsync(TUser user) at Abp.Authorization.AbpUserClaimsPrincipalFactory2.CreateAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 238 --- End of inner exception stack trace --- at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 250 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

    Exception Log from Mobile

    {Flurl.Http.FlurlHttpException: Call failed with status code 500 (Internal Server Error): POST http://10.0.2.2:22742/api/TokenAuth/RefreshToken at Flurl.Http.FlurlRequest.HandleExceptionAsync (Flurl.Http.HttpCall call, System.Exception ex, System.Threading.CancellationToken token) [0x00105] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x003a1] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x004bb] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.HttpResponseMessageExtensions.ReceiveJson[T] (System.Threading.Tasks.Task1[TResult] response) [0x0006e] in &lt;7be22aadf26d4808b35d54cc18db202b&gt;:0 at Decisively.ApiClient.AccessTokenManager.RefreshTokenAsync () [0x000a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\ApiClient\AccessTokenManager.cs:93 at Decisively.Configuration.UserConfigurationService.RefreshAccessTokenAndSendRequestAgain () [0x0003e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:63 at Decisively.Configuration.UserConfigurationService.GetAuthenticatedUserConfig () [0x00178] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:46 at Decisively.Configuration.UserConfigurationService.GetAsync (System.Boolean isUserLoggedIn) [0x00036] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:27 at Decisively.ViewModels.Base.UserConfigurationManager+&lt;&gt;c__DisplayClass4_0.&lt;GetAsync&gt;b__0 () [0x0002e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\ViewModels\Base\UserConfigurationManager.cs:41 at Decisively.Core.Threading.WebRequestExecuter.Execute[TResult] (System.Func1[TResult] func, System.Func2[T,TResult] successCallback, System.Func2[T,TResult] failCallback, System.Action finallyCallback) [0x002a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\Core\Threading\WebRequestExecuter.cs:53 }


    API Error Log

    INFO 2020-09-25 14:59:19,169 [94 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST http://localhost:22742/api/TokenAuth/RefreshToken?refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXeSJ9.IVAwaBWY5IGKkSxHo_pnl4LHlcMFbAvgTW0RkfkIciE application/json 247 INFO 2020-09-25 14:59:19,170 [94 ] uthentication.JwtBearer.JwtBearerHandler - Bearer was not authenticated. Failure message: No SecurityTokenValidator available for token: AIzaSyBd_YpujEtRhFD1cTA9zL9FcWyEV0qACJo INFO 2020-09-25 14:59:19,170 [94 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Decisively.Web.Controllers.TokenAuthController.RefreshToken (Decisively.Web.Core)' INFO 2020-09-25 14:59:19,191 [94 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "RefreshToken", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Decisively.Authorization.Accounts.Dto.RefreshTokenResult] RefreshToken(System.String) on controller Decisively.Web.Controllers.TokenAuthController (Decisively.Web.Core). ERROR 2020-09-25 14:59:19,271 [9 ] Mvc.ExceptionHandling.AbpExceptionFilter - Refresh token is not valid! System.ComponentModel.DataAnnotations.ValidationException: Refresh token is not valid! ---> System.InvalidOperationException: Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities. at Microsoft.EntityFrameworkCore.Internal.EntityFinder1.LoadAsync(INavigation navigation, InternalEntityEntry entry, CancellationToken cancellationToken) at Abp.Domain.Repositories.RepositoryExtensions.EnsureCollectionLoadedAsync[TEntity,TPrimaryKey,TProperty](IRepository2 repository, TEntity entity, Expression1 collectionExpression, CancellationToken cancellationToken) at Abp.Authorization.Users.AbpUserStore2.GetClaimsAsync(TUser user, CancellationToken cancellationToken) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserManager1.GetClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.GenerateClaimsAsync(TUser user) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory2.GenerateClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.CreateAsync(TUser user) at Abp.Authorization.AbpUserClaimsPrincipalFactory2.CreateAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 238 --- End of inner exception stack trace --- at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 250 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Is this the real token or is it truncated ? Because it is not a valid JWT token.

  • User Avatar
    0
    Jorahealth created

    The token is truncated

  • User Avatar
    0
    Jorahealth created

    I am pasting the full log....

    Exception Log from Mobile

    {Flurl.Http.FlurlHttpException: Call failed with status code 500 (Internal Server Error): POST http://10.0.2.2:22742/api/TokenAuth/RefreshToken at Flurl.Http.FlurlRequest.HandleExceptionAsync (Flurl.Http.HttpCall call, System.Exception ex, System.Threading.CancellationToken token) [0x00105] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x003a1] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.FlurlRequest.SendAsync (System.Net.Http.HttpMethod verb, System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken, System.Net.Http.HttpCompletionOption completionOption) [0x004bb] in <7be22aadf26d4808b35d54cc18db202b>:0 at Flurl.Http.HttpResponseMessageExtensions.ReceiveJson[T] (System.Threading.Tasks.Task1[TResult] response) [0x0006e] in <7be22aadf26d4808b35d54cc18db202b>:0 at Decisively.ApiClient.AccessTokenManager.RefreshTokenAsync () [0x000a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\ApiClient\AccessTokenManager.cs:93 at Decisively.Configuration.UserConfigurationService.RefreshAccessTokenAndSendRequestAgain () [0x0003e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:63 at Decisively.Configuration.UserConfigurationService.GetAuthenticatedUserConfig () [0x00178] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:46 at Decisively.Configuration.UserConfigurationService.GetAsync (System.Boolean isUserLoggedIn) [0x00036] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Application.Client\Configuration\UserConfigurationService.cs:27 at Decisively.ViewModels.Base.UserConfigurationManager+<>c__DisplayClass4_0.<GetAsync>b__0 () [0x0002e] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\ViewModels\Base\UserConfigurationManager.cs:41 at Decisively.Core.Threading.WebRequestExecuter.Execute[TResult] (System.Func1[TResult] func, System.Func2[T,TResult] successCallback, System.Func2[T,TResult] failCallback, System.Action finallyCallback) [0x002a1] in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Mobile.Shared\Core\Threading\WebRequestExecuter.cs:53 }


    API Error Log

    INFO 2020-09-25 14:59:19,169 [94 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST http://localhost:22742/api/TokenAuth/RefreshToken?refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IktHU0pNNFMyNkc1QzVaU05FRUZKWU5KV1Q1M0JRU1JWIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW4iLCJodHRwOi8vd3d3LmFzcG5ldGJvaWxlcnBsYXRlLmNvbS9pZGVudGl0eS9jbGFpbXMvdGVuYW50SWQiOiIxNSIsInN1YiI6IjEiLCJqdGkiOiI3Mjg0NDZlNS00NWMwLTQxMzItOGY3My02OTY5ZWQzYWJjZGEiLCJpYXQiOjE2MDA5NTMwMDMsInRva2VuX3ZhbGlkaXR5X2tleSI6Ijk2ZTNhM2NjLTZmZGItNGU0MS04MzVmLTc3ZmZjNDRhZGUyZSIsInVzZXJfaWRlbnRpZmllciI6IjFAMTUiLCJ0b2tlbl90eXBlIjoiMSIsIm5iZiI6MTYwMDk1MzAwMywiZXhwIjoxNjMyNDg5MDAzLCJpc3MiOiJEZWNpc2l2ZWx5IiwiYXVkIjoiRGVjaXNpdmVseSJ9.IVAwaBWY5IGKkSxHo_pnl4LHlcMFbAvgTW0RkfkIciE application/json 247 INFO 2020-09-25 14:59:19,170 [94 ] uthentication.JwtBearer.JwtBearerHandler - Bearer was not authenticated. Failure message: No SecurityTokenValidator available for token: AIzaSyBd_YpujEtRhFD1cTA9zL9FcWyEV0qACJo INFO 2020-09-25 14:59:19,170 [94 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Decisively.Web.Controllers.TokenAuthController.RefreshToken (Decisively.Web.Core)' INFO 2020-09-25 14:59:19,191 [94 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "RefreshToken", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Decisively.Authorization.Accounts.Dto.RefreshTokenResult] RefreshToken(System.String) on controller Decisively.Web.Controllers.TokenAuthController (Decisively.Web.Core). ERROR 2020-09-25 14:59:19,271 [9 ] Mvc.ExceptionHandling.AbpExceptionFilter - Refresh token is not valid! System.ComponentModel.DataAnnotations.ValidationException: Refresh token is not valid! ---> System.InvalidOperationException: Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities. at Microsoft.EntityFrameworkCore.Internal.EntityFinder1.LoadAsync(INavigation navigation, InternalEntityEntry entry, CancellationToken cancellationToken) at Abp.Domain.Repositories.RepositoryExtensions.EnsureCollectionLoadedAsync[TEntity,TPrimaryKey,TProperty](IRepository2 repository, TEntity entity, Expression1 collectionExpression, CancellationToken cancellationToken) at Abp.Authorization.Users.AbpUserStore2.GetClaimsAsync(TUser user, CancellationToken cancellationToken) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserManager1.GetClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.GenerateClaimsAsync(TUser user) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory2.GenerateClaimsAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Microsoft.AspNetCore.Identity.UserClaimsPrincipalFactory1.CreateAsync(TUser user) at Abp.Authorization.AbpUserClaimsPrincipalFactory2.CreateAsync(TUser user) at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 238 --- End of inner exception stack trace --- at Decisively.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in C:\Decisively_8.9.2\Solution\Decisively\aspnet-core\src\Decisively.Web.Core\Controllers\TokenAuthController.cs:line 250 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Jorahealth

    Is it also possible to share the full token via email with [email protected] ? Audiance of the token and refresh token might be different.

  • User Avatar
    0
    Jorahealth created

    Hi ismcagdas I have sent this to the email....

    The Access token validity is for a day, the refresh token 1 year, looks like the access token is not being renewed and the issue is with the refresh token. We reduced the refresh token expiry to 10 mins and then it automatically redirects to the login page on the mobile app.

  • User Avatar
    0
    Jorahealth created

    Hi, Any updates on this, I had sent the token via email. Your support is greatly appreciated.

  • User Avatar
    0
    Jorahealth created

    Hi ismcagdas

    I am adding screen shots of the application log ...where it says the refresh token is not valid! I have sent the token to the email as requested but have had no response?? Could you please provide a response for this?

  • User Avatar
    0
    alper created
    Support Team

    hi,

    try this fix => https://support.aspnetzero.com/QA/Questions/9288/Xamarin-App-after-few-hours-of-inactivity-the-user-gets-an-error-Something-went-wrong#answer-e1306c5e-250f-9e99-dc04-39f7ad5fbd78

  • User Avatar
    0
    mika created

    We have also this exact problem

    "System.InvalidOperationException: Navigation property 'Claims' on entity of type 'User' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities" there are some issues at Github for this line, for example this Latest maybe related issue, but that is closed without clear description of the fix.

    The Xamarin app crashes because:

    1. On startup, UserConfigurationManager.GetIfNeedsAsync() is called and because AppContext.Value.Configuration is null, it will call GetAsync();
    2. App notices that login info exists, and uses token.
    3. Token is expired => RefreshToken
    4. RefreshToken call fails because of the server side problem
    5. WebRequestExecuter.Execute will execute inbuild exception handling
    6. In exception handling, L.Localize("Error") is called to generate Alert
    7. In L.Localize => LocalizeInternal, there is a check that if appContext.Configuration == null => throw new Exception("Set configuration before using remote localization!");

    This exception will crash your app :)

    We are building a workaround for the UserConfigurationManager.GetIfNeedsAsync() call to ignore any exceptions and if refresh token fails, we will clear Login info and call GetAsync again to be able to navigate to the LoginView.

    For Zero people, you should consider rethinking the startup process and make sure that the app will start on every situation.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mika

    Does this error happen all the time when the token is expired or just sometimes ?

    Thanks,

  • User Avatar
    0
    mika created

    Hi @ismcagdas

    This happens only on some users/tenants/sometimes. I have not experienced this, but my collegue has and multiple users are complaining about this. We also use Appcenter to log errors and this has caused several crashes since we updated to V7.3.1

  • User Avatar
    0
    alper created
    Support Team

    can you try to replace the L.Localize("Error") with simple text Error in the corresponding code part. if it solves, we can understand the issue better.

  • User Avatar
    0
    mika created

    For us, the workaround helped to prevent app crash, but we still get the refresh token failure. Now after 24h, some users must login again because refresh token fails to get new access token.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mika

    Does your server restart in such a short period ? It might be related to server so that refresh token becomes invalid somehow.

  • User Avatar
    0
    mika created

    Hi @ismcagdas I don't think so.. We run service in Azure as App service, and have the setting "Allways on" set on.

    Also, since this problem does not happen on every user/device, I don't believe it is related to that.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mika

    Thanks. Could you create an issue on GitHub github.com/aspnetzero/aspnet-zero-core/issues/new including reproduction steps ? We can investigate this further.

  • User Avatar
    0
    mika created
  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @mika.

  • User Avatar
    0
    mika created

    Any updates on this case?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mika

    Unfortunately, we couldn't reproduce this on our side. Do you have any clue how to reproduce this ?

  • User Avatar
    0
    Jorahealth created

    This is still not working for us and the app crashes after expriry of the token.

    I had not replied earlier as I felt this issue would be addressed, Could you please suggest a solution or work around?

    Many Thanks

  • User Avatar
    0
    Jorahealth created

    Any response? I would reaaly appreciate it if you could come back to me on this one quickly....

  • User Avatar
    0
    alper created
    Support Team

    duplicate of https://github.com/aspnetzero/aspnet-zero-core/issues/3558

  • User Avatar
    0
    Jorahealth created

    We investigated this further....

    We are only getting issue with Refresh token in TENANT. **It works in HOST. **

    In Tenant here is the log again....

    Refresh Token issue for Tenant ADMIN

    Getting StatusCode: 500, ReasonPhrase: 'Internal Server Error' for 'https://10.0.2.2:44301/api/TokenAuth/RefreshToken'

    AppData Log

    INFO 2021-01-06 14:10:07,486 [109 ] Microsoft.AspNetCore.Hosting.Diagnostics - Request starting HTTP/1.1 POST https://10.0.2.2:44301/api/TokenAuth/RefreshToken application/x-www-form-urlencoded; charset=utf-8 884 INFO 2021-01-06 14:10:07,501 [109 ] ft.AspNetCore.Routing.EndpointMiddleware - Executing endpoint 'Decisively.Web.Controllers.TokenAuthController.RefreshToken (Decisively.Web.Core)' INFO 2021-01-06 14:10:07,513 [109 ] c.Infrastructure.ControllerActionInvoker - Route matched with {action = "RefreshToken", controller = "TokenAuth", area = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Decisively.Authorization.Accounts.Dto.RefreshTokenResult] RefreshToken(System.String) on controller Decisively.Web.Controllers.TokenAuthController (Decisively.Web.Core). ERROR 2021-01-06 14:10:07,799 [101 ] Mvc.ExceptionHandling.AbpExceptionFilter - Refresh token is not valid!

    We chaecked if the Refresh token stored and retried are the same and they are....

    Received Refresh Token

    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IlJMNEJYN0ZYRURMSUJLM1NPRFlZTUtDSU5BUUxKRDNEIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW4iLCJodHRwOi8vd3d3LmFzcG5ldGJvaWxlcnBsYXRlLmNvbS9pZGVudGl0eS9jbGFpbXMvdGVuYW50SWQiOiI4Iiwic3ViIjoiMSIsImp0aSI6IjMxNWUxMzg4LTU1YTMtNDFhOS04MjM4LTczMDBlZTc4ZDQ1YiIsImlhdCI6MTYwOTk0NzUzMSwidG9rZW5fdmFsaWRpdHlfa2V5IjoiZGU2NjIwNmYtZTgwZi00ZjlkLWFlZWEtM2I1NGNhZGQ0NDY1IiwidXNlcl9pZGVudGlmaWVyIjoiMUA4IiwidG9rZW5fdHlwZSI6IjEiLCJuYmYiOjE2MDk5NDc1MzEsImV4cCI6MTY0MTQ4MzUzMSwiaXNzIjoiRGVjaXNpdmVseSIsImF1ZCI6IkRlY2lzaXZlbHkifQ._ThtS4KNnGdzXAydPmPbFcLMMH3DTXtacqJNdAGsKDw"

    Refresh Token which passed in api

    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYWRtaW4iLCJBc3BOZXQuSWRlbnRpdHkuU2VjdXJpdHlTdGFtcCI6IlJMNEJYN0ZYRURMSUJLM1NPRFlZTUtDSU5BUUxKRDNEIiwiaHR0cDovL3NjaGVtYXMubWljcm9zb2Z0LmNvbS93cy8yMDA4LzA2L2lkZW50aXR5L2NsYWltcy9yb2xlIjoiQWRtaW4iLCJodHRwOi8vd3d3LmFzcG5ldGJvaWxlcnBsYXRlLmNvbS9pZGVudGl0eS9jbGFpbXMvdGVuYW50SWQiOiI4Iiwic3ViIjoiMSIsImp0aSI6IjMxNWUxMzg4LTU1YTMtNDFhOS04MjM4LTczMDBlZTc4ZDQ1YiIsImlhdCI6MTYwOTk0NzUzMSwidG9rZW5fdmFsaWRpdHlfa2V5IjoiZGU2NjIwNmYtZTgwZi00ZjlkLWFlZWEtM2I1NGNhZGQ0NDY1IiwidXNlcl9pZGVudGlmaWVyIjoiMUA4IiwidG9rZW5fdHlwZSI6IjEiLCJuYmYiOjE2MDk5NDc1MzEsImV4cCI6MTY0MTQ4MzUzMSwiaXNzIjoiRGVjaXNpdmVseSIsImF1ZCI6IkRlY2lzaXZlbHkifQ._ThtS4KNnGdzXAydPmPbFcLMMH3DTXtacqJNdAGsKDw"

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Jorahealth

    Does it happen eveyr time for Tenant users or it happens randomly sometimes ?

  • User Avatar
    0
    Jorahealth created

    HI @ismcagdas

    We are in testing phase and dont have many tenant users. But it happens everytime to all tenant users.

  • User Avatar
    0
    alper created
    Support Team

    this is your JWT token

    tenantId :8 user: admin

    @ismcagdas is this valid?

    {
      "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "1",
      "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": "admin",
      "AspNet.Identity.SecurityStamp": "RL4BX7FXEDLIBK3SODYYMKCINAQLJD3D",
      "http://schemas.microsoft.com/ws/2008/06/identity/claims/role": "Admin",
      "http://www.aspnetboilerplate.com/identity/claims/tenantId": "8",
      "sub": "1",
      "jti": "315e1388-55a3-41a9-8238-7300ee78d45b",
      "iat": 1609947531,
      "token_validity_key": "de66206f-e80f-4f9d-aeea-3b54cadd4465",
      "user_identifier": "1@8",
      "token_type": "1",
      "nbf": 1609947531,
      "exp": 1641483531,
      "iss": "Decisively",
      "aud": "Decisively"
    }
    
  • User Avatar
    0
    Jorahealth created

    Any updates on this? Many Thanks

  • User Avatar
    0
    alper created
    Support Team

    let's track this issue from the original issue see https://github.com/aspnetzero/aspnet-zero-core/issues/3558#issuecomment-754440061