Hi @ismcagdas!
I think you are right! I cleaned my main browsers data and also tried with other browsers and the problem does not occur anymore.
Thank you so much!
Implemented preprocessor directive as a work-around:
#if DEBUG
try
{
context.Token = SimpleStringCipher.Instance.Decrypt(qsAuthToken, AppConsts.DefaultPassPhrase);
}
catch
{
// ignore
}
#else
context.Token = SimpleStringCipher.Instance.Decrypt(qsAuthToken, AppConsts.DefaultPassPhrase);
#endif
I would prefer a better solution, though ...
PS: It seems there is a problem with the SignalR chat-service related to this as well! When impersonating a tenant user, chat-service failed to connect, also when switching back to host user, chat-service failed to connect. Since I use the workaround above the problem seems to be gone.
I just tried with a clean install of my project (version 9.0.1) and this problem still exists.
I just tried with a clean install of my project and this problem exists there as well.
I implemented the #if DEBUG
preprocessor directive as a work-around for my debug environment:
...\CompanyName.ProjectName.Web.Core\Authentication\JwtBearer\PoinowJwtSecurityTokenHandler.cs
#if DEBUG
try
{
AsyncHelper.RunSync(() => ValidateSecurityStampAsync(principal));
}
catch
{
// ignore
}
#else
AsyncHelper.RunSync(() => ValidateSecurityStampAsync(principal));
#endif
and
...\CompanyName.ProjectName.Core\Friendships\Cache\UserFriendsCache.cs
var user = new User();
#if DEBUG
try
{
user = AsyncHelper.RunSync(() => _userManager.FindByIdAsync(userIdentifier.UserId.ToString()));
}
catch
{
// ignore
}
#else
user = AsyncHelper.RunSync(() => _userManager.FindByIdAsync(userIdentifier.UserId.ToString()));
#endif
I would prefere a better solution, though ...
Hi @ismcagdas!
Yes, this file is up to date!
I was wondering if it might be related to one of my other issues: [exception when impersonating tenant user #8611](https://support.aspnetzero.com/QA/Questions/8611/exception-when-impersonating-tenant-user). I used the #if DEBUG
preprocessor directive to work around this issue in my debug environment and thought it might interfere somehow now - I then reverted my changes but it didn't solve the current problem.
9.0.1, .NET Core, Angular
When impersonating a tenant user and later switching back to host user, the following error appears in src\ProjectName.Web.Host\Startup\AuthConfigurer.cs
multiple times:
System.FormatException: 'The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.'
Does any one else experience this issue!?
EDIT
Here is the content of Logs.txt
:
ERROR 2020-07-14 15:22:38,814 [157 ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,777 [119 ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,778 [120 ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,778 [64 ] uthentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
ERROR 2020-07-14 15:22:41,779 [119 ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
ERROR 2020-07-14 15:22:41,779 [157 ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
ERROR 2020-07-14 15:22:41,780 [120 ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
ERROR 2020-07-14 15:22:41,780 [64 ] nostics.DeveloperExceptionPageMiddleware - An unhandled exception has occurred while executing the request.
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64String(String s)
at Abp.Runtime.Security.SimpleStringCipher.Decrypt(String cipherText, String passPhrase, Byte[] salt, Nullable`1 keySize, Byte[] initVectorBytes)
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.SetToken(MessageReceivedContext context, Boolean allowAnonymous) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 126
at CompanyName.ProjectName.Web.Startup.AuthConfigurer.QueryStringTokenResolver(MessageReceivedContext context) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\AuthConfigurer.cs:line 90
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Hi @maliming and thank you for answer!
I built up a separate test environment to test your suggestion and it turned out to work perfectly on the new test environment!
Here is a list of rows I had to remove from AppSettings
table:
Since applying your suggestion to production enivronment I'm facing another problem I'm currently trying to solve - but this seems to be another story.
I consider the original problem I posted here to be solved! Thanks again, @maliming!
8.9.2, Angular
After updating my application from ASPNETZERO 8.8.0 to 8.9.2 the application fails to start with following content in Logs.txt
in production environment:
WARN 2020-06-17 10:04:18,267 [1 ] tion.Repositories.EphemeralXmlRepository - Using an in-memory repository. Keys will not be persisted to storage.
WARN 2020-06-17 10:04:18,277 [1 ] taProtection.KeyManagement.XmlKeyManager - Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
WARN 2020-06-17 10:04:22,237 [10 ] cy.SubscriptionExpireEmailNotifierWorker - Abp.AbpException: There is no setting defined with name: App.UiManagement.Header.DesktopFixedHeader
at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name)
at Abp.Configuration.SettingManager.ConvertSettingInfosToDictionary(List`1 settingValues)
at Abp.Configuration.SettingManager.<GetApplicationSettings>b__64_0()
at Abp.Runtime.Caching.TypedCacheExtensions.<>c__DisplayClass0_0`2.<Get>b__0(TKey k)
at Abp.Runtime.Caching.TypedCacheWrapper`2.<>c__DisplayClass16_0.<Get>b__0(String k)
at Abp.Runtime.Caching.AbpCacheBase`2.Get(TKey key, Func`2 factory)
at Abp.Runtime.Caching.TypedCacheWrapper`2.Get(TKey key, Func`2 factory)
at Abp.Runtime.Caching.TypedCacheExtensions.Get[TKey,TValue](ITypedCache`2 cache, TKey key, Func`1 factory)
at Abp.Configuration.SettingManager.GetApplicationSettings()
at Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNull(String name)
at Abp.Configuration.SettingManager.GetSettingValueInternal(String name, Nullable`1 tenantId, Nullable`1 userId, Boolean fallbackToDefault)
at Abp.Configuration.SettingManager.GetSettingValueForApplication(String name)
at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication_callback(String name)
at Castle.Proxies.Invocations.ISettingManager_GetSettingValueForApplication.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication(String name)
at CompanyName.ProjectName.MultiTenancy.SubscriptionExpireEmailNotifierWorker.DoWork()
at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)
Abp.AbpException: There is no setting defined with name: App.UiManagement.Header.DesktopFixedHeader
at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name)
at Abp.Configuration.SettingManager.ConvertSettingInfosToDictionary(List`1 settingValues)
at Abp.Configuration.SettingManager.<GetApplicationSettings>b__64_0()
at Abp.Runtime.Caching.TypedCacheExtensions.<>c__DisplayClass0_0`2.<Get>b__0(TKey k)
at Abp.Runtime.Caching.TypedCacheWrapper`2.<>c__DisplayClass16_0.<Get>b__0(String k)
at Abp.Runtime.Caching.AbpCacheBase`2.Get(TKey key, Func`2 factory)
at Abp.Runtime.Caching.TypedCacheWrapper`2.Get(TKey key, Func`2 factory)
at Abp.Runtime.Caching.TypedCacheExtensions.Get[TKey,TValue](ITypedCache`2 cache, TKey key, Func`1 factory)
at Abp.Configuration.SettingManager.GetApplicationSettings()
at Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNull(String name)
at Abp.Configuration.SettingManager.GetSettingValueInternal(String name, Nullable`1 tenantId, Nullable`1 userId, Boolean fallbackToDefault)
at Abp.Configuration.SettingManager.GetSettingValueForApplication(String name)
at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication_callback(String name)
at Castle.Proxies.Invocations.ISettingManager_GetSettingValueForApplication.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication(String name)
at CompanyName.ProjectName.MultiTenancy.SubscriptionExpireEmailNotifierWorker.DoWork()
at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e)
FATAL 2020-06-17 10:04:22,360 [1 ] Microsoft.AspNetCore.Hosting.WebHost - Application startup exception
Abp.AbpException: There is no setting defined with name: App.UiManagement.Header.DesktopFixedHeader
at Abp.Configuration.SettingDefinitionManager.GetSettingDefinition(String name)
at Abp.Configuration.SettingManager.ConvertSettingInfosToDictionary(List`1 settingValues)
at Abp.Configuration.SettingManager.<GetApplicationSettings>b__64_0()
at Abp.Runtime.Caching.TypedCacheExtensions.<>c__DisplayClass0_0`2.<Get>b__0(TKey k)
at Abp.Runtime.Caching.TypedCacheWrapper`2.<>c__DisplayClass16_0.<Get>b__0(String k)
at Abp.Runtime.Caching.AbpCacheBase`2.Get(TKey key, Func`2 factory)
at Abp.Runtime.Caching.TypedCacheWrapper`2.Get(TKey key, Func`2 factory)
at Abp.Runtime.Caching.TypedCacheExtensions.Get[TKey,TValue](ITypedCache`2 cache, TKey key, Func`1 factory)
at Abp.Configuration.SettingManager.GetApplicationSettings()
at Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNull(String name)
at Abp.Configuration.SettingManager.GetSettingValueInternal(String name, Nullable`1 tenantId, Nullable`1 userId, Boolean fallbackToDefault)
at Abp.Configuration.SettingManager.GetSettingValueForApplication(String name)
at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication_callback(String name)
at Castle.Proxies.Invocations.ISettingManager_GetSettingValueForApplication.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.SettingManagerProxy.GetSettingValueForApplication(String name)
at Abp.Localization.ApplicationLanguageManager.GetDefaultLanguageOrNull(Nullable`1 tenantId)
at Castle.Proxies.ApplicationLanguageManagerProxy.GetDefaultLanguageOrNull_callback(Nullable`1 tenantId)
at Castle.Proxies.Invocations.ApplicationLanguageManager_GetDefaultLanguageOrNull.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation)
at Castle.DynamicProxy.AsyncDeterminationInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.ApplicationLanguageManagerProxy.GetDefaultLanguageOrNull(Nullable`1 tenantId)
at Abp.Localization.ApplicationLanguageProvider.SetDefaultLanguage(List`1 languageInfos)
at Abp.Localization.ApplicationLanguageProvider.GetActiveLanguages()
at Abp.Localization.LanguageManager.GetActiveLanguages()
at Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbpRequestLocalization(IApplicationBuilder app, Action`1 optionsAction)
at CompanyName.ProjectName.Web.Startup.Startup.Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) in D:\UserName\source\repos\CompanyName.ProjectName.All\Core\src\CompanyName.ProjectName.Web.Host\Startup\Startup.cs:line 219
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder)
at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
WARN 2020-06-17 10:04:22,374 [1 ] taProtection.KeyManagement.XmlKeyManager - No XML encryptor configured. Key {c121703a-69de-4b7a-89dd-6afb1aac3bf3} may be persisted to storage in unencrypted form.
ERROR 2020-06-17 10:04:22,624 [8 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HM0IIK5OCR3M", Request id "0HM0IIK5OCR3M:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,624 [4 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HM0IIK5OCR3O", Request id "0HM0IIK5OCR3O:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,624 [9 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HM0IIK5OCR3N", Request id "0HM0IIK5OCR3N:00000001": An unhandled exception was thrown by the application.
System.ArgumentOutOfRangeException: Index and count must refer to a location within the buffer. (Parameter 'chars')
at System.Text.EncoderNLS.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,624 [7 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HM0IIK5OCR3P", Request id "0HM0IIK5OCR3P:00000001": An unhandled exception was thrown by the application.
System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,661 [4 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HM0IIK5OCR3R", Request id "0HM0IIK5OCR3R:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ERROR 2020-06-17 10:04:22,661 [7 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HM0IIK5OCR3Q", Request id "0HM0IIK5OCR3Q:00000001": An unhandled exception was thrown by the application.
System.OverflowException: Arithmetic operation resulted in an overflow.
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
This problem does not occur in development environment.
Please advice!
@ricavir
I don't think this is the solution to the problem ... It just replaces the real CancellationTokenProvider
with the NullCancellationTokenProvider
(which does nothing).
I think @maliming just wanted me to test something there.
What I did as a work around to silence the exceptions during debugging is the following:
#if DEBUG
try
{
AsyncHelper.RunSync(() => ValidateSecurityStampAsync(principal));
}
catch
{
// ignore
}
#else
AsyncHelper.RunSync(() => ValidateSecurityStampAsync(principal));
#endif