Reputation: 1
I'm trying AspBoilerPlate as a framework because it looks really good and I've been having a hard time trying to get multitenancy on Owin Identity (I posted a question some days ago: Asp.Net Identity Multitenant
I downloaded the Asp.Net MVC so I can port the code I already have, the right from scratch the loads I can login create users, tenants but, on any view if I click Edit It says Error ocurred, at login view if I click change Tenant an error ocurred.
This are the steps I took (Tried both ASP.Net MVC and Core versions):
It works but with the erros I described above.
I used step into function on VS to try to get the real error, but it might be catching it on an external dll or something, Here is the clean log.txt only doing Load-Login-Change tenant(error) - Login - Edit tenant (error)
DEBUG 2019-09-24 13:12:59,986 [1 ] Abp.Modules.AbpModuleManager - Found 17 ABP modules in total.
DEBUG 2019-09-24 13:12:59,995 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.Web.myapplicationWebModule, myapplication.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,997 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.myapplicationDataModule, myapplication.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,997 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.EntityFramework.AbpZeroEntityFrameworkModule, Abp.Zero.EntityFramework, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,998 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.AbpZeroCoreModule, Abp.Zero, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,999 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.AbpZeroCommonModule, Abp.Zero.Common, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:12:59,999 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AbpKernelModule, Abp, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,006 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkModule, Abp.EntityFramework, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,006 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkCommonModule, Abp.EntityFramework.Common, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,007 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.myapplicationCoreModule, myapplication.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,007 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.myapplicationApplicationModule, myapplication.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,012 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AutoMapper.AbpAutoMapperModule, Abp.AutoMapper, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,012 [1 ] Abp.Modules.AbpModuleManager - Loaded module: myapplication.Api.myapplicationWebApiModule, myapplication.WebApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.WebApi.AbpWebApiModule, Abp.Web.Api, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebModule, Abp.Web, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,013 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebCommonModule, Abp.Web.Common, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,014 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.SignalR.AbpWebSignalRModule, Abp.Web.SignalR, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,014 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.Mvc.AbpWebMvcModule, Abp.Web.Mvc, Version=4.9.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:00,018 [1 ] Abp.Modules.AbpModuleManager - 17 modules loaded.
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted Abp (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted AbpZero (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted myapplication (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,252 [1 ] o.Configuration.LanguageManagementConfig - Converted AbpWeb (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource
DEBUG 2019-09-24 13:13:03,865 [1 ] EntityFramework.AbpEntityFrameworkModule - Registering DbContext: myapplication.EntityFramework.myapplicationDbContext, myapplication.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DEBUG 2019-09-24 13:13:06,085 [1 ] Abp.Localization.LocalizationManager - Initializing 4 localization sources.
DEBUG 2019-09-24 13:13:06,161 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp
DEBUG 2019-09-24 13:13:06,219 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpZero
DEBUG 2019-09-24 13:13:06,247 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: myapplication
DEBUG 2019-09-24 13:13:06,280 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb
DEBUG 2019-09-24 13:13:06,391 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Castle.Proxies.BackgroundJobManagerProxy
DEBUG 2019-09-24 13:13:06,468 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 11 classes define auto mapping attributes
DEBUG 2019-09-24 13:13:06,469 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Sessions.Dto.TenantLoginInfoDto
DEBUG 2019-09-24 13:13:06,477 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Sessions.Dto.UserLoginInfoDto
DEBUG 2019-09-24 13:13:06,478 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Users.Dto.CreateUserDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Users.Dto.UpdateUserDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Users.Dto.UserDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Roles.Dto.PermissionDto
DEBUG 2019-09-24 13:13:06,479 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.MultiTenancy.Dto.CreateTenantDto
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.MultiTenancy.Dto.EditTenantDto
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.MultiTenancy.Dto.TenantDto
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Web.Models.Account.TenantChangeViewModel
DEBUG 2019-09-24 13:13:06,480 [1 ] Abp.AutoMapper.AbpAutoMapperModule - myapplication.Web.Models.Account.TenantSelectionViewModel+TenantInfo
DEBUG 2019-09-24 13:13:08,736 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Sessions.ISessionAppService' with service name 'app/session'.
DEBUG 2019-09-24 13:13:08,737 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Users.IUserAppService' with service name 'app/user'.
DEBUG 2019-09-24 13:13:08,738 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Roles.IRoleAppService' with service name 'app/role'.
DEBUG 2019-09-24 13:13:08,739 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.MultiTenancy.ITenantAppService' with service name 'app/tenant'.
DEBUG 2019-09-24 13:13:08,740 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Configuration.IConfigurationAppService' with service name 'app/configuration'.
DEBUG 2019-09-24 13:13:08,741 [1 ] Abp.Logging.LogHelper - Dynamic web api controller is created for type 'myapplication.Authorization.Accounts.IAccountAppService' with service name 'app/account'.
WARN 2019-09-24 13:13:26,032 [6 ] Abp.Logging.LogHelper - Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Web.Mvc.Authorization.AbpMvcAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext)
Abp.Authorization.AbpAuthorizationException: Current user did not login to the application!
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<CheckPermissions>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.AuthorizationHelper.<AuthorizeAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
at Abp.Authorization.AuthorizationHelperExtensions.Authorize(IAuthorizationHelper authorizationHelper, MethodInfo methodInfo, Type type)
at Abp.Web.Mvc.Authorization.AbpMvcAuthorizeFilter.OnAuthorization(AuthorizationContext filterContext)
DEBUG 2019-09-24 13:15:15,987 [12 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is connected: {"ConnectionId":"93594c5a-5aa2-40be-af8e-c3487535bd12","IpAddress":"192.168.42.1","TenantId":null,"UserId":1,"ConnectTime":"2019-09-24T13:15:15.9774976-06:00","Properties":{}}
DEBUG 2019-09-24 13:15:16,020 [6 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is registered: 93594c5a-5aa2-40be-af8e-c3487535bd12
DEBUG 2019-09-24 13:15:28,150 [10 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is disconnected: 93594c5a-5aa2-40be-af8e-c3487535bd12
DEBUG 2019-09-24 13:15:30,882 [12 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is connected: {"ConnectionId":"e9afe71e-bc64-4c18-a66c-a7381fae6701","IpAddress":"192.168.42.1","TenantId":null,"UserId":1,"ConnectTime":"2019-09-24T13:15:30.8823332-06:00","Properties":{}}
DEBUG 2019-09-24 13:15:30,889 [6 ] Abp.Web.SignalR.Hubs.AbpCommonHub - A client is registered: e9afe71e-bc64-4c18-a66c-a7381fae6701
WARN 2019-09-24 13:15:35,697 [9 ] naries.DictionaryBasedLocalizationSource - Can not find 'EditTenant' in localization source 'myapplication'!
I was wondering if the free version didn't work from scratch, I've been looking for errors like this but everybody seems to get it working, and have the problems after they start changing code.
The reason I wasn’t getting the error on the debug is because is happening at javascript-ajax call, jquery.js on fuction:
jQuery.parseJSON = function( data ) {
return JSON.parse( data + "" );
};
The data parameter is receiving:
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">
<span>Change tenant</span>
</h4>
</div>
<div class="modal-body">
<form name="TenantChangeForm" role="form" novalidate class="form-validation">
<div class="form-group form-float">
<div class="form-line">
<input class="form-control" type="text" name="TenancyName" maxlength="64">
<label class="form-label">Tenancy name</label>
</div>
</div>
<span class="help-block">Leave empty to switch to the host</span>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default close-button waves-effect" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary save-button waves-effect">Save</button>
</div>
<script src="/Views/Account/_TenantChangeModal.js" type="text/javascript"></script>
Witch give the error: SyntaxError: Unexpected token < in JSON at position 0.
And returns to abp.jquery.js :
}).fail(function (jqXHR) {
if (jqXHR.responseJSON && jqXHR.responseJSON.__abp) {
abp.ajax.handleResponse(jqXHR.responseJSON, userOptions, $dfd, jqXHR);
} else {
abp.ajax.handleNonAbpErrorResponse(jqXHR, userOptions, $dfd);
}
Ive been looking and all modals won't show and all view contain a JS to show like this:
(function () {
$('.tenant-change-component a')
.click(function (e) {
e.preventDefault();
abp.ajax({
url: abp.appPath + 'Account/TenantChangeModal',
type: 'POST',
contentType: 'application/html',
success: function (content) {
$('#TenantChangeModal div.modal-content').html(content);
},
error: function (e) { }
});
});
})();
The problem is related to modal, but only on change tenant and edits tenant, if I try create tenant or user it works.
After going to the JSON.Parse and receiving the entire view as parameter it gets a parser error and this: jqXHR.status get status 200.
Added a Watch to the data variable and with the modals that work never gets the entire view as parameter keeps null. Tried modify the function to always return null but screen only gets dark.
Also tried to update jquery.js to 2.2.4(below 3), because the template uses 2.2.0. and still the same problem.
Upvotes: 0
Views: 2557
Reputation: 33403
I posted the question on GitHub: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/4889
And it's solved by doing some changes on the Index.js (or Default.js) of the views that fire a modal:
Replace: $.ajax({
With: abp.ajax({
and
Replace: contentType: 'application/html',
With: dataType: 'html',
Added on behalf of question asker.
Upvotes: 1