Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Problem creating a new Tenant #2679


User avatar
0
bilalhaidar created

hi, I am creating a new tenant from host interface using the admin account.

I set my own password and don't force the system to send activation email.

When I try to login with the admin/password I put, I get an error. Here is the details of the exception from log file.

Where shall I look to know what's going on?

I tried creating around 4 tenants and same problem with all!

Inside VS, when I debug the code, I get the result of LockedOut. How come first time I try to login I get locked out?

private async Task<AbpLoginResult<Tenant, User>> GetLoginResultAsync(string usernameOrEmailAddress, string password, string tenancyName)
        {
            var loginResult = await _logInManager.LoginAsync(usernameOrEmailAddress, password, tenancyName);

            switch (loginResult.Result)
            {
                case AbpLoginResultType.Success:
                    return loginResult;
                default:
                    throw _abpLoginResultTypeHelper.CreateExceptionForFailedLoginAttempt(loginResult.Result, usernameOrEmailAddress, tenancyName);
            }
        }
WARN  2017-03-14 19:27:01,394 [10   ] ystems.Web.Controllers.AccountController - Login failed!
Abp.UI.UserFriendlyException: Login failed!
   at Drc.OnlineSystems.Web.Controllers.AccountController.<GetLoginResultAsync>d__22.MoveNext() in D:\Workspace\DrcOnlineSystems\Drc.OnlineSystems.Web\Controllers\AccountController.cs:line 208
--- 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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Drc.OnlineSystems.Web.Controllers.AccountController.&lt;Login&gt;d__19.MoveNext() in D:\Workspace\DrcOnlineSystems\Drc.OnlineSystems.Web\Controllers\AccountController.cs:line 137
--- 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.Threading.InternalAsyncHelper.&lt;AwaitTaskWithPostActionAndFinallyAndGetResult&gt;d__5`1.MoveNext() in D:\Halil\Github\aspnetboilerplate\src\Abp\Threading\InternalAsyncHelper.cs:line 120
--- 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 System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)

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

    Hi,

    You are right, this is not the expected behaviour. Can you share a screenshot of db record for inserted tenant data ?

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    Thanks Ismail.

    Find attached a snapshot pls.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    One more thing, does this happen every time when you create a new tenant ?

  • User Avatar
    0
    bilalhaidar created

    Yes. I created all those tenants as I was trying and I was infront of client :( and all failed.

    any idea whats going on?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you send your project to us via email ? We will check it locally and it will be faster to find problem.

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    Hi, For some reason, on another machine, where I work also on the same solution through TFS, I am able to create new Tenant and login to it.

    Is it something related to DB? Shall I send the solution still?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think both projects use same database right ? If so, can you try to get a fresh copy of solution to your computer (the one with the problem) and try again ?

  • User Avatar
    0
    bilalhaidar created

    No, each solution uses its own DB. Each DB + Solution is on one machine. So I have 2 machines. On the machine I can make it work fine, on this machine now it doesn't work.

    I can run now on a new fresh dB and see if problem exists. but I am worried when I go production to have to drop the db etc.

    I've emailed you the solution.

    Many thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I have tried the solution with a new DB but it worked as expected. If there is no private data, please send the database backup to <a href="mailto:[email protected]">[email protected]</a> as well and I will try with that.

    Thanks.